Methods
- C
- E
- N
- S
- U
Constants
| LOGO | = | %w[⠀⢀⠀⢡⣶⣿⠟⡛⠢ ⠠⠀⣰⣿⣿⠁⠄⠀⠀ ⠶⢠⣿⣿⣿⠰⠆⠀⠀ ⠶⢸⣿⣿⣿⡄⠰⠆⠀].freeze |
| TIPS | = | [ '"app" opens an ActionDispatch::Integration::Session for the app', '"helper" gives access to ApplicationController\'s helper methods', '"controller" gives you a new ApplicationController instance', '"reload!" reloads the application', '"--sandbox" rolls back database changes when the console exits', '"_" holds the value of the last evaluated expression', '"source_location" shows where a method was defined, e.g. method(:reload!).source_location', ].freeze |
Class Public methods
new(app, options = {}) Link
Instance Public methods
colorize_tip(tip) Link
colorized_env() Link
colorized_short_env() Link
env_color() Link
name() Link
short_env() Link
short_rails_root() Link
show_tips?() Link
start() Link
# File railties/lib/rails/commands/console/irb_console.rb, line 96 def start IRB.setup(nil) # CLI --no-banner wins over IRB defaults / .irbrc. IRB.conf[:SHOW_BANNER] = false if @options[:banner] == false if !Rails.env.local? && !ENV.key?("IRB_USE_AUTOCOMPLETE") IRB.conf[:USE_AUTOCOMPLETE] = false end env = colorized_short_env prompt_prefix = "%N(#{env})" # Respect user's configured irb name. IRB.conf[:IRB_NAME] = @app.name if IRB.conf[:IRB_NAME] == "irb" IRB.conf[:PROMPT][:RAILS_PROMPT] = { PROMPT_I: "#{prompt_prefix}:%03n> ", PROMPT_S: "#{prompt_prefix}:%03n%l ", PROMPT_C: "#{prompt_prefix}:%03n* ", RETURN: "=> %s\n" } if current_filter = IRB.conf[:BACKTRACE_FILTER] IRB.conf[:BACKTRACE_FILTER] = -> (backtrace) do backtrace = current_filter.call(backtrace) Rails.backtrace_cleaner.filter(backtrace) end else IRB.conf[:BACKTRACE_FILTER] = -> (backtrace) do Rails.backtrace_cleaner.filter(backtrace) end end # Respect user's choice of prompt mode. IRB.conf[:PROMPT_MODE] = :RAILS_PROMPT if IRB.conf[:PROMPT_MODE] == :DEFAULT show_startup_banner IRB::Irb.new.run(IRB.conf) end