Class: Candle::Generators::Jam
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Candle::Generators::Jam
show all
- Defined in:
- lib/candle/generators/jam.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.stable ⇒ Object
The methods below define the JAM DSL.
64
65
66
|
# File 'lib/candle/generators/jam.rb', line 64
def stable
@stable
end
|
.unstable ⇒ Object
The methods below define the JAM DSL.
64
65
66
|
# File 'lib/candle/generators/jam.rb', line 64
def unstable
@unstable
end
|
Class Method Details
.attr_rw(*attrs) ⇒ Object
66
67
68
69
70
71
72
73
74
|
# File 'lib/candle/generators/jam.rb', line 66
def self.attr_rw(*attrs)
attrs.each do |attr|
class_eval %Q{
def #{attr}(val=nil)
val.nil? ? @#{attr} : @#{attr} = val
end
}
end
end
|
.banner ⇒ Object
18
|
# File 'lib/candle/generators/jam.rb', line 18
def self.banner; "candle #{self.to_s.downcase.intern} [name]"; end
|
.init_generator ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/candle/generators/jam.rb', line 15
def self.init_generator
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
def self.banner; "candle #{self.to_s.downcase.intern} [name]"; end
include Thor::Actions
include Candle::Generators::Actions
end
|
.parseTemplate(data) ⇒ Object
25
26
27
|
# File 'lib/candle/generators/jam.rb', line 25
def self.parseTemplate(data)
eval(data)
end
|
.source_root ⇒ Object
Define the source template root
17
|
# File 'lib/candle/generators/jam.rb', line 17
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
Instance Method Details
#create_jam ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/candle/generators/jam.rb', line 41
def create_jam
valid_constant?(options["#{self.to_s.downcase.intern}"] || name)
@jam_name = (options["#{self.to_s.downcase.intern}"] || name).gsub(/\W/, "_").downcase
@developer = "#{`whoami`.strip}"
@created_on = Date.today.to_s
self.destination_root = options[:root]
project = options["#{self.to_s.downcase.intern}"]
self.behavior = :revoke if options[:destroy]
end
|
#in_app_root? ⇒ Boolean
36
37
38
39
|
# File 'lib/candle/generators/jam.rb', line 36
def in_app_root?
Dir.glob("*.xcodeproj").count >= 1
end
|