diff --git a/Gemfile b/Gemfile index ad00aa2..0c3a223 100644 --- a/Gemfile +++ b/Gemfile @@ -67,6 +67,12 @@ group :development, :test do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' + + # Helps run tests automatically after changes + # TODO: not sure all these packages are required (http://buildingrails.com/a/rails_automated_testing_setup_for_beginners) + gem 'guard-rails' + gem 'minitest-rails' + gem 'guard-minitest' end # Zurb Foundation diff --git a/Gemfile.lock b/Gemfile.lock index 09d4f11..7c5f27c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,6 +52,8 @@ GEM builder (3.2.2) byebug (4.0.5) columnize (= 0.9.0) + celluloid (0.16.0) + timers (~> 4.0.0) choice (0.1.7) climate_control (0.0.3) activesupport (>= 3.0) @@ -74,11 +76,30 @@ GEM execjs (2.5.2) fancybox2-rails (0.2.8) railties (>= 3.1.0, < 5.0) + ffi (1.9.8) + formatador (0.2.5) foundation-rails (5.5.1.2) railties (>= 3.1.0) sass (>= 3.3.0, < 3.5) globalid (0.3.5) activesupport (>= 4.1.0) + guard (2.12.5) + formatador (>= 0.2.4) + listen (~> 2.7) + 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-minitest (2.4.4) + guard-compat (~> 1.2) + minitest (>= 3.0) + guard-rails (0.7.1) + guard (~> 2.11) + guard-compat (~> 1.0) + hitimes (1.2.2) i18n (0.7.0) jbuilder (2.2.13) activesupport (>= 3.0.0, < 5) @@ -90,16 +111,29 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.2) + listen (2.10.0) + celluloid (~> 0.16.0) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) loofah (2.0.1) nokogiri (>= 1.5.9) + lumberjack (1.0.9) mail (2.6.3) mime-types (>= 1.16, < 3) + method_source (0.8.2) mime-types (2.4.3) mini_portile (0.6.2) minitest (5.6.0) + minitest-rails (2.1.1) + minitest (~> 5.4) + railties (~> 4.1) multi_json (1.11.0) + nenv (0.2.0) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) + notiffany (0.0.6) + nenv (~> 0.1) + shellany (~> 0.0) paperclip (4.2.1) activemodel (>= 3.0.0) activesupport (>= 3.0.0) @@ -110,6 +144,10 @@ GEM activerecord (>= 3.1) activesupport (>= 3.1) arel + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) rack (1.6.0) rack-test (0.6.3) rack (>= 1.0) @@ -143,6 +181,9 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.4.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) + ffi (>= 0.5.0) rdoc (4.2.0) json (~> 1.4) ruby-graphviz (1.0.9) @@ -156,6 +197,7 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + shellany (0.0.1) slim (3.0.3) temple (~> 0.7.3) tilt (>= 1.3.3, < 2.1) @@ -165,6 +207,7 @@ GEM activesupport (>= 3.1, < 5.0) railties (>= 3.1, < 5.0) slim (~> 3.0) + slop (3.6.0) spring (1.3.4) sprockets (3.0.1) rack (~> 1.0) @@ -176,6 +219,8 @@ GEM thor (0.19.1) thread_safe (0.3.5) tilt (1.4.1) + timers (4.0.1) + hitimes tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.1) @@ -202,8 +247,11 @@ DEPENDENCIES cookies_eu fancybox2-rails (~> 0.2.8) foundation-rails + guard-minitest + guard-rails jbuilder (~> 2.0) jquery-rails + minitest-rails paperclip (~> 4.2) pg pg_search diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..0623256 --- /dev/null +++ b/Guardfile @@ -0,0 +1,55 @@ +# 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) + +## Uncomment to clear the screen before every task +# clearing :on + +## Guard internally checks for changes in the Guardfile and exits. +## If you want Guard to automatically start up again, run guard in a +## shell loop, e.g.: +## +## $ while bundle exec guard; do echo "Restarting Guard..."; done +## +## 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" + +# Guard-Rails supports a lot options with default values: +# daemon: false # runs the server as a daemon. +# debugger: false # enable ruby-debug gem. +# environment: 'development' # changes server environment. +# force_run: false # kills any process that's holding the listen port before attempting to (re)start Rails. +# pid_file: 'tmp/pids/[RAILS_ENV].pid' # specify your pid_file. +# host: 'localhost' # server hostname. +# port: 3000 # server port number. +# root: '/spec/dummy' # Rails' root path. +# server: thin # webserver engine. +# start_on_start: true # will start the server when starting Guard. +# timeout: 30 # waits untill restarting the Rails server, in seconds. +# zeus_plan: server # custom plan in zeus, only works with `zeus: true`. +# zeus: false # enables zeus gem. +# CLI: 'rails server' # customizes runner command. Omits all options except `pid_file`! + +guard 'rails' do + watch('Gemfile.lock') + watch(%r{^(config|lib)/.*}) +end + +guard :minitest do + watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } + watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' } + watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" } + watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" } + watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" } + watch(%r{^test/.+_test\.rb$}) + watch(%r{^test/test_helper\.rb$}) { 'test' } +end