Skip to content

Commit

Permalink
Merge pull request nebulab#3 from vassalloandrea/vassalloandrea/suppo…
Browse files Browse the repository at this point in the history
…rt-rails-6

Add the ability to support Rails 6
  • Loading branch information
mtylty authored Jun 9, 2021
2 parents 2dd4a8f + 5e17342 commit 438136d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/dev_tools/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ class Railtie < Rails::Railtie
initializer 'dev_tools.initialize' do |app|
Pry.config.should_load_rc = false

Pry.config.prompt_name = "\001\e[1;32m\002#{Rails.application.class.parent_name.downcase}\001\e[0m\002/\001\e[1;31m\002#{Rails.env.downcase}"
parent_name = if Rails::VERSION::MAJOR >= 6
Rails.application.class.module_parent_name
else
Rails.application.class.parent_name
end

Pry.config.prompt_name = "\001\e[1;32m\002#{parent_name.downcase}\001\e[0m\002/\001\e[1;31m\002#{Rails.env.downcase}"

Pry.prompt = [
proc { |target_self, nest_level, pry|
Expand Down

0 comments on commit 438136d

Please sign in to comment.