Skip to content
Browse files

Added guard

  • Loading branch information...
1 parent 53f0897 commit acb8b1a5db3fbf0c90a3d71cfeb494f53074657c @matthewford matthewford committed Aug 17, 2012
Showing with 27 additions and 8 deletions.
  1. +1 −0 Gemfile
  2. +7 −0 Gemfile.lock
  3. +19 −0 Guardfile
  4. +0 −2 app/controllers/api/v1/commodities_controller.rb
  5. +0 −6 app/controllers/application_controller.rb
View
1 Gemfile
@@ -30,6 +30,7 @@ end
group :development do
gem 'capistrano'
+ gem 'guard-rspec'
end
group :test do
View
7 Gemfile.lock
@@ -76,7 +76,13 @@ GEM
railties (>= 3.0.0)
fakeweb (1.3.0)
fastercsv (1.5.5)
+ ffi (1.0.11)
forgery (0.5.0)
+ guard (1.0.3)
+ ffi (>= 0.5.0)
+ thor (>= 0.14.6)
+ guard-rspec (0.7.2)
+ guard (>= 0.10.0)
haml (3.1.6)
hashr (0.0.21)
highline (1.6.13)
@@ -239,6 +245,7 @@ DEPENDENCIES
factory_girl_rails
fakeweb
forgery
+ guard-rspec
jquery-rails (~> 1.0.19)
json_expressions
mysql2
View
19 Guardfile
@@ -0,0 +1,19 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2 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" }
+end
+
View
2 app/controllers/api/v1/commodities_controller.rb
@@ -2,8 +2,6 @@ module Api
module V1
class CommoditiesController < ApplicationController
- before_filter :restrict_access, only: [:update]
-
def show
@commodity = Commodity.actual
.declarable
View
6 app/controllers/application_controller.rb
@@ -41,12 +41,6 @@ def render_error(exception)
private
- # def restrict_access
- # authenticate_with_http_token do |token, options|
- # true # ApiKey.where(access_token: token).exists?
- # end
- # end
-
def configure_time_machine
TimeMachine.at(params[:as_of]) do
yield

0 comments on commit acb8b1a

Please sign in to comment.
Something went wrong with that request. Please try again.