-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Make Pry(a feature rich console) default rails console #6549
Conversation
I don't think there really is a problem about "if pry is not installed". |
@dmathieu I'm kinda agree with @wycats https://twitter.com/wycats/status/207673557021491200 we do not even need to add it to gem file. Pry is a 'standalone' gem and rails should not depend on it. |
The easiest thing would be for pry to add a Railtie that added the console directive. Then, a simple |
@wycats genious :) I'm going to ask them for this feature! pry/pry#582 |
You can already do something like this with pry-rails. |
@wycats it's not about the subject though. :) Currently adding |
@dmathieu yes, it's not a big deal. pry-rails works fine and adding railtie directly to pry would be cool too, as wycats proposed. But what I want in this PR is pry as default |
@drogus fine, accepted. what about to make pry default P.S. why to make it default? |
👍 But, I do not see any trouble adding |
@homakov: if you add pry-rails to the Gemfile, it'll make it a default. |
@dmathieu haha yes. but I want it to be in generated template to be real default @goshakkk Where are troubles? Everything is fine! Just want to tell about pry all the people :) |
Agree with @wycats, anyway I'd add commented out to the Gemfile gem 'pry' or gem 'pry-rails' if they don't add the railtie. |
@spastorino I like pry-rails is dirty https://github.com/rweng/pry-rails/blob/master/lib/pry-rails.rb#L10 |
We'll add the config.console thing to pry-rails sometime between now and the release of Rails 4. The old code will still have to be there for older versions of Rails though. |
@rwfitzge I just wanted to PR you using config.console :) Glad to hear that. One more time: my proposal was to make pry default rails console. Out of box rails c would run pry. Yes, I can use either config.console and pry-rails gem, but there are other developers who don't use it. I want to notify them how awesome pry is. Probably it's too soon to discuss it. Just think about it and I hope someday we will get rails w/ default pry. Thanks |
@rwfitzge could you not just keep the 0.x.x for rails 3 and release 1.x.x with rails 4 compatibility ? |
@homakov No troubles. I just meant I think having |
@goshakkk it's wycats' thought. It's OK: we should keep Gemfile template as short and concise as possible.. |
@homakov Look, I have If you just propose to |
of course no
I dont have statistics. Probably big part. I wanted to make the rest to use pry too! :) |
I disagree with the addition of pry as the default console. I strongly prefer irb and I don't like the idea to not use the default interactive ruby in the Rails. I'm ok with a commented entry in the Gemfile |
👍 Agree with commented entry in the Gemfile |
@spastorino |
@rafaelfranca old school ? :) why to use irb when pry is available. anyway seems most of you are OK to have it in generated Gemfile.. @drogus example - I use pry on my local machine but sometimes I need to fire up console on the production server. I'm unable to install pry there(right away) so I'd like to downgrade to irb |
Agree. I like pry but not everybody does, a commented line in Gemfile would be ok. Gosha Arinich On Wednesday, May 30, 2012 at 7:57 PM, Rafael Mendonça França wrote:
|
@homakov hahah. Yes old school ;). Actually I don't use much the console, so I'm 👎 to add another dependency to a thing that I don't often use. |
Commented out doesn't hurt anybody ;) |
I'm fine with the Gemfile entry. Commented or not ;) |
by adding 'pry-rails' we avoid using special tools: dd655d8 and 951b582 it's PR for rails 4 so we definitely have config.console working. http://en.wikipedia.org/wiki/Occam%27s_razor |
@ arunagw how do i do the 'thumbs up' icon? it's pretty impressive and i'd like to use it |
@banister they are called Emoji emoticons. you can look at this cheat sheet for details: http://www.emoji-cheat-sheet.com/ |
someday! |
I'm still 👎 on it - pry is yet another dependency and since we can set the console easily now, using pry is a matter of adding |
@drogus this point is reasonable, but look at the coffeescript case: It was convenient, useful, not so popular while it also was a 'yet another dependency'. Now when years passed everybody is happy to have it by default In Gemfile. Same here |
@homakov yup, that's true, but there is no coffeescript equivalent in stdlib. Anyway, it doesn't matter to me so much as it will be just another entry in Gemfile - I can just remove it - so if others are ok with this, I won't argue. |
Actually with our last discussion about what we put in the default stack of Rails I prefer to not add it wither as a commented entry in the Gemfile. There is a lot of great alternatives in the Ruby world. rspec as an alternative to test_unit/minitest. less as an alternative to sass. datamapper as a alternative to activerecord. If we put all the alternatives in the Gemfile so, one day we will generate a Gemfile with many commented lines. 👎 for this one |
I love Pry, but yeah, we should be keeping stuff out of core rails as much as possible. 👎 |
As part of the |
If you use pry, you use it in all of yours projects.
And you’ll have access to application models and console helpers.
No extra gems in Gemfile. You still can use |
@lexmag main point of this PR - make pry more popular. I can use pry in different ways. But I also want other users to use it. |
Maybe we can pass a |
I really don't think that this is a good idea. We don't add a |
@rafaelfranca no problem. that day wasn't "someday" :) |
Issue is closed now, but anyway, disagree with the addition of Pry. Besides, vanilla IRB + the Rails stack doesn't load very fast already, imagine it with Pry. |
@rodrigoalvesvieira it's not in Gemfile since not every one uses console. but if u run console you will get an exception if it's not installed. |
Pry allows developer to go deep inside of ruby and rails class infrastructure - https://github.com/pry/pry
The console becomes very powerful,
cd
andls
make class/method navigation extremely comfortable.Bonuses: highlighting, nice inspects, shell shortcuts and other - check the manual.
Huge thanks to @drogus for dd655d8 and 951b582
To discuss:
How to handle if user has no pry installed? Probably just downgrade to IRB and show a message "Pry is not found, using IRB"?
What about moving requirement process inside of rails? I mean
config.console = :pry
looks more neat.