Class: PryRails::Prompt

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-rails/prompt.rb

Class Method Summary collapse

Class Method Details

.formatted_envObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/pry-rails/prompt.rb', line 4

def formatted_env
  if Rails.env.production?
    bold_env = Pry::Helpers::Text.bold(Rails.env)
    Pry::Helpers::Text.red(bold_env)
  elsif Rails.env.development?
    Pry::Helpers::Text.green(Rails.env)
  else
    Rails.env
  end
end

.project_nameObject



15
16
17
18
19
20
21
# File 'lib/pry-rails/prompt.rb', line 15

def project_name
  if Rails::VERSION::MAJOR >= 6
    Rails.application.class.module_parent_name.underscore
  else
    Rails.application.class.parent_name.underscore
  end
end