Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
faxm0dem committed Apr 5, 2018
1 parent f750609 commit 3642539
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
if place_or_version =~ /\A(git[:@][^#]*)#(.*)/
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
Expand All @@ -11,7 +11,7 @@ def location_for(place_or_version, fake_version = nil)
end

def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
if place_or_version =~ /\Agit[:@]/
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
Expand All @@ -24,14 +24,14 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: %i[mswin mingw x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: %i[mswin mingw x64_mingw]
gem 'fast_gettext', '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem 'fast_gettext', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem 'json', '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem 'json_pure', '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down Expand Up @@ -115,7 +115,7 @@ end
# Evaluate Gemfile.local and ~/.gemfile if they exist
extra_gemfiles = [
"#{__FILE__}.local",
File.join(Dir.home, '.gemfile'),
File.join(Dir.home, '.gemfile')
]

extra_gemfiles.each do |gemfile|
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.send('disable_80chars')
Expand All @@ -11,9 +11,9 @@ ignore_paths = ['vendor/**/*', 'spec/**/*', 'smoke/**/*', 'pkg/**/*']

PuppetSyntax.exclude_paths = ignore_paths

#PuppetLint.configuration.ignore_paths = ignore_paths
# PuppetLint.configuration.ignore_paths = ignore_paths
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = ignore_paths
end

task :default => [:spec, :lint]
task default: %i[spec lint]
8 changes: 4 additions & 4 deletions spec/classes/systemd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
os_fixtures = @os_fixtures

describe 'conserver', type: 'class' do
['RedHat7','Debian8','Debian9'].each do |osname|
%w[RedHat7 Debian8 Debian9].each do |osname|
osfixtures = os_fixtures[osname]

context "On os `#{osname}`" do
let :facts do
osfixtures[:facts]
Expand All @@ -14,9 +14,9 @@
it { should contain_systemd__unit_file("#{osfixtures[:params][:server_service_name]}.service") }
end
end
['RedHat6','Debian7','Ubuntu12.04'].each do |osname|
['RedHat6', 'Debian7', 'Ubuntu12.04'].each do |osname|
osfixtures = os_fixtures[osname]

context "On os `#{osname}`" do
let :facts do
osfixtures[:facts]
Expand Down

0 comments on commit 3642539

Please sign in to comment.