Browse files

added & configured Guard

  • Loading branch information...
1 parent 6cc4f7a commit d597eb200310697ade485c4b502db259b189a80b @smcpherson smcpherson committed Sep 14, 2012
Showing with 59 additions and 43 deletions.
  1. +7 −1 Gemfile
  2. +34 −1 Gemfile.lock
  3. +3 −39 Guardfile
  4. +1 −1 lib/tzip/values/hawaii.rb
  5. +12 −1 spec/spec_helper.rb
  6. +2 −0 spec/tzip_spec.rb
View
8 Gemfile
@@ -1,3 +1,9 @@
source "http://rubygems.org"
-gem "guard"
+gem 'debugger', '~> 1.2.0'
+gem 'rspec'
+gem "guard", '~> 1.3.2'
+gem 'guard-rspec', '~> 1.2.1'
+gem 'guard-spork', '~> 1.1.0'
+gem 'rb-fsevent', '~> 0.9.1'
+gem 'active_support'
View
35 Gemfile.lock
@@ -1,14 +1,47 @@
GEM
remote: http://rubygems.org/
specs:
+ active_support (3.0.0)
+ activesupport (= 3.0.0)
+ activesupport (3.0.0)
+ columnize (0.3.6)
+ debugger (1.2.0)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1.1)
+ debugger-ruby_core_source (~> 1.1.3)
+ debugger-linecache (1.1.2)
+ debugger-ruby_core_source (>= 1.1.1)
+ debugger-ruby_core_source (1.1.3)
+ diff-lcs (1.1.3)
guard (1.3.2)
listen (>= 0.4.2)
thor (>= 0.14.6)
+ guard-rspec (1.2.1)
+ guard (>= 1.1)
+ guard-spork (1.1.0)
+ guard (>= 1.1)
+ spork (>= 0.8.4)
listen (0.5.0)
+ rb-fsevent (0.9.1)
+ rspec (2.11.0)
+ rspec-core (~> 2.11.0)
+ rspec-expectations (~> 2.11.0)
+ rspec-mocks (~> 2.11.0)
+ rspec-core (2.11.1)
+ rspec-expectations (2.11.3)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.11.2)
+ spork (1.0.0rc3)
thor (0.16.0)
PLATFORMS
ruby
DEPENDENCIES
- guard
+ active_support
+ debugger (~> 1.2.0)
+ guard (~> 1.3.2)
+ guard-rspec (~> 1.2.1)
+ guard-spork (~> 1.1.0)
+ rb-fsevent (~> 0.9.1)
+ rspec
View
42 Guardfile
@@ -1,47 +1,11 @@
-# A sample Guardfile
-# More info at https://github.com/guard/guard#readme
-
-guard 'coffeescript', :input => 'app/assets/javascripts'
-
-guard 'livereload' do
- watch(%r{app/views/.+\.(erb|haml|slim)})
- watch(%r{app/helpers/.+\.rb})
- watch(%r{public/.+\.(css|js|html)})
- watch(%r{config/locales/.+\.yml})
- # Rails Assets Pipeline
- watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*}) { |m| "/assets/#{m[2]}" }
-end
-
-guard 'rspec', :version => 2 do
+guard "rspec", :all_after_pass => false, :all_on_start => false, :version => 2, :cli => "--color --format nested --drb" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
-
- # Rails example
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
- watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
- watch('config/routes.rb') { "spec/routing" }
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
-
- # Capybara request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-
- # Turnip features and steps
- watch(%r{^spec/acceptance/(.+)\.feature$})
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end
-
-guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
- watch('config/application.rb')
- watch('config/environment.rb')
- watch('config/environments/test.rb')
- watch(%r{^config/initializers/.+\.rb$})
+guard 'spork' do
watch('Gemfile')
watch('Gemfile.lock')
- watch('spec/spec_helper.rb') { :rspec }
- watch('test/test_helper.rb') { :test_unit }
- watch(%r{features/support/}) { :cucumber }
+ watch('spec/spec_helper.rb')
end
View
2 lib/tzip/values/hawaii.rb
@@ -1,3 +1,3 @@
module TZip
ZONINGS[:hawaii] = %w{967 968}
-end
+end
View
13 spec/spec_helper.rb
@@ -1,6 +1,17 @@
-require File.join(File.dirname(__FILE__), '/../lib/tzip')
+require 'rubygems'
require 'spork'
require 'spork/ext/ruby-debug'
+require 'active_support'
+require 'rspec'
+
+Spork.prefork do
+
+end
+
+Spork.each_run do
+ require File.join(File.dirname(__FILE__), '../lib/tzip.rb')
+ Dir.glob(File.dirname(__FILE__) + '/../lib/tzip/values/*.rb') {|file| require file}
+end
def lookup_zip(zip)
ActiveSupport::TimeZone.find_by_zipcode(zip)
View
2 spec/tzip_spec.rb
@@ -1,3 +1,5 @@
+require "spec_helper"
+
describe TZip do
describe "Alaska" do

0 comments on commit d597eb2

Please sign in to comment.