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/org.rb | |
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/org.rb')
-rw-r--r-- | lib/chef/org.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/org.rb b/lib/chef/org.rb index ee4451fac0..a148e37aea 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -38,22 +38,22 @@ class Chef @chef_rest ||= Chef::ServerAPI.new(Chef::Config[:chef_server_root]) end - def name(arg=nil) + def name(arg = nil) set_or_return(:name, arg, :regex => /^[a-z0-9\-_]+$/) end - def full_name(arg=nil) + def full_name(arg = nil) set_or_return(:full_name, arg, :kind_of => String) end - def private_key(arg=nil) + def private_key(arg = nil) set_or_return(:private_key, arg, :kind_of => String) end - def guid(arg=nil) + def guid(arg = nil) set_or_return(:guid, arg, :kind_of => String) end @@ -73,13 +73,13 @@ class Chef end def create - payload = {:name => self.name, :full_name => self.full_name} + payload = { :name => self.name, :full_name => self.full_name } new_org = chef_rest.post("organizations", payload) Chef::Org.from_hash(self.to_hash.merge(new_org)) end def update - payload = {:name => self.name, :full_name => self.full_name} + payload = { :name => self.name, :full_name => self.full_name } new_org = chef_rest.put("organizations/#{name}", payload) Chef::Org.from_hash(self.to_hash.merge(new_org)) end @@ -101,7 +101,7 @@ class Chef end def associate_user(username) - request_body = {:user => username} + request_body = { :user => username } response = chef_rest.post "organizations/#{@name}/association_requests", request_body association_id = response["uri"].split("/").last chef_rest.put "users/#{username}/association_requests/#{association_id}", { :response => "accept" } @@ -130,11 +130,11 @@ class Chef end def self.load(org_name) - response = Chef::ServerAPI.new(Chef::Config[:chef_server_root]).get("organizations/#{org_name}") + response = Chef::ServerAPI.new(Chef::Config[:chef_server_root]).get("organizations/#{org_name}") Chef::Org.from_hash(response) end - def self.list(inflate=false) + def self.list(inflate = false) orgs = Chef::ServerAPI.new(Chef::Config[:chef_server_root]).get("organizations") if inflate orgs.inject({}) do |org_map, (name, _url)| |