flip_fab 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +5 -0
  3. data/Gemfile +16 -0
  4. data/Gemfile.lock +92 -0
  5. data/LICENSE.txt +9 -0
  6. data/README.md +168 -0
  7. data/example/rails_app/.gitignore +17 -0
  8. data/example/rails_app/Gemfile +36 -0
  9. data/example/rails_app/Gemfile.lock +178 -0
  10. data/example/rails_app/README.rdoc +28 -0
  11. data/example/rails_app/Rakefile +6 -0
  12. data/example/rails_app/app/assets/images/.keep +0 -0
  13. data/example/rails_app/app/assets/images/justin_beaver.jpg +0 -0
  14. data/example/rails_app/app/assets/images/regular_beaver.jpg +0 -0
  15. data/example/rails_app/app/assets/javascripts/application.js +16 -0
  16. data/example/rails_app/app/assets/javascripts/beavers.js.coffee +3 -0
  17. data/example/rails_app/app/assets/stylesheets/application.css +15 -0
  18. data/example/rails_app/app/assets/stylesheets/beavers.css.scss +3 -0
  19. data/example/rails_app/app/assets/stylesheets/scaffolds.css.scss +69 -0
  20. data/example/rails_app/app/controllers/application_controller.rb +5 -0
  21. data/example/rails_app/app/controllers/beavers_controller.rb +74 -0
  22. data/example/rails_app/app/controllers/concerns/.keep +0 -0
  23. data/example/rails_app/app/helpers/application_helper.rb +2 -0
  24. data/example/rails_app/app/helpers/beavers_helper.rb +2 -0
  25. data/example/rails_app/app/mailers/.keep +0 -0
  26. data/example/rails_app/app/models/.keep +0 -0
  27. data/example/rails_app/app/models/beaver.rb +2 -0
  28. data/example/rails_app/app/models/concerns/.keep +0 -0
  29. data/example/rails_app/app/views/beavers/_form.html.erb +21 -0
  30. data/example/rails_app/app/views/beavers/edit.html.erb +6 -0
  31. data/example/rails_app/app/views/beavers/index.html.erb +25 -0
  32. data/example/rails_app/app/views/beavers/index.json.jbuilder +4 -0
  33. data/example/rails_app/app/views/beavers/new.html.erb +5 -0
  34. data/example/rails_app/app/views/beavers/show.html.erb +9 -0
  35. data/example/rails_app/app/views/beavers/show.json.jbuilder +1 -0
  36. data/example/rails_app/app/views/layouts/application.html.erb +18 -0
  37. data/example/rails_app/bin/bundle +3 -0
  38. data/example/rails_app/bin/rails +4 -0
  39. data/example/rails_app/bin/rake +4 -0
  40. data/example/rails_app/config/application.rb +25 -0
  41. data/example/rails_app/config/boot.rb +4 -0
  42. data/example/rails_app/config/database.yml +22 -0
  43. data/example/rails_app/config/environment.rb +5 -0
  44. data/example/rails_app/config/environments/development.rb +83 -0
  45. data/example/rails_app/config/environments/test.rb +41 -0
  46. data/example/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  47. data/example/rails_app/config/initializers/cookies_serializer.rb +3 -0
  48. data/example/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/example/rails_app/config/initializers/flip_fab.rb +1 -0
  50. data/example/rails_app/config/initializers/inflections.rb +16 -0
  51. data/example/rails_app/config/initializers/mime_types.rb +4 -0
  52. data/example/rails_app/config/initializers/session_store.rb +3 -0
  53. data/example/rails_app/config/initializers/wrap_parameters.rb +14 -0
  54. data/example/rails_app/config/locales/en.yml +23 -0
  55. data/example/rails_app/config/rabbit_feed.yml +8 -0
  56. data/example/rails_app/config/routes.rb +58 -0
  57. data/example/rails_app/config/secrets.yml +18 -0
  58. data/example/rails_app/config/unicorn.rb +4 -0
  59. data/example/rails_app/config.ru +4 -0
  60. data/example/rails_app/db/migrate/20140424102400_create_beavers.rb +9 -0
  61. data/example/rails_app/db/schema.rb +22 -0
  62. data/example/rails_app/db/seeds.rb +7 -0
  63. data/example/rails_app/lib/assets/.keep +0 -0
  64. data/example/rails_app/lib/tasks/.keep +0 -0
  65. data/example/rails_app/log/.keep +0 -0
  66. data/example/rails_app/public/404.html +67 -0
  67. data/example/rails_app/public/422.html +67 -0
  68. data/example/rails_app/public/500.html +66 -0
  69. data/example/rails_app/public/favicon.ico +0 -0
  70. data/example/rails_app/public/robots.txt +5 -0
  71. data/example/rails_app/spec/rails_helper.rb +50 -0
  72. data/example/rails_app/spec/spec_helper.rb +8 -0
  73. data/example/rails_app/test/controllers/.keep +0 -0
  74. data/example/rails_app/test/controllers/beavers_controller_test.rb +49 -0
  75. data/example/rails_app/test/fixtures/.keep +0 -0
  76. data/example/rails_app/test/fixtures/beavers.yml +7 -0
  77. data/example/rails_app/test/helpers/.keep +0 -0
  78. data/example/rails_app/test/helpers/beavers_helper_test.rb +4 -0
  79. data/example/rails_app/test/integration/.keep +0 -0
  80. data/example/rails_app/test/mailers/.keep +0 -0
  81. data/example/rails_app/test/models/.keep +0 -0
  82. data/example/rails_app/test/models/beaver_test.rb +7 -0
  83. data/example/rails_app/test/test_helper.rb +13 -0
  84. data/flip_fab.gemspec +20 -0
  85. data/lib/flip_fab/contextual_feature.rb +83 -0
  86. data/lib/flip_fab/cookie_persistence.rb +52 -0
  87. data/lib/flip_fab/feature.rb +24 -0
  88. data/lib/flip_fab/features_by_name.rb +22 -0
  89. data/lib/flip_fab/helper.rb +8 -0
  90. data/lib/flip_fab/persistence.rb +19 -0
  91. data/lib/flip_fab/version.rb +3 -0
  92. data/lib/flip_fab.rb +24 -0
  93. data/spec/lib/flip_fab/contextual_feature_spec.rb +352 -0
  94. data/spec/lib/flip_fab/cookie_persistence.feature +50 -0
  95. data/spec/lib/flip_fab/cookie_persistence_spec.rb +90 -0
  96. data/spec/lib/flip_fab/feature_spec.rb +86 -0
  97. data/spec/lib/flip_fab/features_by_name_spec.rb +34 -0
  98. data/spec/lib/flip_fab/helper.feature +31 -0
  99. data/spec/lib/flip_fab/helper_spec.rb +90 -0
  100. data/spec/lib/flip_fab/persistence_spec.rb +32 -0
  101. data/spec/lib/flip_fab.feature +10 -0
  102. data/spec/lib/flip_fab_spec.rb +47 -0
  103. data/spec/spec_helper.rb +93 -0
  104. data/spec/support/test_app.rb +16 -0
  105. data/spec/support/test_context.rb +10 -0
  106. data/spec/support/test_multiple_persistence.rb +14 -0
  107. data/spec/support/test_persistence.rb +14 -0
  108. data/spec/support/test_rack_context.rb +15 -0
  109. metadata +168 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ea3fd649b489b75844fc35dd2716d541abf34ca
4
+ data.tar.gz: 0680f0288b3f0a64673affb0d55466351c10478e
5
+ SHA512:
6
+ metadata.gz: a4244a1f9a56503cf8a2978e22211502cc0c4ac7ab630cfc8abc79c1c4f61aa155a463eebc85dc75beb284d79c475fa1a824c01e4df85444896b84d9bfa2e0b3
7
+ data.tar.gz: c4073fe2c728d9e7f61fe6edf88903345f297d76c4e39d2116a6c7215dfb323a0f20da89e96f03a68c2f6945d2458809227612446d9d6f88069dabefc7c0db71
data/.rspec ADDED
@@ -0,0 +1,5 @@
1
+ -r rutabaga
2
+ --order rand
3
+ --color
4
+ --require spec_helper
5
+ --format doc
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in flip_fab.gemspec
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem 'pry-plus'
8
+ end
9
+
10
+ group :test do
11
+ gem 'rack'
12
+ gem 'rack-test'
13
+ gem 'rspec'
14
+ gem 'rutabaga'
15
+ gem 'timecop'
16
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ flip_fab (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ binding_of_caller (0.7.2)
10
+ debug_inspector (>= 0.0.1)
11
+ bond (0.5.1)
12
+ coderay (1.1.0)
13
+ columnize (0.9.0)
14
+ debug_inspector (0.0.2)
15
+ debugger (1.6.8)
16
+ columnize (>= 0.3.1)
17
+ debugger-linecache (~> 1.2.0)
18
+ debugger-ruby_core_source (~> 1.3.5)
19
+ debugger-linecache (1.2.0)
20
+ debugger-ruby_core_source (1.3.8)
21
+ diff-lcs (1.2.5)
22
+ gherkin (2.12.2)
23
+ multi_json (~> 1.3)
24
+ interception (0.5)
25
+ jist (1.5.1)
26
+ json
27
+ json (1.8.2)
28
+ method_source (0.8.2)
29
+ multi_json (1.10.1)
30
+ pry (0.10.1)
31
+ coderay (~> 1.1.0)
32
+ method_source (~> 0.8.1)
33
+ slop (~> 3.4)
34
+ pry-debugger (0.2.3)
35
+ debugger (~> 1.3)
36
+ pry (>= 0.9.10, < 0.11.0)
37
+ pry-doc (0.6.0)
38
+ pry (~> 0.9)
39
+ yard (~> 0.8)
40
+ pry-docmore (0.1.1)
41
+ pry
42
+ pry-doc
43
+ pry-plus (1.0.0)
44
+ bond
45
+ jist
46
+ pry-debugger
47
+ pry-doc
48
+ pry-docmore
49
+ pry-rescue
50
+ pry-stack_explorer
51
+ pry-rescue (1.4.1)
52
+ interception (>= 0.5)
53
+ pry
54
+ pry-stack_explorer (0.4.9.2)
55
+ binding_of_caller (>= 0.7)
56
+ pry (>= 0.9.11)
57
+ rack (1.6.0)
58
+ rack-test (0.6.3)
59
+ rack (>= 1.0)
60
+ rspec (3.2.0)
61
+ rspec-core (~> 3.2.0)
62
+ rspec-expectations (~> 3.2.0)
63
+ rspec-mocks (~> 3.2.0)
64
+ rspec-core (3.2.0)
65
+ rspec-support (~> 3.2.0)
66
+ rspec-expectations (3.2.0)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.2.0)
69
+ rspec-mocks (3.2.0)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.2.0)
72
+ rspec-support (3.2.1)
73
+ rutabaga (0.1.1)
74
+ turnip (>= 1.1.0, < 2.0)
75
+ slop (3.6.0)
76
+ timecop (0.7.3)
77
+ turnip (1.2.4)
78
+ gherkin (>= 2.5)
79
+ rspec (>= 2.14.0, < 4.0)
80
+ yard (0.8.7.6)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ flip_fab!
87
+ pry-plus
88
+ rack
89
+ rack-test
90
+ rspec
91
+ rutabaga
92
+ timecop
data/LICENSE.txt ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) 2015 Simply Business
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,168 @@
1
+ Flip Fab
2
+ --------
3
+
4
+ **Feature flipping... Made FaBuLoUs!**
5
+
6
+ A gem providing persistent (via cookie store) feature flipping to Rack applications.
7
+
8
+ This allows you to...
9
+
10
+ * Define features that can be used to modify the behaviour of an application
11
+ * Persist the features' states in a user's cookie so that they see a consistent feature set for all applications in a domain
12
+ * Define your own custom persistence adapters to persist features in your own data store
13
+
14
+ ## Usage
15
+
16
+ Add the following to your `Gemfile`
17
+
18
+ ```ruby
19
+ gem 'flip_fab', git: 'git@github.com:simplybusiness/flip_fab.git'
20
+ ```
21
+
22
+ ### Rails
23
+
24
+ The helper will be included in `ActionController::Base` as a view helper method when the gem is loaded.
25
+
26
+ ### Sinatra
27
+
28
+ Add the following to `Sinatra::Base`
29
+
30
+ ```ruby
31
+ require 'flip_fab'
32
+ helpers FlipFab::Helper
33
+ ```
34
+
35
+ ## Defining a feature
36
+
37
+ For Rails, this could go in `config/initializers/flip_fab.rb`
38
+
39
+ ```ruby
40
+ FlipFab.define_feature(:name_of_feature) # default state: :disabled
41
+ FlipFab.define_feature(:name_of_other_feature, { default: :enabled }) # default state: :enabled
42
+ ```
43
+
44
+ ## Enabling/disabling a feature for a user
45
+
46
+ ### Within the context of a controller
47
+
48
+ ```ruby
49
+ features[:name_of_feature].enable # Enable the feature for the user
50
+ features[:name_of_feature].enabled? # => true
51
+ features[:name_of_feature].disable # Disable the feature for the user
52
+ features[:name_of_feature].disabled? # => true
53
+ ```
54
+
55
+ * If the feature is not defined, `features[:name_of_feature]` will raise an error
56
+ * The enabled/disabled feature will be stored in the user's cookie
57
+
58
+ ### Outside of a controller
59
+
60
+ Outside of a controller, features cannot be enabled/disabled for individual users.
61
+
62
+ ### From URL params
63
+
64
+ You can explicitely request a feature to be enabled or disabled in your session by passing the desired state of a feature in the parameters of your request:
65
+
66
+ `http://localhost:3000?name_of_feature=enabled&name_of_other_feature=disabled`
67
+
68
+ * The features' states specified in the URL will take precendence over those specified in the controller
69
+ * The enabled/disabled features will be stored in the user's cookie
70
+ * Smoke tests could enable or disable features using this mechanism
71
+
72
+ _Note: This will enable users of a production system to show/hide features in their session. While this allows automated tests to be run against staging/production environment against a particular set of features, this will allow users to 'customize' their experience, so consider what types of features a user could be switching on and off i.e. authentication, security, etc._
73
+
74
+ ## Checking if a feature is enabled
75
+
76
+ ### From within a controller or view
77
+
78
+ ```ruby
79
+ # With the feature having been enabled for the user:
80
+ features[:name_of_feature].enable # Enable the feature for the user
81
+
82
+ features[:name_of_feature].enabled? # => true
83
+ features[:name_of_feature].disabled? # => false
84
+ ```
85
+
86
+ ### Outside of a controller/view
87
+
88
+ ```ruby
89
+ # With the feature defined like this:
90
+ FlipFab.define_feature(:name_of_feature) # default state: :disabled
91
+
92
+ FlipFab.features[:name_of_feature].enabled? # => false
93
+ FlipFab.features[:name_of_feature].disabled? # => true
94
+ ```
95
+
96
+ ### Precedence of feature lookup
97
+
98
+ 1. URL parameter
99
+ 1. Code (e.g. `features[:name_of_feature].enable`)
100
+ 1. Cookie
101
+ 1. Default
102
+
103
+ ## Cookie persistence
104
+
105
+ Out of the box, the features a user receives can be persisted in their cookie. The cookie will have the following parameters:
106
+
107
+ | Parameter | Value |
108
+ | --------- | ----- |
109
+ | Name | `flip_fab.[name of feature]` |
110
+ | Value | `enabled|disabled` |
111
+ | Path | `/` |
112
+ | Expires | One year from now |
113
+ | Domain | The top-level domain |
114
+
115
+ To persist the features in a user's cookie, do any of the following operations
116
+
117
+ ```ruby
118
+ features[:name_of_feature].enable # Enable the feature for the user
119
+ features[:name_of_feature].disable # Disable the feature for the user
120
+ features[:name_of_feature].persist # Persist the feature for the user
121
+ ```
122
+
123
+ ## Defining a custom persistence adapter
124
+
125
+ 1. Create a class that extends the `FlipFab::Persistence` class
126
+
127
+ ```ruby
128
+ class ExamplePersistence < FlipFab::Persistence
129
+
130
+ def initialize feature_name, context
131
+ super
132
+ end
133
+
134
+ def read
135
+ # lookup the state of the feature
136
+ end
137
+
138
+ def write state
139
+ # write the state of the feature
140
+ end
141
+ end
142
+ ```
143
+
144
+ 1. Implement the `read` and `write` operations. The following variables will be available from `FlipFab::Persistence`
145
+ 1. `feature_name` - the name of the feature to be read/written
146
+ 1. `context` - the controller context (whatever class has included `FlipFab::Helper`)
147
+
148
+ 1. Include your persistence class when defining the feature
149
+
150
+ ```ruby
151
+ FlipFab.define_feature(:name_of_other_feature, { persistence_adapters: [ExamplePersistence] })
152
+ ```
153
+
154
+ Note that you can define multiple custom adapters that will be read in precedence of the order specified
155
+
156
+ ## Example app
157
+
158
+ There is an example app that demonstrates the use of FlipFlab in `example/rails_app`. The app has a feature called `:justin_beaver` that allows you to flip the image on the page between a beaver and a 'justin beaver'.
159
+
160
+
161
+ Perform the following to try the example:
162
+
163
+ 1. Go into the app: `cd example/rails_app`
164
+ 1. Install the gems: `bundle install`
165
+ 1. Run the migrations: `bundle exec rake db:migrate`
166
+ 1. Start rails: `bundle exec rails s`
167
+ 1. View the page with the feature disabled: `open 'http://localhost:3000/beavers?justin_beaver=disabled'`
168
+ 1. View the page with the feature enabled: `open 'http://localhost:3000/beavers?justin_beaver=enabled'`
@@ -0,0 +1,17 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and temp files.
15
+ /log/*.log
16
+ /tmp/cache
17
+ /tmp/pids/*.pid
@@ -0,0 +1,36 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.2.0'
5
+ # Use sqlite3 as the database for Active Record
6
+ gem 'sqlite3'
7
+ # Use SCSS for stylesheets
8
+ gem 'sass-rails', '~> 4.0.3'
9
+ # Use Uglifier as compressor for JavaScript assets
10
+ gem 'uglifier', '>= 1.3.0'
11
+ # Use CoffeeScript for .js.coffee assets and views
12
+ gem 'coffee-rails', '~> 4.0.0'
13
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
14
+ # gem 'therubyracer', platforms: :ruby
15
+
16
+ # Use jquery as the JavaScript library
17
+ gem 'jquery-rails'
18
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
19
+ gem 'turbolinks'
20
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
21
+ gem 'jbuilder', '~> 2.0'
22
+ # bundle exec rake doc:rails generates the API under doc/api.
23
+ gem 'sdoc', '~> 0.4.0', group: :doc
24
+
25
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
26
+ gem 'spring', group: :development
27
+
28
+ # Use unicorn as the app server
29
+ gem 'unicorn'
30
+
31
+ # Use Capistrano for deployment
32
+ # gem 'capistrano-rails', group: :development
33
+
34
+ gem 'flip_fab', path: '../../'
35
+
36
+ gem 'rspec-rails', group: :test
@@ -0,0 +1,178 @@
1
+ PATH
2
+ remote: ../../
3
+ specs:
4
+ flip_fab (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actionmailer (4.2.0)
10
+ actionpack (= 4.2.0)
11
+ actionview (= 4.2.0)
12
+ activejob (= 4.2.0)
13
+ mail (~> 2.5, >= 2.5.4)
14
+ rails-dom-testing (~> 1.0, >= 1.0.5)
15
+ actionpack (4.2.0)
16
+ actionview (= 4.2.0)
17
+ activesupport (= 4.2.0)
18
+ rack (~> 1.6.0)
19
+ rack-test (~> 0.6.2)
20
+ rails-dom-testing (~> 1.0, >= 1.0.5)
21
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
22
+ actionview (4.2.0)
23
+ activesupport (= 4.2.0)
24
+ builder (~> 3.1)
25
+ erubis (~> 2.7.0)
26
+ rails-dom-testing (~> 1.0, >= 1.0.5)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
28
+ activejob (4.2.0)
29
+ activesupport (= 4.2.0)
30
+ globalid (>= 0.3.0)
31
+ activemodel (4.2.0)
32
+ activesupport (= 4.2.0)
33
+ builder (~> 3.1)
34
+ activerecord (4.2.0)
35
+ activemodel (= 4.2.0)
36
+ activesupport (= 4.2.0)
37
+ arel (~> 6.0)
38
+ activesupport (4.2.0)
39
+ i18n (~> 0.7)
40
+ json (~> 1.7, >= 1.7.7)
41
+ minitest (~> 5.1)
42
+ thread_safe (~> 0.3, >= 0.3.4)
43
+ tzinfo (~> 1.1)
44
+ arel (6.0.0)
45
+ builder (3.2.2)
46
+ coffee-rails (4.0.1)
47
+ coffee-script (>= 2.2.0)
48
+ railties (>= 4.0.0, < 5.0)
49
+ coffee-script (2.3.0)
50
+ coffee-script-source
51
+ execjs
52
+ coffee-script-source (1.9.1)
53
+ diff-lcs (1.2.5)
54
+ erubis (2.7.0)
55
+ execjs (2.3.0)
56
+ globalid (0.3.3)
57
+ activesupport (>= 4.1.0)
58
+ hike (1.2.3)
59
+ i18n (0.7.0)
60
+ jbuilder (2.2.8)
61
+ activesupport (>= 3.0.0, < 5)
62
+ multi_json (~> 1.2)
63
+ jquery-rails (4.0.3)
64
+ rails-dom-testing (~> 1.0)
65
+ railties (>= 4.2.0)
66
+ thor (>= 0.14, < 2.0)
67
+ json (1.8.2)
68
+ kgio (2.9.3)
69
+ loofah (2.0.1)
70
+ nokogiri (>= 1.5.9)
71
+ mail (2.6.3)
72
+ mime-types (>= 1.16, < 3)
73
+ mime-types (2.4.3)
74
+ mini_portile (0.6.2)
75
+ minitest (5.5.1)
76
+ multi_json (1.10.1)
77
+ nokogiri (1.6.6.2)
78
+ mini_portile (~> 0.6.0)
79
+ rack (1.6.0)
80
+ rack-test (0.6.3)
81
+ rack (>= 1.0)
82
+ rails (4.2.0)
83
+ actionmailer (= 4.2.0)
84
+ actionpack (= 4.2.0)
85
+ actionview (= 4.2.0)
86
+ activejob (= 4.2.0)
87
+ activemodel (= 4.2.0)
88
+ activerecord (= 4.2.0)
89
+ activesupport (= 4.2.0)
90
+ bundler (>= 1.3.0, < 2.0)
91
+ railties (= 4.2.0)
92
+ sprockets-rails
93
+ rails-deprecated_sanitizer (1.0.3)
94
+ activesupport (>= 4.2.0.alpha)
95
+ rails-dom-testing (1.0.5)
96
+ activesupport (>= 4.2.0.beta, < 5.0)
97
+ nokogiri (~> 1.6.0)
98
+ rails-deprecated_sanitizer (>= 1.0.1)
99
+ rails-html-sanitizer (1.0.1)
100
+ loofah (~> 2.0)
101
+ railties (4.2.0)
102
+ actionpack (= 4.2.0)
103
+ activesupport (= 4.2.0)
104
+ rake (>= 0.8.7)
105
+ thor (>= 0.18.1, < 2.0)
106
+ raindrops (0.13.0)
107
+ rake (10.4.2)
108
+ rdoc (4.2.0)
109
+ json (~> 1.4)
110
+ rspec-core (3.2.0)
111
+ rspec-support (~> 3.2.0)
112
+ rspec-expectations (3.2.0)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.2.0)
115
+ rspec-mocks (3.2.0)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.2.0)
118
+ rspec-rails (3.2.0)
119
+ actionpack (>= 3.0, <= 4.2)
120
+ activesupport (>= 3.0, <= 4.2)
121
+ railties (>= 3.0, <= 4.2)
122
+ rspec-core (~> 3.2.0)
123
+ rspec-expectations (~> 3.2.0)
124
+ rspec-mocks (~> 3.2.0)
125
+ rspec-support (~> 3.2.0)
126
+ rspec-support (3.2.1)
127
+ sass (3.2.19)
128
+ sass-rails (4.0.5)
129
+ railties (>= 4.0.0, < 5.0)
130
+ sass (~> 3.2.2)
131
+ sprockets (~> 2.8, < 3.0)
132
+ sprockets-rails (~> 2.0)
133
+ sdoc (0.4.1)
134
+ json (~> 1.7, >= 1.7.7)
135
+ rdoc (~> 4.0)
136
+ spring (1.3.2)
137
+ sprockets (2.12.3)
138
+ hike (~> 1.2)
139
+ multi_json (~> 1.0)
140
+ rack (~> 1.0)
141
+ tilt (~> 1.1, != 1.3.0)
142
+ sprockets-rails (2.2.4)
143
+ actionpack (>= 3.0)
144
+ activesupport (>= 3.0)
145
+ sprockets (>= 2.8, < 4.0)
146
+ sqlite3 (1.3.10)
147
+ thor (0.19.1)
148
+ thread_safe (0.3.4)
149
+ tilt (1.4.1)
150
+ turbolinks (2.5.3)
151
+ coffee-rails
152
+ tzinfo (1.2.2)
153
+ thread_safe (~> 0.1)
154
+ uglifier (2.7.0)
155
+ execjs (>= 0.3.0)
156
+ json (>= 1.8.0)
157
+ unicorn (4.8.3)
158
+ kgio (~> 2.6)
159
+ rack
160
+ raindrops (~> 0.7)
161
+
162
+ PLATFORMS
163
+ ruby
164
+
165
+ DEPENDENCIES
166
+ coffee-rails (~> 4.0.0)
167
+ flip_fab!
168
+ jbuilder (~> 2.0)
169
+ jquery-rails
170
+ rails (= 4.2.0)
171
+ rspec-rails
172
+ sass-rails (~> 4.0.3)
173
+ sdoc (~> 0.4.0)
174
+ spring
175
+ sqlite3
176
+ turbolinks
177
+ uglifier (>= 1.3.0)
178
+ unicorn
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Beavers controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,69 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ p, ol, ul, td {
10
+ font-family: verdana, arial, helvetica, sans-serif;
11
+ font-size: 13px;
12
+ line-height: 18px;
13
+ }
14
+
15
+ pre {
16
+ background-color: #eee;
17
+ padding: 10px;
18
+ font-size: 11px;
19
+ }
20
+
21
+ a {
22
+ color: #000;
23
+ &:visited {
24
+ color: #666;
25
+ }
26
+ &:hover {
27
+ color: #fff;
28
+ background-color: #000;
29
+ }
30
+ }
31
+
32
+ div {
33
+ &.field, &.actions {
34
+ margin-bottom: 10px;
35
+ }
36
+ }
37
+
38
+ #notice {
39
+ color: green;
40
+ }
41
+
42
+ .field_with_errors {
43
+ padding: 2px;
44
+ background-color: red;
45
+ display: table;
46
+ }
47
+
48
+ #error_explanation {
49
+ width: 450px;
50
+ border: 2px solid red;
51
+ padding: 7px;
52
+ padding-bottom: 0;
53
+ margin-bottom: 20px;
54
+ background-color: #f0f0f0;
55
+ h2 {
56
+ text-align: left;
57
+ font-weight: bold;
58
+ padding: 5px 5px 5px 15px;
59
+ font-size: 12px;
60
+ margin: -7px;
61
+ margin-bottom: 0px;
62
+ background-color: #c00;
63
+ color: #fff;
64
+ }
65
+ ul li {
66
+ font-size: 12px;
67
+ list-style: square;
68
+ }
69
+ }