Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

fixing rubocop errors #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/cli/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
module JenkinsPipelineBuilder
module CLI
class List < Thor
JenkinsPipelineBuilder.registry.entries.keys.each do |entry|
JenkinsPipelineBuilder.registry.entries.each_key do |entry|
desc entry, "List all #{entry}"
define_method(entry) do
entries = JenkinsPipelineBuilder.registry.registry[:job][entry]
Expand Down
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_settings_bag(item_bag, settings_bag = {})
bag = {}
return unless item.is_a?(Hash)

item.keys.each do |k|
item.each_key do |k|
val = item[k]
next unless val.is_a? String

Expand Down
4 changes: 2 additions & 2 deletions lib/jenkins_pipeline_builder/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Extension
parameters: []
}.freeze

EXT_METHODS.keys.each do |method_name|
EXT_METHODS.each_key do |method_name|
define_method method_name do |value = nil|
return instance_variable_get("@#{method_name}") if value.nil?

Expand Down Expand Up @@ -90,7 +90,7 @@ def check_parameters(value)

def errors
errors = {}
EXT_METHODS.keys.each do |name|
EXT_METHODS.each_key do |name|
errors[name] = 'Must be set' if send(name).nil?
end
errors
Expand Down
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/extensions/build_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
end
end
else
configs(class: 'empty-list') {}
configs(class: 'empty-list'){}
end

projects state[:name]
Expand Down
4 changes: 2 additions & 2 deletions lib/jenkins_pipeline_builder/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Utils
# Code was duplicated from jeknins_api_client
def self.symbolize_keys_deep!(to_symbolize)
return unless to_symbolize.is_a?(Hash)

to_symbolize.keys.each do |k|
to_symbolize_dup = to_symbolize.dup
to_symbolize_dup.each_key do |k|
ks = k.respond_to?(:to_sym) ? k.to_sym : k
to_symbolize[ks] = to_symbolize.delete k # Preserve order even when k == ks
symbolize_keys_deep! to_symbolize[ks] if to_symbolize[ks].is_a? Hash
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/jenkins_pipeline_builder/extension_set_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('spec_helper', __dir__)

describe JenkinsPipelineBuilder::ExtensionSet do
subject(:set) { JenkinsPipelineBuilder::ExtensionSet.new('foo') {} }
subject(:set) { JenkinsPipelineBuilder::ExtensionSet.new('foo'){} }

before :each do
set.name 'example'
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/jenkins_pipeline_builder/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def fixture_path(fixture)
github_site: 'https://github.com',
git_org: 'testorg',
git_repo_name: 'generator_tests'
)).and_return(pr_generator)
)).and_return(pr_generator)

expect(pr_generator).to receive(:open_prs).and_return open_prs
expect(pr_generator).to receive(:delete_closed_prs)
Expand Down