recipes/jenkins_slave.rb
Use tr
instead of gsub
. Open
Open
slave_id = node['fqdn'].gsub(/\./, '_')
- Read upRead up
- Exclude checks
This cop identifies places where gsub
can be replaced by
tr
or delete
.
Example:
# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')
# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')
Line is too long. [86/80] Open
Open
# Set a Jenkins slave attribute that the Jenkins master server will find with a search
- Exclude checks
Line is too long. [86/80] Open
Open
environment = node.chef_environment == 'production' ? '' : ".#{node.chef_environment}"
- Exclude checks