Sha256: c1e44cf998ca528e09c632a187727885ef1e61db5a176cae15961657f00db177
Contents?: true
Size: 845 Bytes
Versions: 4
Compression:
Stored size: 845 Bytes
Contents
require_relative "application_generator" desc 'Run a command against the local sample application' task :local do app_folder = ActiveAdmin::ApplicationGenerator.new( rails_env: 'development', template: 'rails_template_with_data' ).generate # Discard the "local" argument (name of the task) argv = ARGV[1..-1] # If it's a rails command, or we're using Rails 5, auto add the rails script rails_commands = %w(generate console server db dbconsole g c s runner) if Rails::VERSION::MAJOR >= 5 || rails_commands.include?(argv[0]) argv.unshift('rails') end command = ['bundle', 'exec', *argv].join(' ') gemfile = ENV['BUNDLE_GEMFILE'] || File.expand_path("../Gemfile", __dir__) env = { 'BUNDLE_GEMFILE' => gemfile } Dir.chdir(app_folder) do Bundler.with_original_env { Kernel.exec(env, command) } end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
activeadmin-1.4.3 | tasks/local.rake |
activeadmin-1.4.2 | tasks/local.rake |
activeadmin-1.4.1 | tasks/local.rake |
activeadmin-1.4.0 | tasks/local.rake |