diff --git a/lib/pry-rails.rb b/lib/pry-rails.rb index 8a1e244..e709355 100644 --- a/lib/pry-rails.rb +++ b/lib/pry-rails.rb @@ -1,27 +1,6 @@ +# encoding: UTF-8 + require 'pry' + require 'pry-rails/version' - -module PryRails - class Railtie < Rails::Railtie - console do - if Rails::VERSION::MAJOR == 3 - Rails::Console::IRB = Pry - - unless defined? Pry::ExtendCommandBundle - Pry::ExtendCommandBundle = Module.new - end - end - - if Rails::VERSION::MAJOR == 4 - Rails.application.config.console = Pry - end - - if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) || - Rails::VERSION::MAJOR == 4 - require "rails/console/app" - require "rails/console/helpers" - TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods - end - end - end -end +require 'pry-rails/railtie' diff --git a/lib/pry-rails/railtie.rb b/lib/pry-rails/railtie.rb new file mode 100644 index 0000000..6a32735 --- /dev/null +++ b/lib/pry-rails/railtie.rb @@ -0,0 +1,26 @@ +# encoding: UTF-8 + +module PryRails + class Railtie < Rails::Railtie + console do + if Rails::VERSION::MAJOR == 3 + Rails::Console::IRB = Pry + + unless defined? Pry::ExtendCommandBundle + Pry::ExtendCommandBundle = Module.new + end + end + + if Rails::VERSION::MAJOR == 4 + Rails.application.config.console = Pry + end + + if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) || + Rails::VERSION::MAJOR == 4 + require "rails/console/app" + require "rails/console/helpers" + TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods + end + end + end +end diff --git a/lib/pry-rails/version.rb b/lib/pry-rails/version.rb index 3c8ce22..ddebfc9 100644 --- a/lib/pry-rails/version.rb +++ b/lib/pry-rails/version.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + module PryRails VERSION = "0.1.6" end