Guest User

Untitled

a guest
Aug 14th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. # Setup Spork
  2. guard 'spork', bundler: true, cucumber_env: { 'RAILS_ENV' => 'test' }, rspec_env: { 'RAILS_ENV' => 'test' }, test_unit_env: { 'RAILS_ENV' => 'test' }, wait: 60 do
  3. watch('config/application.rb')
  4. watch('config/environment.rb')
  5. watch(%r{^config/environments/.+\.rb$})
  6. watch(%r{^config/initializers/.+\.rb$})
  7. watch(%r{^spec/support/.+\.rb$})
  8. watch('spec/spec_helper.rb')
  9. watch('test/test_helper.rb')
  10. watch(%r{^features/support/.+\.rb$})
  11. end
  12.  
  13. # Reload with new gems
  14. guard 'bundler' do
  15. watch('Gemfile')
  16. end
  17.  
  18. # Migrate the database
  19. guard 'migrate', run_on_start: true do
  20. watch(%r{^db/migrate/(\d+).+\.rb})
  21. end
  22.  
  23. # Run Coffeescript Validation
  24. guard 'coffeescript', :input => 'app/assets/javascripts', :noop => true
  25.  
  26. # Use Headless Jasmine
  27. spec_location = "spec/javascripts/%s_spec"
  28. guard 'jasmine-headless-webkit' do
  29. watch(%r{^app/views/.*\.jst$})
  30. watch(%r{^public/javascripts/(.*)\.js$}) { |m| newest_js_file(spec_location % m[1]) }
  31. watch(%r{^app/assets/javascripts/(.*)\.(js|coffee)$}) { |m| newest_js_file(spec_location % m[1]) }
  32. watch(%r{^spec/javascripts/(.*)_spec\..*}) { |m| newest_js_file(spec_location % m[1]) }
  33. end
  34.  
  35. # Run Test::Unit
  36. guard 'test', bundler: true, drb: true, all_after_pass: false, all_on_start: false do
  37. watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
  38. watch(%r{^test/.+_test\.rb$})
  39. watch('test/test_helper.rb') { "test" }
  40. watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
  41. end
  42.  
  43. # Run Rspec
  44. guard 'rspec', bundler: true, version: 2, cli: "--drb", all_after_pass: false, all_on_start: false do
  45. watch(%r{^spec/.+_spec\.rb$})
  46. watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
  47. watch('spec/spec_helper.rb') { "spec" }
  48.  
  49. # Rails example
  50. watch(%r{^spec/.+_spec\.rb$})
  51. watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
  52. watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
  53. 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"] }
  54. watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
  55. watch('spec/spec_helper.rb') { "spec" }
  56. watch('config/routes.rb') { "spec/routing" }
  57. watch('app/controllers/application_controller.rb') { "spec/controllers" }
  58. # Capybara request specs
  59. watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
  60. end
  61.  
  62. # Run Cuke Features
  63. guard 'cucumber', bundler: true, cli: "--drb", all_after_pass: false, all_on_start: false do
  64. watch(%r{^features/.+\.feature$})
  65. watch(%r{^features/support/.+$}) { 'features' }
  66. watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
  67. end
  68.  
  69. # Reload The Browser when changes are made.
  70. guard 'livereload' do
  71. watch(%r{app/.+\.(erb|haml)})
  72. watch(%r{app/helpers/.+\.rb})
  73. watch(%r{(public/|app/assets).+\.(css|js|html)})
  74. watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] }
  75. watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
  76. watch(%r{config/locales/.+\.yml})
  77. end
  78.  
  79. # Restart pow if things change
  80. guard 'pow' do
  81. watch('.powrc')
  82. watch('.powenv')
  83. watch('.rvmrc')
  84. watch('Gemfile')
  85. watch('Gemfile.lock')
  86. watch('config/application.rb')
  87. watch('config/environment.rb')
  88. watch(%r{^config/environments/.*\.rb$})
  89. watch(%r{^config/initializers/.*\.rb$})
  90. end
  91.  
  92. # Use Sprite Factory when files Change
  93. # guard 'sprite-factory', :task_name => 'assets:resprite' do
  94. # watch(%r{^app/assets/images/admin/icons/*.*})
  95. # watch(%r{^lib/tasks/assets.rake})
  96. # end
Add Comment
Please, Sign In to add comment