Class: Spice::CookbookVersion
- Inherits:
-
Object
- Object
- Spice::CookbookVersion
- Extended by:
- Persistence
- Includes:
- Persistence, Toy::Store
- Defined in:
- lib/spice/cookbook_version.rb
Instance Attribute Summary (collapse)
-
- (Array) attributes
The attributes attribute.
-
- (String) chef_type
The chef_type attribute.
-
- (String) cookbook_name
The cookbook_name attribute.
-
- (Array) definitions
The definitions attribute.
-
- (Array) files
The files attribute.
-
- (String) json_class
The json_class attribute.
-
- (Array) libraries
The libraries attribute.
-
- (Hash) metadata
The metadata attribute.
-
- (String) name
The name attribute.
-
- (Array) providers
The providers attribute.
-
- (Array) recipes
The recipes attribute.
-
- (Array) resources
The resources attribute.
-
- (Array) root_files
The root_files attribute.
-
- (Array) templates
The templates attribute.
-
- (String) version
The version attribute.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) do_delete
- - (Object) do_post
- - (Object) do_put
-
- (Boolean) new_record?
Check if the cookbook version exists on the Chef server.
Methods included from Persistence
all, connection, endpoint, get, included
Instance Attribute Details
- (Array) attributes
The attributes attribute
17 |
# File 'lib/spice/cookbook_version.rb', line 17 attribute :attributes, Array, :default => [] |
- (String) chef_type
The chef_type attribute
30 |
# File 'lib/spice/cookbook_version.rb', line 30 attribute :chef_type, String, :default => "cookbook_version" |
- (String) cookbook_name
The cookbook_name attribute
26 |
# File 'lib/spice/cookbook_version.rb', line 26 attribute :cookbook_name, String |
- (Array) definitions
The definitions attribute
16 |
# File 'lib/spice/cookbook_version.rb', line 16 attribute :definitions, Array, :default => [] |
- (Array) files
The files attribute
18 |
# File 'lib/spice/cookbook_version.rb', line 18 attribute :files, Array, :default => [] |
- (String) json_class
The json_class attribute
25 |
# File 'lib/spice/cookbook_version.rb', line 25 attribute :json_class, String, :default => "Chef::CookbookVersion" |
- (Array) libraries
The libraries attribute
21 |
# File 'lib/spice/cookbook_version.rb', line 21 attribute :libraries, Array, :default => [] |
- (Hash) metadata
The metadata attribute
20 |
# File 'lib/spice/cookbook_version.rb', line 20 attribute :metadata, Hash, :default => {} |
- (String) name
The name attribute
14 |
# File 'lib/spice/cookbook_version.rb', line 14 attribute :name, String |
- (Array) providers
The providers attribute
19 |
# File 'lib/spice/cookbook_version.rb', line 19 attribute :providers, Array, :default => [] |
- (Array) recipes
The recipes attribute
28 |
# File 'lib/spice/cookbook_version.rb', line 28 attribute :recipes, Array, :default => [] |
- (Array) resources
The resources attribute
23 |
# File 'lib/spice/cookbook_version.rb', line 23 attribute :resources, Array, :default => [] |
- (Array) root_files
The root_files attribute
29 |
# File 'lib/spice/cookbook_version.rb', line 29 attribute :root_files, Array, :default => [] |
- (Array) templates
The templates attribute
22 |
# File 'lib/spice/cookbook_version.rb', line 22 attribute :templates, Array, :default => [] |
- (String) version
The version attribute
15 |
# File 'lib/spice/cookbook_version.rb', line 15 attribute :version, String |
Class Method Details
+ (Object) get(name, version)
46 47 48 |
# File 'lib/spice/cookbook_version.rb', line 46 def self.get(name, version) connection.cookbook_version(name, version) end |
Instance Method Details
- (Object) do_delete
42 43 44 |
# File 'lib/spice/cookbook_version.rb', line 42 def do_delete connection.delete("/cookbooks/#{cookbook_name}/#{version}") end |
- (Object) do_post
34 35 36 |
# File 'lib/spice/cookbook_version.rb', line 34 def do_post connection.put("/cookbooks/#{cookbook_name}/#{version}", attributes) end |
- (Object) do_put
38 39 40 |
# File 'lib/spice/cookbook_version.rb', line 38 def do_put connection.put("/cookbooks/#{cookbook_name}/#{version}", attributes) end |
- (Boolean) new_record?
Check if the cookbook version exists on the Chef server
51 52 53 54 55 56 57 58 |
# File 'lib/spice/cookbook_version.rb', line 51 def new_record? begin connection.get("/cookbooks/#{name}/#{version}") return false rescue Spice::Error::NotFound return true end end |