Class: Chef::Taste::Dependency
- Inherits:
-
Object
- Object
- Chef::Taste::Dependency
- Defined in:
- lib/chef/taste/dependency.rb
Overview
The class that contains information about a dependent cookbook
Instance Attribute Summary collapse
-
#changelog ⇒ Object
The changelog link for the dependency if available.
-
#latest ⇒ Object
The latest version available for the dependency.
-
#name ⇒ Object
readonly
The name of the dependency.
-
#requirement ⇒ Object
readonly
The requirement for the dependency.
-
#source_url ⇒ Object
The source URL for a cookbook.
-
#status ⇒ Object
The status of the dependency.
-
#version_used ⇒ Object
The version of cookbook used after applying the version constraint.
Instance Method Summary collapse
-
#initialize(name, requirement) ⇒ Dependency
constructor
Constructor.
-
#to_hash ⇒ Hash
Converts the dependency option to a hash.
Constructor Details
#initialize(name, requirement) ⇒ Dependency
Constructor
61 62 63 64 65 66 67 68 69 |
# File 'lib/chef/taste/dependency.rb', line 61 def initialize(name, requirement) @name = name @requirement = requirement @version_used = nil @latest = nil @status = nil @source_url = nil @changelog = nil end |
Instance Attribute Details
#changelog ⇒ Object
The changelog link for the dependency if available
52 53 54 |
# File 'lib/chef/taste/dependency.rb', line 52 def changelog @changelog end |
#latest ⇒ Object
The latest version available for the dependency
43 44 45 |
# File 'lib/chef/taste/dependency.rb', line 43 def latest @latest end |
#name ⇒ Object (readonly)
The name of the dependency
34 35 36 |
# File 'lib/chef/taste/dependency.rb', line 34 def name @name end |
#requirement ⇒ Object (readonly)
The requirement for the dependency
37 38 39 |
# File 'lib/chef/taste/dependency.rb', line 37 def requirement @requirement end |
#source_url ⇒ Object
The source URL for a cookbook
49 50 51 |
# File 'lib/chef/taste/dependency.rb', line 49 def source_url @source_url end |
#status ⇒ Object
The status of the dependency
46 47 48 |
# File 'lib/chef/taste/dependency.rb', line 46 def status @status end |
#version_used ⇒ Object
The version of cookbook used after applying the version constraint
40 41 42 |
# File 'lib/chef/taste/dependency.rb', line 40 def version_used @version_used end |
Instance Method Details
#to_hash ⇒ Hash
Converts the dependency option to a hash
75 76 77 78 79 80 81 82 83 |
# File 'lib/chef/taste/dependency.rb', line 75 def to_hash {}.tap do |hash| hash[:requirement] = requirement hash[:used] = version_used hash[:latest] = latest hash[:status] = status hash[:changelog] = changelog end end |