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

Pry on padrino console #2056

Closed
carlqt opened this Issue Jul 4, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@carlqt

carlqt commented Jul 4, 2016

Hi,
I'm not sure wether to post this here or on pry but here's my problem.
Currently I'm using this technique to convert the standard IRB console of padrino to pry

begin
  require 'pry'
  $VERBOSE = nil
  IRB = Pry
  $VERBOSE = false
rescue LoadError
end

but with this technique, I'm having trouble with some gems that uses modules/class that's namespaced under IRB module, e.g. (IRB::SLex). Any techniques to bypass this?

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Jul 6, 2016

Member

This is an incredibly odd way to do this, to be honest. All the console does is load boot and a small file with useful utilities.

desc "console", "Boots up the Padrino application irb console (alternatively use 'c')."
map "c" => :console
def console(*args)
prepare :console
require File.expand_path("../../version", __FILE__)
ARGV.clear
require 'irb'
begin
require "irb/completion"
rescue LoadError
end
require File.expand_path('config/boot.rb')
puts "=> Loading #{Padrino.env} console (Padrino v.#{Padrino.version})"
require File.expand_path('../console', __FILE__)
IRB.start
end

I used to just call "pry" and then load boot and https://github.com/padrino/padrino-framework/blob/09d8de672317c9da22c25a01616497852f44f387/padrino-core/lib/padrino-core/cli/console.rb

Also, why not submit a patch that allows booting Pry instead of IRB?

Member

skade commented Jul 6, 2016

This is an incredibly odd way to do this, to be honest. All the console does is load boot and a small file with useful utilities.

desc "console", "Boots up the Padrino application irb console (alternatively use 'c')."
map "c" => :console
def console(*args)
prepare :console
require File.expand_path("../../version", __FILE__)
ARGV.clear
require 'irb'
begin
require "irb/completion"
rescue LoadError
end
require File.expand_path('config/boot.rb')
puts "=> Loading #{Padrino.env} console (Padrino v.#{Padrino.version})"
require File.expand_path('../console', __FILE__)
IRB.start
end

I used to just call "pry" and then load boot and https://github.com/padrino/padrino-framework/blob/09d8de672317c9da22c25a01616497852f44f387/padrino-core/lib/padrino-core/cli/console.rb

Also, why not submit a patch that allows booting Pry instead of IRB?

@ujifgc ujifgc closed this in 2a2600a Jul 11, 2016

ujifgc added a commit that referenced this issue Sep 8, 2016

allow Pry as Padrino console shell, closes #2056 [ci skip]
To use `padrino console` with Pry add `gem "pry"` to your project Gemfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment