Class: Barista::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Barista::RakeTask
- Includes:
- Rake::DSL
- Defined in:
- lib/barista/rake_task.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
writeonly
Sets the attribute environment.
-
#input_directory ⇒ Object
writeonly
Sets the attribute input_directory.
-
#namespace ⇒ Object
writeonly
Sets the attribute namespace.
-
#output_directory ⇒ Object
writeonly
Sets the attribute output_directory.
-
#rails ⇒ Object
writeonly
Sets the attribute rails.
-
#task_name ⇒ Object
writeonly
Sets the attribute task_name.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
- #method_missing(method, *args, &blk) ⇒ Object
-
#respond_to?(method, include_private = false) ⇒ Boolean
Proxy methods for rake tasks.
Constructor Details
#initialize {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/barista/rake_task.rb', line 11 def initialize yield self if block_given? @namespace ||= :barista @task_name ||= :brew @task_name = @task_name.to_sym @rails = defined?(Rails) if @rails.nil? task_declaration = (@rails ? {@task_name => :environment} : @task_name) namespace @namespace do desc "Compiles all CoffeeScript sources to JavaScript" task task_declaration do check_availability puts "Compiling all CoffeeScripts to their JavaScript equivalent." Barista.compile_all! true, false end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#environment=(value) ⇒ Object (writeonly)
Sets the attribute environment
9 10 11 |
# File 'lib/barista/rake_task.rb', line 9 def environment=(value) @environment = value end |
#input_directory=(value) ⇒ Object (writeonly)
Sets the attribute input_directory
9 10 11 |
# File 'lib/barista/rake_task.rb', line 9 def input_directory=(value) @input_directory = value end |
#namespace=(value) ⇒ Object (writeonly)
Sets the attribute namespace
8 9 10 |
# File 'lib/barista/rake_task.rb', line 8 def namespace=(value) @namespace = value end |
#output_directory=(value) ⇒ Object (writeonly)
Sets the attribute output_directory
9 10 11 |
# File 'lib/barista/rake_task.rb', line 9 def output_directory=(value) @output_directory = value end |
#rails=(value) ⇒ Object (writeonly)
Sets the attribute rails
9 10 11 |
# File 'lib/barista/rake_task.rb', line 9 def rails=(value) @rails = value end |
#task_name=(value) ⇒ Object (writeonly)
Sets the attribute task_name
8 9 10 |
# File 'lib/barista/rake_task.rb', line 8 def task_name=(value) @task_name = value end |
Instance Method Details
#respond_to?(method, include_private = false) ⇒ Boolean
Proxy methods for rake tasks
33 34 35 |
# File 'lib/barista/rake_task.rb', line 33 def respond_to?(method, include_private = false) super || Barista.respond_to?(method, include_private) end |