Module: PadrinoTasks

Defined in:
lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb

Class Method Summary collapse

Class Method Details

.init(init = false) ⇒ Object



9
10
11
12
13
14
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb', line 9

def self.init(init=false)
  $LOAD_PATH.unshift(File.expand_path("lib")) # Adds "lib" to the load path
  Padrino::Tasks.files.flatten.uniq.each { |rakefile| Rake.application.add_import(rakefile) rescue puts "<= Failed load #{ext}" }
  load(File.expand_path('../rake_tasks.rb', __FILE__)) # Load default rake tasks
  Rake.application.load_imports
end

.load?(task, constant_present) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb', line 24

def self.load?(task, constant_present)
  if constant_present && !PadrinoTasks.tasks.include?(task)
    warn <<-WARNING.undent
      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

.tasksObject



20
21
22
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb', line 20

def self.tasks
  @tasks ||= []
end

.use(task) ⇒ Object



16
17
18
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb', line 16

def self.use(task)
  tasks << task
end