Sha256: 850ebb77447e31834869e4ed4393f9dda317d25055270fc9d3eec17b1169b42d

Contents?: true

Size: 931 Bytes

Versions: 11

Compression:

Stored size: 931 Bytes

Contents

require 'rake'
require 'active_support'

module Rails
  module RakeProxy #:nodoc:
    private
      def run_rake_task(command)
        ARGV.unshift(command) # Prepend the command, so Rake knows how to run it.

        Rake.application.standard_exception_handling do
          Rake.application.init('rails')
          Rake.application.load_rakefile
          Rake.application.top_level
        end
      end

      def rake_tasks
        return @rake_tasks if defined?(@rake_tasks)

        ActiveSupport::Deprecation.silence do
          require_application_and_environment!
        end

        Rake::TaskManager.record_task_metadata = true
        Rake.application.instance_variable_set(:@name, 'rails')
        Rails.application.load_tasks
        @rake_tasks = Rake.application.tasks.select(&:comment)
      end

      def formatted_rake_tasks
        rake_tasks.map { |t| [ t.name_with_args, t.comment ] }
      end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/railties-5.0.0/lib/rails/commands/rake_proxy.rb
railties-5.0.0.1 lib/rails/commands/rake_proxy.rb
railties-5.0.0 lib/rails/commands/rake_proxy.rb
railties-5.0.0.rc2 lib/rails/commands/rake_proxy.rb
railties-5.0.0.racecar1 lib/rails/commands/rake_proxy.rb
railties-5.0.0.rc1 lib/rails/commands/rake_proxy.rb
railties-5.0.0.beta4 lib/rails/commands/rake_proxy.rb
railties-5.0.0.beta3 lib/rails/commands/rake_proxy.rb
railties-5.0.0.beta2 lib/rails/commands/rake_proxy.rb
railties-5.0.0.beta1.1 lib/rails/commands/rake_proxy.rb
railties-5.0.0.beta1 lib/rails/commands/rake_proxy.rb