Module: Inventory::Dependency

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#majorObject (readonly)

Returns the value of attribute major.



26
27
28
# File 'lib/inventory/dependency.rb', line 26

def major
  @major
end

#minorObject (readonly)

Returns the value of attribute minor.



26
27
28
# File 'lib/inventory/dependency.rb', line 26

def minor
  @minor
end

#nameObject (readonly)

Returns the value of attribute name.



26
27
28
# File 'lib/inventory/dependency.rb', line 26

def name
  @name
end

#patchObject (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

#featureObject



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, options = {})
  @name, @major, @minor, @patch = name, major, minor, patch
  instance_exec(&Proc.new) if block_given?
end

#requireObject



17
18
19
# File 'lib/inventory/dependency.rb', line 17

def require
  nil
end

#to_sObject



9
10
11
# File 'lib/inventory/dependency.rb', line 9

def to_s
  '%d.%d.%d' % [major, minor, patch]
end