Skip to content

Instantly share code, notes, and snippets.

@glasses618
Created June 26, 2020 02:57
Show Gist options
  • Save glasses618/1b170156d0cc65ecfb1cab4b8ef879d2 to your computer and use it in GitHub Desktop.
Save glasses618/1b170156d0cc65ecfb1cab4b8ef879d2 to your computer and use it in GitHub Desktop.
pry prompt after v0.13.0
unless Rails.env.development?
default_prompt = Pry::Prompt[:default]
env = Pry::Helpers::Text.red(Rails.env.upcase)
Pry.config.prompt = Pry::Prompt.new(
'custom',
'my custom prompt',
[
proc{ |*args| "#{env} #{default_prompt.wait_proc.call(*args)}" },
proc{ |*args| "#{env} #{default_prompt.incomplete_proc.call(*args)}" },
],
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment