Class: Devbin::Commands::Rails

Inherits:
Thor
  • Object
show all
Defined in:
lib/devbin/commands/rails.rb,
lib/devbin/commands/rails/off.rb,
lib/devbin/commands/rails/stop.rb,
lib/devbin/commands/rails/attach.rb,
lib/devbin/commands/rails/server.rb,
lib/devbin/commands/rails/console.rb,
lib/devbin/commands/rails/restart.rb

Defined Under Namespace

Classes: Attach, Console, Off, Restart, Server, Stop

Instance Method Summary collapse

Instance Method Details

#attach(app_name) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/devbin/commands/rails.rb', line 32

def attach(app_name)
  if options[:help]
    invoke :help, ["attach"]
  else
    require_relative "rails/attach"
    Devbin::Commands::Rails::Attach.new(app_name, options).execute
  end
end

#console(app_name) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/devbin/commands/rails.rb', line 44

def console(app_name)
  if options[:help]
    invoke :help, ["console"]
  else
    require_relative "rails/console"
    Devbin::Commands::Rails::Console.new(app_name, options).execute
  end
end

#offObject



84
85
86
87
88
89
90
91
# File 'lib/devbin/commands/rails.rb', line 84

def off(*)
  if options[:help]
    invoke :help, ["off"]
  else
    require_relative "rails/off"
    Devbin::Commands::Rails::Off.new(options).execute
  end
end

#restart(app_name) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/devbin/commands/rails.rb', line 72

def restart(app_name)
  if options[:help]
    invoke :help, ["restart"]
  else
    require_relative "rails/restart"
    Devbin::Commands::Rails::Restart.new(app_name, options).execute
  end
end

#server(app_name) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/devbin/commands/rails.rb', line 20

def server(app_name)
  if options[:help]
    invoke :help, ["server"]
  else
    require_relative "rails/server"
    Devbin::Commands::Rails::Server.new(app_name, options).execute
  end
end

#stop(app_name = "") ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/devbin/commands/rails.rb', line 58

def stop(app_name = "")
  if options[:help]
    invoke :help, ["stop"]
  else
    require_relative "rails/stop"
    Devbin::Commands::Rails::Stop.new(app_name, options).execute
  end
end