diff options
Diffstat (limited to 'railties')
4 files changed, 21 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index a9b6787894..faca76f150 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -23,8 +23,12 @@ source 'https://rubygems.org' # gem 'capistrano-rails', group: :development <% unless defined?(JRUBY_VERSION) -%> -# Use debugger +# To use a debugger + <% if RUBY_VERSION < '2.0.0' -%> # gem 'debugger', group: [:development, :test] + <% else -%> +# gem 'byebug', group: [:development, :test] + <% end -%> <% end -%> <% if RUBY_PLATFORM.match(/bccwin|cygwin|emx|mingw|mswin|wince/) -%> diff --git a/railties/lib/rails/generators/rails/plugin/templates/Gemfile b/railties/lib/rails/generators/rails/plugin/templates/Gemfile index f0a832f783..5313cb6c0f 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/Gemfile +++ b/railties/lib/rails/generators/rails/plugin/templates/Gemfile @@ -38,6 +38,10 @@ end <% end -%> <% unless defined?(JRUBY_VERSION) -%> -# To use debugger -# gem 'debugger' +# To use a debugger + <% if RUBY_VERSION < '2.0.0' -%> +# gem 'debugger', group: [:development, :test] + <% else -%> +# gem 'byebug', group: [:development, :test] + <% end -%> <% end -%> diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 8e1aeddb2b..68b71e9927 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -305,14 +305,17 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "Gemfile", /gem 'jbuilder'/ end - def test_inclusion_of_debugger + def test_inclusion_of_a_debugger run_generator if defined?(JRUBY_VERSION) assert_file "Gemfile" do |content| + assert_no_match(/byebug/, content) assert_no_match(/debugger/, content) end - else + elsif RUBY_VERSION < '2.0.0' assert_file "Gemfile", /# gem 'debugger'/ + else + assert_file "Gemfile", /# gem 'byebug'/ end end diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 7a2701f813..853af80111 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -64,14 +64,17 @@ class PluginGeneratorTest < Rails::Generators::TestCase assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/ end - def test_inclusion_of_debugger + def test_inclusion_of_a_debugger run_generator [destination_root, '--full'] if defined?(JRUBY_VERSION) assert_file "Gemfile" do |content| + assert_no_match(/byebug/, content) assert_no_match(/debugger/, content) end - else + elsif RUBY_VERSION < '2.0.0' assert_file "Gemfile", /# gem 'debugger'/ + else + assert_file "Gemfile", /# gem 'byebug'/ end end |