Class: Stove::Cookbook
- Inherits:
-
Object
- Object
- Stove::Cookbook
- Includes:
- Logify
- 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 community site).
-
#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 community site.
-
#tag_version ⇒ String
The tag version.
-
#tarball ⇒ 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.
55 56 57 58 |
# File 'lib/stove/cookbook.rb', line 55 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.
47 48 49 |
# File 'lib/stove/cookbook.rb', line 47 def changeset @changeset end |
#metadata ⇒ Stove::Cookbook::Metadata (readonly)
The metadata for this cookbook.
38 39 40 |
# File 'lib/stove/cookbook.rb', line 38 def @metadata end |
#name ⇒ String (readonly)
The name of the cookbook (must correspond to the name of the cookbook on the community site).
24 25 26 |
# File 'lib/stove/cookbook.rb', line 24 def name @name end |
#path ⇒ Pathname (readonly)
The path to this cookbook on disk.
16 17 18 |
# File 'lib/stove/cookbook.rb', line 16 def path @path end |
#version ⇒ String (readonly)
The version of this cookbook (originally).
31 32 33 |
# File 'lib/stove/cookbook.rb', line 31 def version @version end |
Instance Method Details
#released? ⇒ Boolean
Deterine if this cookbook version is released on the community site
84 85 86 87 88 89 |
# File 'lib/stove/cookbook.rb', line 84 def released? Community.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”.
69 70 71 |
# File 'lib/stove/cookbook.rb', line 69 def tag_version "v#{version}" end |