Sha256: 30e59841189b68551ae1b068426fea3e96ac552458a09f64526fd8d0fae0a45a

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path('../../tasks', __FILE__)
require 'rake'
require 'rake/dsl_definition'
require 'thor'
require 'securerandom' unless defined?(SecureRandom)
require 'padrino-gen'

module PadrinoTasks
  def self.init(init=false)
    $LOAD_PATH.unshift(File.expand_path("lib"))
    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__))
    Rake.application.load_imports
  end

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

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

  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
end

def shell
  @_shell ||= Thor::Base.shell.new
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
padrino-core-0.12.0 lib/padrino-core/cli/rake.rb
middleman-core-3.2.2 lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/rake.rb
padrino-core-0.12.0.rc3 lib/padrino-core/cli/rake.rb
padrino-core-0.12.0.rc2 lib/padrino-core/cli/rake.rb
padrino-core-0.12.0.rc1 lib/padrino-core/cli/rake.rb
middleman-core-3.2.1 lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/rake.rb
padrino-core-0.11.4 lib/padrino-core/cli/rake.rb