Skip to content

Commit

Permalink
fix rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Oct 24, 2020
1 parent 2536e0e commit 4382114
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
8 changes: 3 additions & 5 deletions lib/puppet/provider/rvm_gem/gem.rb
Expand Up @@ -107,12 +107,10 @@ def install(useversion = true)
# interpret it as a gem repository
command << '--source' << source.to_s << resource[:name]
end
elsif Gem::Version.new(rubygems_version) < Gem::Version.new('3.0.0')
command << '--no-rdoc' << '--no-ri' << resource[:name] # Deprecated options (backwards compatible)
else
if Gem::Version.new(rubygems_version) < Gem::Version.new('3.0.0')
command << '--no-rdoc' << '--no-ri' << resource[:name] # Deprecated options (backwards compatible)
else
command << '--no-document' << resource[:name]
end
command << '--no-document' << resource[:name]
end

# makefile opts,
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/rvm_gem.rb
Expand Up @@ -2,7 +2,7 @@
@doc = 'Ruby Gem support using RVM.'

def self.title_patterns
[[/^(?:(.*)\/)?(.*)$/, [[:ruby_version, ->(x) { x }], [:name, ->(x) { x }]]]]
[[/^(?:(.*)\/)?(.*)$/, [[:ruby_version, ->(x) { x }], [:name, ->(x) { x }]]]] # rubocop:disable Style/RegexpLiteral
end

ensurable do
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/rvm_system_spec.rb
Expand Up @@ -269,7 +269,7 @@ class { 'rvm::passenger::apache':

it 'answers' do
shell('/usr/bin/curl localhost:80') do |r|
r.stdout.should =~ /^hello <b>world<\/b>$/
r.stdout.should =~ %r{^hello <b>world</b>$}
r.exit_code.should == 0
end
end
Expand Down Expand Up @@ -376,7 +376,7 @@ class { 'rvm::passenger::apache':

it 'answers' do
shell('/usr/bin/curl localhost:80') do |r|
r.stdout.should =~ /^hello <b>world<\/b>$/
r.stdout.should =~ %r{^hello <b>world</b>$}
r.exit_code.should == 0
end
end
Expand All @@ -390,7 +390,7 @@ class { 'rvm::passenger::apache':
r.stdout.should =~ %r{Requests in top\-level queue \: [0-9]+}
r.stdout.should =~ %r{[\-]+ Application groups [\-]+}
# the following will only appear after a request has been made, as in "should answer to" above
r.stdout.should =~ /App root\: \/var\/www\/passenger/
r.stdout.should =~ %r{App root: /var/www/passenger}
r.stdout.should =~ %r{Requests in queue\: [0-9]+}
r.exit_code.should == 0
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/dependencies_spec.rb
Expand Up @@ -17,7 +17,7 @@
case os_facts[:operatingsystemmajrelease]
when '5'
if %w[CentOS RedHat].include? os_facts[:operatingsystem]
it { is_expected.to contain_package('autoconf') }
it { is_expected.to contain_package('autoconf') } # rubocop:disable RSpec/RepeatedExample
it { is_expected.to contain_package('curl-devel') }
it { is_expected.not_to contain_package('libcurl-devel') }
end
Expand All @@ -27,7 +27,7 @@
it { is_expected.not_to contain_package('curl-devel') }
end
when 'Debian'
it { is_expected.to contain_package('autoconf') }
it { is_expected.to contain_package('autoconf') } # rubocop:disable RSpec/RepeatedExample
it { is_expected.to contain_package('build-essential') }
it { is_expected.not_to contain_package('which') }
it { is_expected.not_to contain_package('gcc') }
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/system_spec.rb
Expand Up @@ -8,7 +8,7 @@
root_home: '/root',
osfamily: 'Debian',
os: {
family: 'Debian',
family: 'Debian'
}
}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Expand Up @@ -21,7 +21,7 @@ def install_puppet(host)
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

c.before(:each) do
c.before do
Puppet::Util::Log.level = :warning
Puppet::Util::Log.newdestination(:console)
end
Expand Down

0 comments on commit 4382114

Please sign in to comment.