Module: PadrinoTasks
- Defined in:
- lib/padrino-core/cli/rake.rb
Class Method Summary collapse
- .init(init = false) ⇒ Object
- .load?(task, constant_present) ⇒ Boolean
- .tasks ⇒ Object
- .use(task) ⇒ Object
Class Method Details
.init(init = false) ⇒ Object
12 13 14 15 16 |
# File 'lib/padrino-core/cli/rake.rb', line 12 def self.init(init=false) Padrino::Tasks.files.flatten.uniq.each { |rakefile| Rake.application.add_import(rakefile) rescue puts "<= Failed load #{ext}" } load(File.('../rake_tasks.rb', __FILE__)) Rake.application.load_imports end |
.load?(task, constant_present) ⇒ Boolean
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/padrino-core/cli/rake.rb', line 26 def self.load?(task, constant_present) if constant_present && !PadrinoTasks.tasks.include?(task) warn <<-WARNING Loading #{task} tasks automatically. This functionality will be disabled in future versions. Please put PadrinoTasks.use(#{task.inspect}) PadrinoTasks.init and remove require File.expand_path('../config/boot.rb', __FILE__) in you Rakefile instead. WARNING end constant_present || PadrinoTasks.tasks.include?(task) end |
.tasks ⇒ Object
22 23 24 |
# File 'lib/padrino-core/cli/rake.rb', line 22 def self.tasks @tasks ||= [] end |
.use(task) ⇒ Object
18 19 20 |
# File 'lib/padrino-core/cli/rake.rb', line 18 def self.use(task) tasks << task end |