Module: Inventory::Dependency
- Included in:
- Inventory::Dependencies::Development, Inventory::Dependencies::Optional, Inventory::Dependencies::Runtime
- Defined in:
- lib/inventory/dependency.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
readonly
Returns the value of attribute major.
-
#minor ⇒ Object
readonly
Returns the value of attribute minor.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
Instance Method Summary collapse
- #add_to_gem_specification(specification) ⇒ Object
- #feature ⇒ Object
- #initialize(name, major, minor, patch, options = {}) ⇒ Object
- #require ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#major ⇒ Object (readonly)
Returns the value of attribute major.
26 27 28 |
# File 'lib/inventory/dependency.rb', line 26 def major @major end |
#minor ⇒ Object (readonly)
Returns the value of attribute minor.
26 27 28 |
# File 'lib/inventory/dependency.rb', line 26 def minor @minor end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
26 27 28 |
# File 'lib/inventory/dependency.rb', line 26 def name @name end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
26 27 28 |
# File 'lib/inventory/dependency.rb', line 26 def patch @patch end |
Instance Method Details
#add_to_gem_specification(specification) ⇒ Object
21 22 23 24 |
# File 'lib/inventory/dependency.rb', line 21 def add_to_gem_specification(specification) specification.add_runtime_dependency name, gem_requirement self end |
#feature ⇒ Object
13 14 15 |
# File 'lib/inventory/dependency.rb', line 13 def feature '%s-%d.0' % [name, major] end |
#initialize(name, major, minor, patch, options = {}) ⇒ Object
4 5 6 7 |
# File 'lib/inventory/dependency.rb', line 4 def initialize(name, major, minor, patch, = {}) @name, @major, @minor, @patch = name, major, minor, patch instance_exec(&Proc.new) if block_given? end |
#require ⇒ Object
17 18 19 |
# File 'lib/inventory/dependency.rb', line 17 def require nil end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/inventory/dependency.rb', line 9 def to_s '%d.%d.%d' % [major, minor, patch] end |