Class: Spring::Commands::RailsRunner

Inherits:
Command
  • Object
show all
Defined in:
lib/spring/commands.rb

Instance Method Summary collapse

Methods inherited from Command

preloads, #preloads, preloads=, #setup

Instance Method Details

#call(args) ⇒ Object



206
207
208
209
210
# File 'lib/spring/commands.rb', line 206

def call(args)
  Object.const_set(:APP_PATH, Rails.root.join('config/application'))
  ARGV.replace args
  require "rails/commands/runner"
end

#descriptionObject



212
213
214
# File 'lib/spring/commands.rb', line 212

def description
  nil
end

#env(tail) ⇒ Object



194
195
196
197
198
199
200
201
202
203
204
# File 'lib/spring/commands.rb', line 194

def env(tail)
  previous_option = nil
  tail.reverse.each do |option|
    case option
    when /--environment=(\w+)/ then return $1
    when '-e' then return previous_option
    end
    previous_option = option
  end
  nil
end