diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
commit | 35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch) | |
tree | 452c84ce196ce00d672c71a8fa65f86c5a074fac /lib/chef/cookbook | |
parent | eda2808dce8146bfdb308dd658b1dd565df3562b (diff) | |
download | chef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz |
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/cookbook_version_loader.rb | 2 | ||||
-rw-r--r-- | lib/chef/cookbook/metadata.rb | 52 |
2 files changed, 27 insertions, 27 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index b139a8d489..c864c30505 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -34,7 +34,7 @@ class Chef @relative_path = /#{Regexp.escape(@cookbook_path)}\/(.+)$/ @metadata_loaded = false @cookbook_settings = { - :all_files => {}, + all_files: {}, } @metadata_filenames = [] diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index c378cb75b6..94604ea0d9 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -61,10 +61,10 @@ class Chef :source_url, :issues_url, :privacy, :chef_versions, :ohai_versions, :gems ] - VERSION_CONSTRAINTS = { :depends => DEPENDENCIES, - :provides => PROVIDING, - :chef_version => CHEF_VERSIONS, - :ohai_version => OHAI_VERSIONS } + VERSION_CONSTRAINTS = { depends: DEPENDENCIES, + provides: PROVIDING, + chef_version: CHEF_VERSIONS, + ohai_version: OHAI_VERSIONS } include Chef::Mixin::ParamsValidate include Chef::Mixin::FromFile @@ -161,7 +161,7 @@ class Chef set_or_return( :maintainer, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -176,7 +176,7 @@ class Chef set_or_return( :maintainer_email, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -191,7 +191,7 @@ class Chef set_or_return( :license, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -206,7 +206,7 @@ class Chef set_or_return( :description, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -221,7 +221,7 @@ class Chef set_or_return( :long_description, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -252,7 +252,7 @@ class Chef set_or_return( :name, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -409,17 +409,17 @@ class Chef validate( options, { - :display_name => { :kind_of => String }, - :description => { :kind_of => String }, - :choice => { :kind_of => [ Array ], :default => [] }, - :calculated => { :equal_to => [ true, false ], :default => false }, - :type => { :equal_to => %w{string array hash symbol boolean numeric}, :default => "string" }, - :required => { :equal_to => [ "required", "recommended", "optional", true, false ], :default => "optional" }, - :recipes => { :kind_of => [ Array ], :default => [] }, - :default => { :kind_of => [ String, Array, Hash, Symbol, Numeric, TrueClass, FalseClass ] }, - :source_url => { :kind_of => String }, - :issues_url => { :kind_of => String }, - :privacy => { :kind_of => [ TrueClass, FalseClass ] }, + display_name: { kind_of: String }, + description: { kind_of: String }, + choice: { kind_of: [ Array ], default: [] }, + calculated: { equal_to: [ true, false ], default: false }, + type: { equal_to: %w{string array hash symbol boolean numeric}, default: "string" }, + required: { equal_to: [ "required", "recommended", "optional", true, false ], default: "optional" }, + recipes: { kind_of: [ Array ], default: [] }, + default: { kind_of: [ String, Array, Hash, Symbol, Numeric, TrueClass, FalseClass ] }, + source_url: { kind_of: String }, + issues_url: { kind_of: String }, + privacy: { kind_of: [ TrueClass, FalseClass ] }, } ) options[:required] = remap_required_attribute(options[:required]) unless options[:required].nil? @@ -556,7 +556,7 @@ class Chef set_or_return( :source_url, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -571,7 +571,7 @@ class Chef set_or_return( :issues_url, arg, - :kind_of => [ String ] + kind_of: [ String ] ) end @@ -588,7 +588,7 @@ class Chef set_or_return( :privacy, arg, - :kind_of => [ TrueClass, FalseClass ] + kind_of: [ TrueClass, FalseClass ] ) end @@ -689,7 +689,7 @@ INVALID def validate_string_array(arry) if arry.kind_of?(Array) arry.each do |choice| - validate( { :choice => choice }, { :choice => { :kind_of => String } } ) + validate( { choice: choice }, { choice: { kind_of: String } } ) end end end @@ -717,7 +717,7 @@ INVALID end opts[:choice].each do |choice| - validate( { :choice => choice }, { :choice => { :kind_of => validator } } ) + validate( { choice: choice }, { choice: { kind_of: validator } } ) end end end |