Class: Juggle::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Juggle::RakeTask
- Defined in:
- lib/juggle/rake_task.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#root ⇒ Object
Returns the value of attribute root.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#targets ⇒ Object
Returns the value of attribute targets.
Instance Method Summary collapse
-
#initialize(*args) {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
- #pour(targets) ⇒ Object
Constructor Details
#initialize(*args) {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/juggle/rake_task.rb', line 13 def initialize(*args) self.name = args.shift || :juggle self.root = Dir.pwd yield self if block_given? if Kernel.const_defined?('CLOBBER') targets.each do |target, path| CLOBBER.add path end end desc 'Compiles Juggle files' unless ::Rake.application.last_comment task name do targets.each do |target, path| Juggle.root = root Juggle.clear_jugs! Juggle.load_jugfile! File.open(path, 'w') do |file| file.write Juggle.jugs[target].compile end end end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/juggle/rake_task.rb', line 7 def name @name end |
#root ⇒ Object
Returns the value of attribute root.
7 8 9 |
# File 'lib/juggle/rake_task.rb', line 7 def root @root end |
#settings ⇒ Object
Returns the value of attribute settings.
7 8 9 |
# File 'lib/juggle/rake_task.rb', line 7 def settings @settings end |
#targets ⇒ Object
Returns the value of attribute targets.
7 8 9 |
# File 'lib/juggle/rake_task.rb', line 7 def targets @targets end |
Instance Method Details
#pour(targets) ⇒ Object
9 10 11 |
# File 'lib/juggle/rake_task.rb', line 9 def pour(targets) self.targets = targets end |