Skip to content

Commit

Permalink
Merge pull request #387 from agrberg/ar/add_standard_rails_rake_task_…
Browse files Browse the repository at this point in the history
…watcher

Add standard Rails rake task watcher
  • Loading branch information
e2 committed Sep 14, 2016
2 parents ce8f1d0 + fd2f61d commit 1cf25c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/guard/rspec/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def rails(options = {})
@rails ||= _build_rails_rules(_view_extensions(options) * "|")
end

def rake
@rake ||= OpenStruct.new.tap do |rake|
rake.rake_files = %r{^(lib/.+)\.rake}
end
end

private

def _view_extensions(options)
Expand Down
3 changes: 3 additions & 0 deletions lib/guard/rspec/templates/Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ guard :rspec, cmd: "bundle exec rspec" do
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end

# Rake tasks
dsl.watch_spec_files_for(dsl.rake.rake_files)
end

0 comments on commit 1cf25c7

Please sign in to comment.