Sha256: 0bc2a46563ec461f38e001752eb6951959c35348681708b149bce4d54dfe24ea

Contents?: true

Size: 932 Bytes

Versions: 8

Compression:

Stored size: 932 Bytes

Contents

desc 'console [TARGET]', 'Open a Rails console locally or on a Capistrano deploy target'
long_desc <<-LONGDESC
Local (development): `geordi console`

Remote: `geordi console staging`

Selecting the server: `geordi console staging -s` shows a menu with all available
servers. When passed a number, directly connects to the selected server.
LONGDESC

# This option is duplicated in shelll.rb
option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
  desc: 'Select a server to connect to'

def console(target = 'development', *_args)
  require 'geordi/remote'
  invoke_geordi 'bundle_install'

  if target == 'development'
    invoke_geordi 'yarn_install'

    Interaction.announce 'Opening a local Rails console'

    command = Util.console_command(target)
    Util.run!(command)
  else
    Interaction.announce 'Opening a Rails console on ' + target

    Geordi::Remote.new(target).console(options)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geordi-5.2.2 lib/geordi/commands/console.rb
geordi-5.2.1 lib/geordi/commands/console.rb
geordi-5.2.0 lib/geordi/commands/console.rb
geordi-5.1.0 lib/geordi/commands/console.rb
geordi-5.0.0 lib/geordi/commands/console.rb
geordi-4.2.1 lib/geordi/commands/console.rb
geordi-4.2.0 lib/geordi/commands/console.rb
geordi-4.1.1 lib/geordi/commands/console.rb