Class: Stove::Cookbook
- Inherits:
-
Object
- Object
- Stove::Cookbook
- Defined in:
- lib/stove/cookbook.rb,
lib/stove/cookbook/metadata.rb
Defined Under Namespace
Classes: Metadata
Instance Attribute Summary collapse
-
#changeset ⇒ String?
The changeset for this cookbook.
-
#metadata ⇒ Stove::Cookbook::Metadata
readonly
The metadata for this cookbook.
-
#name ⇒ String
readonly
The name of the cookbook (must correspond to the name of the cookbook on the Supermarket).
-
#path ⇒ Pathname
readonly
The path to this cookbook on disk.
-
#version ⇒ String
readonly
The version of this cookbook (originally).
Instance Method Summary collapse
-
#initialize(path) ⇒ Cookbook
constructor
Create a new wrapper around the cookbook object.
-
#released? ⇒ Boolean
Deterine if this cookbook version is released on the Supermarket.
-
#tag_version ⇒ String
The tag version.
-
#tarball(extended_metadata = false) ⇒ File
So there’s this really really crazy bug that the tmp directory could be deleted mid-request…
Constructor Details
#initialize(path) ⇒ Cookbook
Create a new wrapper around the cookbook object.
53 54 55 56 |
# File 'lib/stove/cookbook.rb', line 53 def initialize(path) @path = File.(path) end |
Instance Attribute Details
#changeset ⇒ String?
The changeset for this cookbook. This is written by the changelog generator and read by various plugins.
45 46 47 |
# File 'lib/stove/cookbook.rb', line 45 def changeset @changeset end |
#metadata ⇒ Stove::Cookbook::Metadata (readonly)
The metadata for this cookbook.
36 37 38 |
# File 'lib/stove/cookbook.rb', line 36 def @metadata end |
#name ⇒ String (readonly)
The name of the cookbook (must correspond to the name of the cookbook on the Supermarket).
22 23 24 |
# File 'lib/stove/cookbook.rb', line 22 def name @name end |
#path ⇒ Pathname (readonly)
The path to this cookbook on disk.
14 15 16 |
# File 'lib/stove/cookbook.rb', line 14 def path @path end |
#version ⇒ String (readonly)
The version of this cookbook (originally).
29 30 31 |
# File 'lib/stove/cookbook.rb', line 29 def version @version end |
Instance Method Details
#released? ⇒ Boolean
Deterine if this cookbook version is released on the Supermarket
82 83 84 85 86 87 |
# File 'lib/stove/cookbook.rb', line 82 def released? Supermarket.cookbook(name, version) true rescue ChefAPI::Error::HTTPNotFound false end |
#tag_version ⇒ String
The tag version. This is just the current version prefixed with the letter “v”.
67 68 69 |
# File 'lib/stove/cookbook.rb', line 67 def tag_version "v#{version}" end |