From 2406435663b12272d901e822b0268f5c4d497f2b Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Fri, 2 Feb 2018 14:15:09 -0300 Subject: [PATCH] Ability to use byebug easily while developing/testing --- .gitignore | 1 + rack-attack.gemspec | 5 +++++ spec/spec_helper.rb | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 8624f93..1bb1e05 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ bin *.gemfile.lock .ruby-version .ruby-gemset +.byebug_history diff --git a/rack-attack.gemspec b/rack-attack.gemspec index f446cd6..07f2931 100644 --- a/rack-attack.gemspec +++ b/rack-attack.gemspec @@ -41,4 +41,9 @@ Gem::Specification.new do |s| # # See https://github.com/guard/guard-minitest/pull/131 s.add_development_dependency 'guard' + + # byebug only works with MRI + if RUBY_ENGINE == "ruby" + s.add_development_dependency 'byebug' + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0378797..7cfc1b5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,10 @@ rescue LoadError #nothing to do here end +if RUBY_ENGINE == "ruby" + require "byebug" +end + class MiniTest::Spec include Rack::Test::Methods