baleen 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/baleen.gemspec +33 -0
- data/bin/baleen +17 -0
- data/lib/baleen/client.rb +45 -0
- data/lib/baleen/container.rb +49 -0
- data/lib/baleen/job.rb +19 -0
- data/lib/baleen/messages/messages.rb +48 -0
- data/lib/baleen/messages/request.rb +31 -0
- data/lib/baleen/messages/response.rb +29 -0
- data/lib/baleen/runner.rb +119 -0
- data/lib/baleen/server.rb +75 -0
- data/lib/baleen/task.rb +44 -0
- data/lib/baleen/utils/colored_puts.rb +17 -0
- data/lib/baleen/version.rb +3 -0
- data/lib/baleen.rb +5 -0
- data/poc/.gitignore +15 -0
- data/poc/Gemfile +49 -0
- data/poc/README.rdoc +261 -0
- data/poc/Rakefile +7 -0
- data/poc/app/assets/images/rails.png +0 -0
- data/poc/app/assets/javascripts/application.js +15 -0
- data/poc/app/assets/stylesheets/application.css +13 -0
- data/poc/app/controllers/application_controller.rb +3 -0
- data/poc/app/helpers/application_helper.rb +2 -0
- data/poc/app/mailers/.gitkeep +0 -0
- data/poc/app/models/.gitkeep +0 -0
- data/poc/app/models/ar_profile.rb +3 -0
- data/poc/app/views/layouts/application.html.erb +14 -0
- data/poc/config/application.rb +62 -0
- data/poc/config/boot.rb +6 -0
- data/poc/config/cucumber.yml +8 -0
- data/poc/config/database.yml +28 -0
- data/poc/config/environment.rb +5 -0
- data/poc/config/environments/development.rb +37 -0
- data/poc/config/environments/production.rb +67 -0
- data/poc/config/environments/test.rb +37 -0
- data/poc/config/initializers/backtrace_silencers.rb +7 -0
- data/poc/config/initializers/inflections.rb +15 -0
- data/poc/config/initializers/mime_types.rb +5 -0
- data/poc/config/initializers/secret_token.rb +7 -0
- data/poc/config/initializers/session_store.rb +8 -0
- data/poc/config/initializers/wrap_parameters.rb +14 -0
- data/poc/config/locales/en.yml +5 -0
- data/poc/config/routes.rb +58 -0
- data/poc/config.ru +4 -0
- data/poc/db/.gitkeep +0 -0
- data/poc/db/migrate/20130914144710_create_ar_profiles.rb +11 -0
- data/poc/db/schema.rb +24 -0
- data/poc/db/seeds.rb +7 -0
- data/poc/features/cpu_bound.feature +3 -0
- data/poc/features/io_bound.feature +3 -0
- data/poc/features/step_definitions/fake_test_steps.rb +25 -0
- data/poc/features/support/env.rb +60 -0
- data/poc/features/support/ruby_prof_cucumber.rb +15 -0
- data/poc/features/t1.feature +12 -0
- data/poc/features/t10.feature +12 -0
- data/poc/features/t2.feature +12 -0
- data/poc/features/t3.feature +12 -0
- data/poc/features/t4.feature +12 -0
- data/poc/features/t5.feature +12 -0
- data/poc/features/t6.feature +12 -0
- data/poc/features/t7.feature +12 -0
- data/poc/features/t8.feature +12 -0
- data/poc/features/t9.feature +12 -0
- data/poc/lib/assets/.gitkeep +0 -0
- data/poc/lib/tasks/.gitkeep +0 -0
- data/poc/lib/tasks/cucumber.rake +65 -0
- data/poc/public/404.html +26 -0
- data/poc/public/422.html +26 -0
- data/poc/public/500.html +25 -0
- data/poc/public/favicon.ico +0 -0
- data/poc/public/index.html +241 -0
- data/poc/public/robots.txt +5 -0
- data/poc/script/cucumber +10 -0
- data/poc/script/rails +6 -0
- data/poc/test/fixtures/.gitkeep +0 -0
- data/poc/test/fixtures/ar_profiles.yml +11 -0
- data/poc/test/functional/.gitkeep +0 -0
- data/poc/test/integration/.gitkeep +0 -0
- data/poc/test/performance/browsing_test.rb +12 -0
- data/poc/test/test_helper.rb +13 -0
- data/poc/test/unit/.gitkeep +0 -0
- data/poc/test/unit/ar_profile_test.rb +7 -0
- data/poc/vendor/assets/javascripts/.gitkeep +0 -0
- data/poc/vendor/assets/stylesheets/.gitkeep +0 -0
- data/poc/vendor/plugins/.gitkeep +0 -0
- metadata +262 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
|
7
|
+
CiApp::Application.config.secret_token = 'b4d2d0d59f9052976e576b35b15a0a000dcdec5a73cc64e71af6d22a01e0b1b686550c223fda0d195255c92d21bca83e1f1c0ae9d3155c5cc450dcce23ad8372'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
CiApp::Application.config.session_store :cookie_store, key: '_ci_app_session'
|
|
4
|
+
|
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
|
6
|
+
# which shouldn't be used to store highly confidential information
|
|
7
|
+
# (create the session table with "rails generate session_migration")
|
|
8
|
+
# CiApp::Application.config.session_store :active_record_store
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
#
|
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
|
4
|
+
# is enabled by default.
|
|
5
|
+
|
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
|
8
|
+
wrap_parameters format: [:json]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Disable root element in JSON by default.
|
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
|
13
|
+
self.include_root_in_json = false
|
|
14
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
CiApp::Application.routes.draw do
|
|
2
|
+
# The priority is based upon order of creation:
|
|
3
|
+
# first created -> highest priority.
|
|
4
|
+
|
|
5
|
+
# Sample of regular route:
|
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
|
8
|
+
|
|
9
|
+
# Sample of named route:
|
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
|
12
|
+
|
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
|
14
|
+
# resources :products
|
|
15
|
+
|
|
16
|
+
# Sample resource route with options:
|
|
17
|
+
# resources :products do
|
|
18
|
+
# member do
|
|
19
|
+
# get 'short'
|
|
20
|
+
# post 'toggle'
|
|
21
|
+
# end
|
|
22
|
+
#
|
|
23
|
+
# collection do
|
|
24
|
+
# get 'sold'
|
|
25
|
+
# end
|
|
26
|
+
# end
|
|
27
|
+
|
|
28
|
+
# Sample resource route with sub-resources:
|
|
29
|
+
# resources :products do
|
|
30
|
+
# resources :comments, :sales
|
|
31
|
+
# resource :seller
|
|
32
|
+
# end
|
|
33
|
+
|
|
34
|
+
# Sample resource route with more complex sub-resources
|
|
35
|
+
# resources :products do
|
|
36
|
+
# resources :comments
|
|
37
|
+
# resources :sales do
|
|
38
|
+
# get 'recent', :on => :collection
|
|
39
|
+
# end
|
|
40
|
+
# end
|
|
41
|
+
|
|
42
|
+
# Sample resource route within a namespace:
|
|
43
|
+
# namespace :admin do
|
|
44
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
|
45
|
+
# # (app/controllers/admin/products_controller.rb)
|
|
46
|
+
# resources :products
|
|
47
|
+
# end
|
|
48
|
+
|
|
49
|
+
# You can have the root of your site routed with "root"
|
|
50
|
+
# just remember to delete public/index.html.
|
|
51
|
+
# root :to => 'welcome#index'
|
|
52
|
+
|
|
53
|
+
# See how all your routes lay out with "rake routes"
|
|
54
|
+
|
|
55
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
|
56
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
|
57
|
+
# match ':controller(/:action(/:id))(.:format)'
|
|
58
|
+
end
|
data/poc/config.ru
ADDED
data/poc/db/.gitkeep
ADDED
|
File without changes
|
data/poc/db/schema.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
|
5
|
+
#
|
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
|
7
|
+
# database schema. If you need to create the application database on another
|
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
11
|
+
#
|
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
|
13
|
+
|
|
14
|
+
ActiveRecord::Schema.define(:version => 20130914144710) do
|
|
15
|
+
|
|
16
|
+
create_table "ar_profiles", :force => true do |t|
|
|
17
|
+
t.string "name_profile"
|
|
18
|
+
t.integer "number_profile"
|
|
19
|
+
t.date "date_profile"
|
|
20
|
+
t.datetime "created_at", :null => false
|
|
21
|
+
t.datetime "updated_at", :null => false
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
data/poc/db/seeds.rb
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
|
3
|
+
#
|
|
4
|
+
# Examples:
|
|
5
|
+
#
|
|
6
|
+
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
|
7
|
+
# Mayor.create(name: 'Emanuel', city: cities.first)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Then /^1 \+ 1 == 2$/ do
|
|
2
|
+
1 + 1 == 2
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
Then /cpu intensive operation/ do
|
|
6
|
+
t1 = Time.now
|
|
7
|
+
|
|
8
|
+
rep = 100
|
|
9
|
+
n = 100
|
|
10
|
+
|
|
11
|
+
x = Array.new(n, 0)
|
|
12
|
+
|
|
13
|
+
for j in 1..rep
|
|
14
|
+
for i in 0..(n-1)
|
|
15
|
+
x[i] += i
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Then /io intensive operation/ do
|
|
21
|
+
ArProfile.destroy_all
|
|
22
|
+
1000.times do
|
|
23
|
+
ArProfile.create!
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
|
3
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
|
4
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
|
5
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
|
6
|
+
# files.
|
|
7
|
+
|
|
8
|
+
require 'cucumber/rails'
|
|
9
|
+
|
|
10
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
|
11
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
|
12
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
|
13
|
+
# steps to use the XPath syntax.
|
|
14
|
+
Capybara.default_selector = :css
|
|
15
|
+
|
|
16
|
+
# By default, any exception happening in your Rails application will bubble up
|
|
17
|
+
# to Cucumber so that your scenario will fail. This is a different from how
|
|
18
|
+
# your application behaves in the production environment, where an error page will
|
|
19
|
+
# be rendered instead.
|
|
20
|
+
#
|
|
21
|
+
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
|
22
|
+
# exceptions and display an error page (just like when the app is running in production).
|
|
23
|
+
# Typical scenarios where you want to do this is when you test your error pages.
|
|
24
|
+
# There are two ways to allow Rails to rescue exceptions:
|
|
25
|
+
#
|
|
26
|
+
# 1) Tag your scenario (or feature) with @allow-rescue
|
|
27
|
+
#
|
|
28
|
+
# 2) Set the value below to true. Beware that doing this globally is not
|
|
29
|
+
# recommended as it will mask a lot of errors for you!
|
|
30
|
+
#
|
|
31
|
+
ActionController::Base.allow_rescue = false
|
|
32
|
+
|
|
33
|
+
# Remove/comment out the lines below if your app doesn't have a database.
|
|
34
|
+
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
|
35
|
+
begin
|
|
36
|
+
DatabaseCleaner.strategy = :transaction
|
|
37
|
+
rescue NameError
|
|
38
|
+
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
|
42
|
+
# See the DatabaseCleaner documentation for details. Example:
|
|
43
|
+
#
|
|
44
|
+
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
|
45
|
+
# # { :except => [:widgets] } may not do what you expect here
|
|
46
|
+
# # as tCucumber::Rails::Database.javascript_strategy overrides
|
|
47
|
+
# # this setting.
|
|
48
|
+
# DatabaseCleaner.strategy = :truncation
|
|
49
|
+
# end
|
|
50
|
+
#
|
|
51
|
+
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
|
52
|
+
# DatabaseCleaner.strategy = :transaction
|
|
53
|
+
# end
|
|
54
|
+
#
|
|
55
|
+
|
|
56
|
+
# Possible values are :truncation and :transaction
|
|
57
|
+
# The :transaction strategy is faster, but might give you threading problems.
|
|
58
|
+
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
|
59
|
+
Cucumber::Rails::Database.javascript_strategy = :truncation
|
|
60
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
if ENV['RUBY_PROF'].present?
|
|
2
|
+
require 'ruby-prof'
|
|
3
|
+
RubyProf.start
|
|
4
|
+
|
|
5
|
+
at_exit do
|
|
6
|
+
results = RubyProf.stop
|
|
7
|
+
File.open "#{Rails.root}/tmp/profile-graph.html", 'w' do |file|
|
|
8
|
+
RubyProf::GraphHtmlPrinter.new(results).print(file)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
File.open "#{Rails.root}/tmp/profile-flat.txt", 'w' do |file|
|
|
12
|
+
RubyProf::FlatPrinter.new(results).print(file)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t1
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t10
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t2
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t3
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t4
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t5
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t6
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t7
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t8
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: t9
|
|
2
|
+
Scenario: Benchmark for IO bound operation
|
|
3
|
+
Then io intensive operation
|
|
4
|
+
|
|
5
|
+
Scenario: Benchmark for CPU bound operation
|
|
6
|
+
Then cpu intensive operation
|
|
7
|
+
|
|
8
|
+
Scenario: Benchmark for IO bound operation
|
|
9
|
+
Then io intensive operation
|
|
10
|
+
|
|
11
|
+
Scenario: Benchmark for CPU bound operation
|
|
12
|
+
Then cpu intensive operation
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
|
5
|
+
# files.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
|
9
|
+
|
|
10
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
|
12
|
+
|
|
13
|
+
begin
|
|
14
|
+
require 'cucumber/rake/task'
|
|
15
|
+
|
|
16
|
+
namespace :cucumber do
|
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
20
|
+
t.profile = 'default'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
|
24
|
+
t.binary = vendored_cucumber_bin
|
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
26
|
+
t.profile = 'wip'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
|
30
|
+
t.binary = vendored_cucumber_bin
|
|
31
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
32
|
+
t.profile = 'rerun'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
desc 'Run all features'
|
|
36
|
+
task :all => [:ok, :wip]
|
|
37
|
+
|
|
38
|
+
task :statsetup do
|
|
39
|
+
require 'rails/code_statistics'
|
|
40
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
|
41
|
+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
desc 'Alias for cucumber:ok'
|
|
45
|
+
task :cucumber => 'cucumber:ok'
|
|
46
|
+
|
|
47
|
+
task :default => :cucumber
|
|
48
|
+
|
|
49
|
+
task :features => :cucumber do
|
|
50
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
|
54
|
+
task 'db:test:prepare' do
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
task :stats => 'cucumber:statsetup'
|
|
58
|
+
rescue LoadError
|
|
59
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
|
60
|
+
task :cucumber do
|
|
61
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
end
|
data/poc/public/404.html
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/404.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
data/poc/public/422.html
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/422.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
data/poc/public/500.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/500.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
23
|
+
</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
File without changes
|