Class: Awestruct::Commands::Manifest
- Inherits:
-
Object
- Object
- Awestruct::Commands::Manifest
show all
- Defined in:
- lib/awestruct/commands/manifest.rb
Defined Under Namespace
Classes: CopyFile, InstallCompass, MkDir, TouchFile
Instance Attribute Summary (collapse)
Instance Method Summary
(collapse)
Constructor Details
- (Manifest) initialize(parent = nil, &block)
A new instance of Manifest
40
41
42
43
44
|
# File 'lib/awestruct/commands/manifest.rb', line 40
def initialize(parent=nil,&block)
@parent = parent
@steps = []
instance_eval &block if block
end
|
Instance Attribute Details
- (Object) parent
Returns the value of attribute parent
37
38
39
|
# File 'lib/awestruct/commands/manifest.rb', line 37
def parent
@parent
end
|
- (Object) steps
Returns the value of attribute steps
38
39
40
|
# File 'lib/awestruct/commands/manifest.rb', line 38
def steps
@steps
end
|
Instance Method Details
- (Object) copy_file(path, input_path)
50
51
52
|
# File 'lib/awestruct/commands/manifest.rb', line 50
def copy_file(path, input_path)
steps << CopyFile.new( path, input_path )
end
|
- (Object) install_compass(framework)
58
59
60
|
# File 'lib/awestruct/commands/manifest.rb', line 58
def install_compass(framework)
steps << InstallCompass.new(framework)
end
|
- (Object) mkdir(path)
46
47
48
|
# File 'lib/awestruct/commands/manifest.rb', line 46
def mkdir(path)
steps << MkDir.new( path )
end
|
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/awestruct/commands/manifest.rb', line 62
def perform(dir)
parent.perform(dir) if parent
steps.each do |step|
begin
step.perform( dir )
rescue => e
puts e
puts e.backtrace
end
end
end
|
- (Object) touch_file(path)
54
55
56
|
# File 'lib/awestruct/commands/manifest.rb', line 54
def touch_file(path)
steps << TouchFile.new(path)
end
|
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/awestruct/commands/manifest.rb', line 74
def unperform(dir)
steps.each do |step|
begin
step.unperform( dir )
rescue => e
puts e
puts e.backtrace
end
end
end
|