mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 15:43:14 +01:00
Add guard file watcher
This commit is contained in:
parent
2d85da354b
commit
a13e848176
3 changed files with 107 additions and 0 deletions
2
Gemfile
2
Gemfile
|
@ -42,6 +42,8 @@ group :development do
|
||||||
gem 'spring-commands-rspec'
|
gem 'spring-commands-rspec'
|
||||||
gem 'quiet_assets'
|
gem 'quiet_assets'
|
||||||
gem 'awesome_print'
|
gem 'awesome_print'
|
||||||
|
gem 'guard-rspec', require: false
|
||||||
|
gem 'terminal-notifier-guard' # FIXME cross-platform
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
|
|
35
Gemfile.lock
35
Gemfile.lock
|
@ -80,11 +80,27 @@ GEM
|
||||||
i18n (~> 0.5)
|
i18n (~> 0.5)
|
||||||
faraday (0.9.1)
|
faraday (0.9.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
|
ffi (1.9.10)
|
||||||
|
formatador (0.2.5)
|
||||||
foundation-rails (5.5.1.2)
|
foundation-rails (5.5.1.2)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
sass (>= 3.3.0, < 3.5)
|
sass (>= 3.3.0, < 3.5)
|
||||||
globalid (0.3.5)
|
globalid (0.3.5)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
|
guard (2.13.0)
|
||||||
|
formatador (>= 0.2.4)
|
||||||
|
listen (>= 2.7, <= 4.0)
|
||||||
|
lumberjack (~> 1.0)
|
||||||
|
nenv (~> 0.1)
|
||||||
|
notiffany (~> 0.0)
|
||||||
|
pry (>= 0.9.12)
|
||||||
|
shellany (~> 0.0)
|
||||||
|
thor (>= 0.18.1)
|
||||||
|
guard-compat (1.2.1)
|
||||||
|
guard-rspec (4.6.4)
|
||||||
|
guard (~> 2.1)
|
||||||
|
guard-compat (~> 1.1)
|
||||||
|
rspec (>= 2.99.0, < 4.0)
|
||||||
hashie (3.4.1)
|
hashie (3.4.1)
|
||||||
i18n (0.7.0)
|
i18n (0.7.0)
|
||||||
jquery-rails (4.0.3)
|
jquery-rails (4.0.3)
|
||||||
|
@ -100,8 +116,12 @@ GEM
|
||||||
rails
|
rails
|
||||||
launchy (2.4.3)
|
launchy (2.4.3)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
|
listen (3.0.6)
|
||||||
|
rb-fsevent (>= 0.9.3)
|
||||||
|
rb-inotify (>= 0.9.7)
|
||||||
loofah (2.0.1)
|
loofah (2.0.1)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
|
lumberjack (1.0.10)
|
||||||
mail (2.6.3)
|
mail (2.6.3)
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 3)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
|
@ -110,8 +130,12 @@ GEM
|
||||||
minitest (5.6.0)
|
minitest (5.6.0)
|
||||||
multi_json (1.11.0)
|
multi_json (1.11.0)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
|
nenv (0.3.0)
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.6.2)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile (~> 0.6.0)
|
||||||
|
notiffany (0.0.8)
|
||||||
|
nenv (~> 0.1)
|
||||||
|
shellany (~> 0.0)
|
||||||
omniauth (1.2.2)
|
omniauth (1.2.2)
|
||||||
hashie (>= 1.2, < 4)
|
hashie (>= 1.2, < 4)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
|
@ -158,8 +182,15 @@ GEM
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rake (10.4.2)
|
rake (10.4.2)
|
||||||
|
rb-fsevent (0.9.7)
|
||||||
|
rb-inotify (0.9.7)
|
||||||
|
ffi (>= 0.5.0)
|
||||||
rdoc (4.2.0)
|
rdoc (4.2.0)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
|
rspec (3.3.0)
|
||||||
|
rspec-core (~> 3.3.0)
|
||||||
|
rspec-expectations (~> 3.3.0)
|
||||||
|
rspec-mocks (~> 3.3.0)
|
||||||
rspec-core (3.3.2)
|
rspec-core (3.3.2)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.3.0)
|
||||||
rspec-expectations (3.3.1)
|
rspec-expectations (3.3.1)
|
||||||
|
@ -187,6 +218,7 @@ GEM
|
||||||
sdoc (0.4.1)
|
sdoc (0.4.1)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
|
shellany (0.0.1)
|
||||||
shoulda-matchers (3.1.1)
|
shoulda-matchers (3.1.1)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
simplecov (0.11.1)
|
simplecov (0.11.1)
|
||||||
|
@ -215,6 +247,7 @@ GEM
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sqlite3 (1.3.10)
|
sqlite3 (1.3.10)
|
||||||
temple (0.7.5)
|
temple (0.7.5)
|
||||||
|
terminal-notifier-guard (1.6.4)
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.5)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
|
@ -244,6 +277,7 @@ DEPENDENCIES
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
faker
|
faker
|
||||||
foundation-rails
|
foundation-rails
|
||||||
|
guard-rspec
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari
|
kaminari
|
||||||
kaminari-i18n
|
kaminari-i18n
|
||||||
|
@ -264,6 +298,7 @@ DEPENDENCIES
|
||||||
spring
|
spring
|
||||||
spring-commands-rspec
|
spring-commands-rspec
|
||||||
sqlite3
|
sqlite3
|
||||||
|
terminal-notifier-guard
|
||||||
turbolinks
|
turbolinks
|
||||||
uglifier
|
uglifier
|
||||||
validate_url
|
validate_url
|
||||||
|
|
70
Guardfile
Normal file
70
Guardfile
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
# A sample Guardfile
|
||||||
|
# More info at https://github.com/guard/guard#readme
|
||||||
|
|
||||||
|
## Uncomment and set this to only include directories you want to watch
|
||||||
|
# directories %w(app lib config test spec features) \
|
||||||
|
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
||||||
|
|
||||||
|
## Note: if you are using the `directories` clause above and you are not
|
||||||
|
## watching the project directory ('.'), then you will want to move
|
||||||
|
## the Guardfile to a watched dir and symlink it back, e.g.
|
||||||
|
#
|
||||||
|
# $ mkdir config
|
||||||
|
# $ mv Guardfile config/
|
||||||
|
# $ ln -s config/Guardfile .
|
||||||
|
#
|
||||||
|
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
||||||
|
|
||||||
|
# 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'
|
||||||
|
|
||||||
|
guard :rspec, cmd: "bin/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)
|
||||||
|
|
||||||
|
# Ruby files
|
||||||
|
ruby = dsl.ruby
|
||||||
|
dsl.watch_spec_files_for(ruby.lib_files)
|
||||||
|
|
||||||
|
# Rails files
|
||||||
|
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
||||||
|
dsl.watch_spec_files_for(rails.app_files)
|
||||||
|
dsl.watch_spec_files_for(rails.views)
|
||||||
|
|
||||||
|
watch(rails.controllers) do |m|
|
||||||
|
[
|
||||||
|
rspec.spec.("routing/#{m[1]}_routing"),
|
||||||
|
rspec.spec.("controllers/#{m[1]}_controller"),
|
||||||
|
rspec.spec.("acceptance/#{m[1]}")
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
# Rails config changes
|
||||||
|
watch(rails.spec_helper) { rspec.spec_dir }
|
||||||
|
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
||||||
|
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
||||||
|
|
||||||
|
# Capybara features specs
|
||||||
|
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
|
||||||
|
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
|
||||||
|
|
||||||
|
# Turnip features and steps
|
||||||
|
watch(%r{^spec/acceptance/(.+)\.feature$})
|
||||||
|
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
||||||
|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue