Class: Spring::Commands::RailsConsole

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

Instance Method Summary collapse

Methods inherited from Rails

#call, #description

Instance Method Details

#command_nameObject


31
32
33
# File 'lib/spring/commands/rails.rb', line 31

def command_name
  "console"
end

#env(args) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/spring/commands/rails.rb', line 15

def env(args)
  return args.first if args.first && !args.first.index("-")

  environment = nil

  args.each.with_index do |arg, i|
    if arg =~ /--environment=(\w+)/
      environment = $1
    elsif i > 0 && args[i - 1] == "-e"
      environment = arg
    end
  end

  environment
end