Skip to content

Commit

Permalink
Merge pull request #81 from ruby-rdf/setup-guard
Browse files Browse the repository at this point in the history
Setup Guard
  • Loading branch information
Thomas Johnson authored Jan 30, 2017
2 parents 42c7629 + d592cff commit a1065ec
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ source "https://rubygems.org"

gemspec

gem 'pry'
unless ENV['CI']
gem 'pry'
gem 'guard'
end

group :debug do
gem 'psych', :platforms => [:mri, :rbx]
Expand Down
32 changes: 32 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Guardfile
# More info at https://github.com/guard/guard#readme

# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

# Using -W0 to suppress deprecation warnings from Sinatra on Ruby 2.4.x.
guard :rspec, cmd: 'RUBYOPT="-W0" bundle exec rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)

# Feel free to open issues for suggestions and improvements

# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)

# applications
watch(%r{^app/(.+)\.rb$}) { |m| "spec/app/#{m[1]}_spec.rb" }

# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
end

0 comments on commit a1065ec

Please sign in to comment.