disclaimer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +60 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/disclaimer/application.js +16 -0
  5. data/app/assets/javascripts/disclaimer/documents.js +2 -0
  6. data/app/assets/javascripts/disclaimer/segments.js +2 -0
  7. data/app/assets/stylesheets/disclaimer/application.css +13 -0
  8. data/app/assets/stylesheets/disclaimer/documents.css +9 -0
  9. data/app/assets/stylesheets/disclaimer/segments.css +4 -0
  10. data/app/controllers/disclaimer/application_controller.rb +4 -0
  11. data/app/controllers/disclaimer/documents_controller.rb +74 -0
  12. data/app/controllers/disclaimer/segments_controller.rb +45 -0
  13. data/app/helpers/disclaimer/application_helper.rb +4 -0
  14. data/app/helpers/disclaimer/documents_helper.rb +4 -0
  15. data/app/helpers/disclaimer/segments_helper.rb +4 -0
  16. data/app/models/disclaimer/document.rb +57 -0
  17. data/app/models/disclaimer/segment.rb +26 -0
  18. data/app/models/disclaimer/segment_holder.rb +17 -0
  19. data/app/views/disclaimer/documents/delete.html.erb +8 -0
  20. data/app/views/disclaimer/documents/index.html.erb +28 -0
  21. data/app/views/disclaimer/documents/new.html.erb +48 -0
  22. data/app/views/disclaimer/documents/show.html.erb +19 -0
  23. data/app/views/disclaimer/segments/_segment.html.erb +8 -0
  24. data/app/views/disclaimer/segments/delete.html.erb +8 -0
  25. data/app/views/disclaimer/segments/index.html.erb +26 -0
  26. data/app/views/disclaimer/segments/new.html.erb +24 -0
  27. data/app/views/disclaimer/segments/show.html.erb +2 -0
  28. data/app/views/layouts/disclaimer/application.html.erb +15 -0
  29. data/config/routes.rb +18 -0
  30. data/db/migrate/20121023125748_create_disclaimer_documents.rb +12 -0
  31. data/db/migrate/20121024074240_create_segments.rb +10 -0
  32. data/db/migrate/20121024080818_create_disclaimer_segment_holders.rb +11 -0
  33. data/lib/disclaimer/engine.rb +5 -0
  34. data/lib/disclaimer/version.rb +3 -0
  35. data/lib/disclaimer.rb +6 -0
  36. data/lib/rails/actionpack/lib/action_controller/base.rb +28 -0
  37. data/lib/tasks/disclaimer_tasks.rake +4 -0
  38. data/test/disclaimer_test.rb +7 -0
  39. data/test/dummy/README.rdoc +261 -0
  40. data/test/dummy/Rakefile +7 -0
  41. data/test/dummy/app/assets/javascripts/application.js +15 -0
  42. data/test/dummy/app/assets/javascripts/sample.js +2 -0
  43. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  44. data/test/dummy/app/assets/stylesheets/sample.css +4 -0
  45. data/test/dummy/app/controllers/application_controller.rb +3 -0
  46. data/test/dummy/app/controllers/sample_controller.rb +12 -0
  47. data/test/dummy/app/helpers/application_helper.rb +2 -0
  48. data/test/dummy/app/helpers/sample_helper.rb +2 -0
  49. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  50. data/test/dummy/app/views/sample/index.html.erb +4 -0
  51. data/test/dummy/config/application.rb +59 -0
  52. data/test/dummy/config/boot.rb +10 -0
  53. data/test/dummy/config/database.yml +25 -0
  54. data/test/dummy/config/environment.rb +5 -0
  55. data/test/dummy/config/environments/development.rb +37 -0
  56. data/test/dummy/config/environments/production.rb +67 -0
  57. data/test/dummy/config/environments/test.rb +37 -0
  58. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  59. data/test/dummy/config/initializers/inflections.rb +15 -0
  60. data/test/dummy/config/initializers/mime_types.rb +5 -0
  61. data/test/dummy/config/initializers/secret_token.rb +7 -0
  62. data/test/dummy/config/initializers/session_store.rb +8 -0
  63. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  64. data/test/dummy/config/locales/en.yml +5 -0
  65. data/test/dummy/config/routes.rb +10 -0
  66. data/test/dummy/config.ru +4 -0
  67. data/test/dummy/db/development.sqlite3 +0 -0
  68. data/test/dummy/db/schema.rb +41 -0
  69. data/test/dummy/db/test.sqlite3 +0 -0
  70. data/test/dummy/log/development.log +13228 -0
  71. data/test/dummy/log/test.log +35207 -0
  72. data/test/dummy/public/404.html +26 -0
  73. data/test/dummy/public/422.html +26 -0
  74. data/test/dummy/public/500.html +25 -0
  75. data/test/dummy/public/favicon.ico +0 -0
  76. data/test/dummy/script/rails +6 -0
  77. data/test/dummy/test/functional/sample_controller_test.rb +29 -0
  78. data/test/dummy/test/unit/helpers/sample_helper_test.rb +4 -0
  79. data/test/dummy/tmp/cache/assets/B9D/BB0/sprockets%2Fc3340956015865527b738281d0798842 +0 -0
  80. data/test/dummy/tmp/cache/assets/C5A/090/sprockets%2F163158930fc7f594992ed570eb262440 +0 -0
  81. data/test/dummy/tmp/cache/assets/C65/6C0/sprockets%2F6411c0191302133114dd7b9452abec58 +0 -0
  82. data/test/dummy/tmp/cache/assets/C83/2C0/sprockets%2F99d131cd7946c82b8a39070e6b434530 +0 -0
  83. data/test/dummy/tmp/cache/assets/CD4/F20/sprockets%2F9705276958dc30aad02ae1f4618a60a4 +0 -0
  84. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  85. data/test/dummy/tmp/cache/assets/CE3/0F0/sprockets%2F1c1d13e6a59e0476d7663354de087ff0 +0 -0
  86. data/test/dummy/tmp/cache/assets/D05/D80/sprockets%2F0f27d3a1d395bf559a2d725033de721c +0 -0
  87. data/test/dummy/tmp/cache/assets/D14/8E0/sprockets%2F1d0962a03dd3d782c8eadf712769a972 +0 -0
  88. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  89. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  90. data/test/dummy/tmp/cache/assets/D51/800/sprockets%2F0b6c1b1792d877f8e8fb3d82d577ca92 +0 -0
  91. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  92. data/test/dummy/tmp/cache/assets/D69/ED0/sprockets%2F5e34b8807c9168eb298bc1eb4d01bc1b +0 -0
  93. data/test/dummy/tmp/cache/assets/D6A/080/sprockets%2Fb083da81ad739ec14c03d78b63c22d9f +0 -0
  94. data/test/dummy/tmp/cache/assets/D73/200/sprockets%2Ff550d44b0e67ff62964de563da84c2ab +0 -0
  95. data/test/dummy/tmp/cache/assets/D9D/D20/sprockets%2F17bfe7df9a25cca0b3e5604f442be847 +0 -0
  96. data/test/dummy/tmp/cache/assets/DA6/F40/sprockets%2F55aedaf8fe75d461c2c82239e7e1d0b9 +0 -0
  97. data/test/dummy/tmp/cache/assets/DB4/B10/sprockets%2F1419cefd434468f9dfea571aa7ee59f7 +0 -0
  98. data/test/dummy/tmp/cache/assets/DC6/910/sprockets%2Faad8dad748c771644d1bbbcf02409fe2 +0 -0
  99. data/test/dummy/tmp/cache/assets/DCD/6D0/sprockets%2Fe8e47b38d458acad468a0b2bdcd12e76 +0 -0
  100. data/test/dummy/tmp/cache/assets/DD1/600/sprockets%2Fd61c971a175fe64d20ceefe3e7f4e2b3 +0 -0
  101. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  102. data/test/dummy/tmp/cache/assets/DDD/C60/sprockets%2F59ec92d2bcdf9ece368f07a4ca6509c7 +0 -0
  103. data/test/dummy/tmp/cache/assets/DE1/2B0/sprockets%2Fdca152daab7ddab59235356c1d2b21db +0 -0
  104. data/test/dummy/tmp/cache/assets/DFB/DF0/sprockets%2Fa1fb1cc09fd766dcc9e2b9d4a9421db4 +0 -0
  105. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  106. data/test/dummy/tmp/cache/assets/E22/0C0/sprockets%2F72c5c1adba8375dda425a7bfb5ba7c4f +0 -0
  107. data/test/dummy/tmp/cache/assets/E27/370/sprockets%2Ff374d3bfba2ca636ce768ab8eecb31b3 +0 -0
  108. data/test/dummy/tmp/cache/assets/E2C/8D0/sprockets%2F234ff42c359a2beddfb9d10ee75aef3d +0 -0
  109. data/test/dummy/tmp/pids/server.pid +1 -0
  110. data/test/fixtures/disclaimer/documents.yml +9 -0
  111. data/test/fixtures/disclaimer/segment_holders.yml +9 -0
  112. data/test/fixtures/disclaimer/segments.yml +13 -0
  113. data/test/functional/disclaimer/documents_controller_test.rb +129 -0
  114. data/test/functional/disclaimer/segments_controller_test.rb +77 -0
  115. data/test/integration/navigation_test.rb +10 -0
  116. data/test/test_helper.rb +35 -0
  117. data/test/unit/disclaimer/document_test.rb +36 -0
  118. data/test/unit/disclaimer/segment_holder_test.rb +9 -0
  119. data/test/unit/disclaimer/segment_test.rb +59 -0
  120. data/test/unit/helpers/disclaimer/documents_helper_test.rb +6 -0
  121. data/test/unit/helpers/disclaimer/segments_helper_test.rb +6 -0
  122. metadata +330 -0
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -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
+ Dummy::Application.config.secret_token = 'a01704ebd208fa23170a946112a87412d55af166580aba5600f760c2bc5a13d0acc89d345923c885a584610984a94df2926401c9ec071812606ed21252e0287d'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_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
+ # Dummy::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,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,10 @@
1
+ Rails.application.routes.draw do
2
+
3
+ resources :sample, :only => [:index] do
4
+ collection do
5
+ get :bypass_disclaimer
6
+ end
7
+ end
8
+
9
+ mount Disclaimer::Engine => "/disclaimer"
10
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
Binary file
@@ -0,0 +1,41 @@
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 => 20121024080818) do
15
+
16
+ create_table "disclaimer_documents", :force => true do |t|
17
+ t.string "title"
18
+ t.string "name"
19
+ t.text "header"
20
+ t.text "footer"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ create_table "disclaimer_segment_holders", :force => true do |t|
26
+ t.integer "document_id"
27
+ t.integer "segment_id"
28
+ t.integer "position"
29
+ t.datetime "created_at", :null => false
30
+ t.datetime "updated_at", :null => false
31
+ end
32
+
33
+ create_table "disclaimer_segments", :force => true do |t|
34
+ t.string "name"
35
+ t.string "title"
36
+ t.text "body"
37
+ t.datetime "created_at", :null => false
38
+ t.datetime "updated_at", :null => false
39
+ end
40
+
41
+ end
Binary file