diff --git a/Gemfile b/Gemfile index 75ac6c8..934bbd4 100644 --- a/Gemfile +++ b/Gemfile @@ -52,7 +52,8 @@ group :development, :test do gem "rspec-rails", "~> 3.4.0" # automatic test runs - gem "guard-rspec", require: false + gem "guard-rspec", require: false + gem "guard-rubocop", require: false # preloading environment gem "spring" diff --git a/Gemfile.lock b/Gemfile.lock index 09824ca..364a39e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,6 +106,9 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) + guard-rubocop (1.2.0) + guard (~> 2.0) + rubocop (~> 0.20) hashdiff (0.2.3) httparty (0.13.7) json (~> 1.8) @@ -286,6 +289,7 @@ DEPENDENCIES fixture_builder (~> 0.4.1) fuubar (= 2.0.0) guard-rspec + guard-rubocop logging-rails (= 0.5.0) nyan-cat-formatter pronto (= 0.5.3) diff --git a/Guardfile b/Guardfile index 80fd76d..ef40b68 100644 --- a/Guardfile +++ b/Guardfile @@ -21,3 +21,8 @@ guard :rspec, cmd: "NO_COVERAGE=true bin/rspec" do watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" } watch(rails.routes) { "#{rspec.spec_dir}/routing" } end + +guard :rubocop do + watch(/.+\.rb$/) + watch(/\.rubocop\.yml$/) {|m| File.dirname(m[0]) } +end