Class: Vendorificator::Vendor
- Inherits:
-
Object
- Object
- Vendorificator::Vendor
show all
- Defined in:
- lib/vendorificator/vendor.rb
Defined Under Namespace
Classes: Archive, ChefCookbook, Download, Git, Tool
Class Attribute Summary collapse
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(environment, name, args = {}, &block) ⇒ Vendor
Returns a new instance of Vendor.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/vendorificator/vendor.rb', line 26
def initialize(environment, name, args = {}, &block)
@environment = environment
@name = name
@block = block
@metadata = {
:unparsed_args => args.clone
}
@metadata[:parsed_args] = @args = parse_initialize_args(args)
@metadata[:module_annotations] = @args[:annotate] if @args[:annotate]
@segment = Segment::Vendor.new(vendor: self, overlay: config.overlay_instance)
if config.overlay_instance
config.overlay_instance.segments << @segment
else
@environment.segments << @segment
end
end
|
Class Attribute Details
.group ⇒ Object
Returns the value of attribute group.
11
12
13
|
# File 'lib/vendorificator/vendor.rb', line 11
def group
@group
end
|
.method_name ⇒ Object
Returns the value of attribute method_name.
11
12
13
|
# File 'lib/vendorificator/vendor.rb', line 11
def method_name
@method_name
end
|
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
22
23
24
|
# File 'lib/vendorificator/vendor.rb', line 22
def args
@args
end
|
#block ⇒ Object
Returns the value of attribute block.
22
23
24
|
# File 'lib/vendorificator/vendor.rb', line 22
def block
@block
end
|
#environment ⇒ Object
Returns the value of attribute environment.
22
23
24
|
# File 'lib/vendorificator/vendor.rb', line 22
def environment
@environment
end
|
#git=(value) ⇒ Object
23
24
25
|
# File 'lib/vendorificator/vendor.rb', line 23
def git=(value)
@git = value
end
|
#name ⇒ Object
Returns the value of attribute name.
22
23
24
|
# File 'lib/vendorificator/vendor.rb', line 22
def name
@name
end
|
#segment ⇒ Object
Returns the value of attribute segment.
22
23
24
|
# File 'lib/vendorificator/vendor.rb', line 22
def segment
@segment
end
|
Class Method Details
.arg_reader(*names) ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/vendorificator/vendor.rb', line 13
def arg_reader(*names)
names.each do |name|
define_method(name) do
args[name]
end
end
end
|
Instance Method Details
#===(other) ⇒ Object
44
45
46
|
# File 'lib/vendorificator/vendor.rb', line 44
def ===(other)
other === name || File.expand_path(other.to_s) == work_dir
end
|
#after_conjure! ⇒ Object
69
|
# File 'lib/vendorificator/vendor.rb', line 69
def after_conjure! ; end
|
#before_conjure! ⇒ Object
68
|
# File 'lib/vendorificator/vendor.rb', line 68
def before_conjure! ; end
|
#compute_dependencies! ⇒ Object
70
|
# File 'lib/vendorificator/vendor.rb', line 70
def compute_dependencies! ; end
|
#conjure! ⇒ Object
62
63
64
|
# File 'lib/vendorificator/vendor.rb', line 62
def conjure!
block.call(self) if block
end
|
#conjure_commit_message ⇒ Object
82
83
84
|
# File 'lib/vendorificator/vendor.rb', line 82
def conjure_commit_message
"Conjured vendor module #{name} version #{version}"
end
|
67
|
# File 'lib/vendorificator/vendor.rb', line 67
def ; [] ; end
|
#group ⇒ Object
48
49
50
|
# File 'lib/vendorificator/vendor.rb', line 48
def group
defined?(@group) ? @group : self.class.group
end
|
#inspect ⇒ Object
52
53
54
|
# File 'lib/vendorificator/vendor.rb', line 52
def inspect
"#<#{self.class} #{self}>"
end
|
73
74
75
76
77
78
79
80
|
# File 'lib/vendorificator/vendor.rb', line 73
def metadata
default = {
:module_name => @name,
:module_version => version,
:module_group => @group,
}
default.merge @metadata
end
|
#upstream_version ⇒ Object
71
|
# File 'lib/vendorificator/vendor.rb', line 71
def upstream_version ; end
|
#version ⇒ Object
56
57
58
59
60
|
# File 'lib/vendorificator/vendor.rb', line 56
def version
@args[:version] ||
(!config[:use_upstream_version] && segment.merged_version) ||
upstream_version
end
|