Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Rails prompt on v0.12+ #105

Merged
merged 1 commit into from
Nov 6, 2018
Merged

add support for Rails prompt on v0.12+ #105

merged 1 commit into from
Nov 6, 2018

Conversation

0x1eef
Copy link
Contributor

@0x1eef 0x1eef commented Nov 5, 2018

I would have wished this could have been as simple as:
Pry::Prompt.add 'rails', 'description', PROMPTS

but because of how the public prompt API was implemented, it has
to be like this.

@0x1eef
Copy link
Contributor Author

0x1eef commented Nov 5, 2018

@kyrylo @rf-

lib/pry-rails/prompt.rb Outdated Show resolved Hide resolved
@0x1eef 0x1eef mentioned this pull request Nov 5, 2018
@rf- rf- merged commit a20b297 into pry:master Nov 6, 2018
@rf-
Copy link
Member

rf- commented Nov 6, 2018

OK, I just released 0.3.7 with this PR plus some other small fixes.

@0x1eef 0x1eef deleted the v0.12-prompt_support branch November 6, 2018 23:42
@falak
Copy link

falak commented Nov 22, 2018

Just do
bundle update pry-rails
will remove the warning.

@pdobb
Copy link

pdobb commented Nov 29, 2018

The documentation seems to need an update related to this change. It says that, to get the rails prompt do:

if defined?(PryRails::RAILS_PROMPT)
  Pry.config.prompt = PryRails::RAILS_PROMPT
end

But this gem no longer defines PryRails::RAILS_PROMPT. I'm trying to sort out what is the right way to enable the prompt now. Will update if I figure it out, but any help is appreciated.

UPDATE

By reading https://github.com/pry/pry/pull/1849/files I've been able to determine that this should be a suitable replacement for the above in the .pryrc file:

if Pry::Prompt.all.key?("rails")
  Pry.prompt = Pry::Prompt["rails"][:value]
end

It's also nice to know that, within a Pry session, one has access to:

change-prompt --list
change-prompt simple
change-prompt default
change-prompt rails
# etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants