diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
commit | 686113531d23f30e9973d659c456ae33eb9cff1f (patch) | |
tree | f225de7251a8b49b8d183dd168bab0a0addbe23f /lib/chef/chef_fs/file_system | |
parent | d1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff) | |
download | chef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz |
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
Diffstat (limited to 'lib/chef/chef_fs/file_system')
10 files changed, 15 insertions, 15 deletions
diff --git a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb index feb126f036..a6a062ab3c 100644 --- a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb @@ -58,7 +58,7 @@ class Chef :files => { :recursive => true }, :resources => { :ruby_only => true, :recursive => true }, :providers => { :ruby_only => true, :recursive => true }, - :root_files => { }, + :root_files => {}, } def add_child(child) @@ -99,7 +99,7 @@ class Chef parts = segment_file[:path].split("/") # Get or create the path to the file container = self - parts[0,parts.length-1].each do |part| + parts[0, parts.length - 1].each do |part| old_container = container container = old_container.children.select { |child| part == child.name }.first if !container @@ -108,7 +108,7 @@ class Chef end end # Create the file itself - container.add_child(CookbookFile.new(parts[parts.length-1], container, segment_file)) + container.add_child(CookbookFile.new(parts[parts.length - 1], container, segment_file)) end end @children = @children.sort_by { |c| c.name } diff --git a/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb b/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb index 986a04ff4a..37b7af8b5e 100644 --- a/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb +++ b/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb @@ -37,7 +37,7 @@ class Chef def write(contents) desired_invites = minimize_value(Chef::JSONCompat.parse(contents, :create_additions => false)) - actual_invites = _read_json.inject({}) { |h,val| h[val["username"]] = val["id"]; h } + actual_invites = _read_json.inject({}) { |h, val| h[val["username"]] = val["id"]; h } invites = actual_invites.keys (desired_invites - invites).each do |invite| begin diff --git a/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb b/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb index 941c0268cc..d083383a0e 100644 --- a/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb +++ b/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb @@ -10,7 +10,7 @@ class Chef class PolicyRevisionEntry < RestListEntry # /policies/foo-1.0.0.json -> /policies/foo/revisions/1.0.0 - def api_path(options={}) + def api_path(options = {}) "#{parent.api_path}/#{policy_name}/revisions/#{revision_id}" end diff --git a/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb b/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb index 6791b0cd29..488e9c0ed0 100644 --- a/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb @@ -60,7 +60,6 @@ class Chef # the server version directly, and can't ask the server for a list of the endpoints it supports. # - # # Does GET /<api_path>, assumes the result is of the format: # diff --git a/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb b/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb index 5af91e3768..5b9252ba03 100644 --- a/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +++ b/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb @@ -38,10 +38,10 @@ class Chef end def api_child_name - if name.length < 5 || name[-5,5] != ".json" + if name.length < 5 || name[-5, 5] != ".json" raise "Invalid name #{path}: must end in .json" end - name[0,name.length-5] + name[0, name.length - 5] end def api_path diff --git a/lib/chef/chef_fs/file_system/memory/memory_file.rb b/lib/chef/chef_fs/file_system/memory/memory_file.rb index 644273fa9f..7eabc8fcb1 100644 --- a/lib/chef/chef_fs/file_system/memory/memory_file.rb +++ b/lib/chef/chef_fs/file_system/memory/memory_file.rb @@ -9,6 +9,7 @@ class Chef super(name, parent) @value = value end + def read return @value end diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb index 84f665066e..fa6ce9ba9e 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb @@ -59,7 +59,7 @@ class Chef # Use the copy/diff algorithm to copy it down so we don't destroy # chefignored data. This is terribly un-thread-safe. - Chef::ChefFS::FileSystem.copy_to(Chef::ChefFS::FilePattern.new("/#{cookbook_path}"), from_fs, child, nil, {:purge => true}) + Chef::ChefFS::FileSystem.copy_to(Chef::ChefFS::FilePattern.new("/#{cookbook_path}"), from_fs, child, nil, { :purge => true }) # Write out .uploaded-cookbook-version.json cookbook_file_path = File.join(file_path, cookbook_name) diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb index 37bd6fa1ac..5f238888d5 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb @@ -60,7 +60,7 @@ class Chef # [chef_config] - a hash of options that looks suspiciously like the ones # stored in Chef::Config, containing at least these keys: # :versioned_cookbooks:: whether to include versions in cookbook names - def initialize(child_paths, root_paths=[], chef_config=Chef::Config) + def initialize(child_paths, root_paths = [], chef_config = Chef::Config) super("", nil) @child_paths = child_paths @root_paths = root_paths diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb index f9a66240eb..5dc74d85da 100644 --- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb @@ -29,7 +29,7 @@ class Chef # We need the canonical cookbook name if we are using versioned cookbooks, but we don't # want to spend a lot of time adding code to the main Chef libraries canonical_name = canonical_cookbook_name(File.basename(file_path)) - raise "When versioned_cookbooks mode is on, cookbook #{file_path} must match format <cookbook_name>-x.y.z" unless canonical_name + raise "When versioned_cookbooks mode is on, cookbook #{file_path} must match format <cookbook_name>-x.y.z" unless canonical_name # KLUDGE: We shouldn't have to use instance_variable_set loader.instance_variable_set(:@cookbook_name, canonical_name) loader.load_cookbooks diff --git a/lib/chef/chef_fs/file_system/repository/file_system_entry.rb b/lib/chef/chef_fs/file_system/repository/file_system_entry.rb index ac6c85db22..bee017f7a8 100644 --- a/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +++ b/lib/chef/chef_fs/file_system/repository/file_system_entry.rb @@ -44,14 +44,14 @@ class Chef # Except cookbooks and data bag dirs, all things must be json files begin Dir.entries(file_path).sort. - map { |child_name| make_child_entry(child_name) }. - select { |child| child && can_have_child?(child.name, child.dir?) } + map { |child_name| make_child_entry(child_name) }. + select { |child| child && can_have_child?(child.name, child.dir?) } rescue Errno::ENOENT raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!) end end - def create_child(child_name, file_contents=nil) + def create_child(child_name, file_contents = nil) child = make_child_entry(child_name) if child.exists? raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, child) @@ -93,7 +93,7 @@ class Chef def read begin - File.open(file_path, "rb") {|f| f.read} + File.open(file_path, "rb") { |f| f.read } rescue Errno::ENOENT raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!) end |