Class: Consolle::RailsCommands
- Inherits:
-
Thor
- Object
- Thor
- Consolle::RailsCommands
- Defined in:
- lib/consolle/cli.rb
Overview
Rails convenience commands subcommand
Instance Method Summary collapse
Instance Method Details
#db ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/consolle/cli.rb', line 34 def db code = <<~RUBY config = ActiveRecord::Base.connection_db_config puts "Adapter: \#{config.adapter}" puts "Database: \#{config.database}" puts "Host: \#{config.host || 'localhost'}" if config.respond_to?(:host) puts "Pool: \#{config.pool}" if config.respond_to?(:pool) puts "Connected: \#{ActiveRecord::Base.connected?}" nil RUBY execute_rails_code(code) end |
#env ⇒ Object
29 30 31 |
# File 'lib/consolle/cli.rb', line 29 def env execute_rails_code('Rails.env') end |
#reload ⇒ Object
24 25 26 |
# File 'lib/consolle/cli.rb', line 24 def reload execute_rails_code('reload!') end |