Module: RequirejsOptimizer::Rake::Utils

Included in:
Rake::Task
Defined in:
lib/requirejs_optimizer/rake/utils.rb

Instance Method Summary collapse

Instance Method Details

#define_task_deeply(name, taskdesc = "", work_to_do = nil, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/requirejs_optimizer/rake/utils.rb', line 7

def define_task_deeply(name, taskdesc="", work_to_do=nil, &block)
  current, *rest = *name.split(":")

  if rest.any?
    namespace(current) { define_task_deeply rest.join(":"), taskdesc, work_to_do || block }
  else
    desc taskdesc
    task current, &(work_to_do || block)
  end
end

#invoke_or_reboot_rake_task(task) ⇒ Object

Not sure if we actually need this or not.



20
21
22
23
24
25
26
# File 'lib/requirejs_optimizer/rake/utils.rb', line 20

def invoke_or_reboot_rake_task(task)
  if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty?
    ruby_rake_task task
  else
    ::Rake::Task[task].invoke
  end
end