proclaim 0.5.6 → 0.6.0
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 +5 -5
- data/Rakefile +5 -38
- data/app/assets/config/proclaim_manifest.js +2 -0
- data/app/assets/images/{ajax_loader.gif → proclaim/ajax_loader.gif} +0 -0
- data/app/assets/javascripts/proclaim.js +7 -7
- data/app/assets/javascripts/proclaim/{comments_handler.js.coffee → comments_handler.coffee} +16 -10
- data/app/assets/javascripts/proclaim/editor.coffee +55 -0
- data/app/assets/stylesheets/{proclaim.css.scss → proclaim.scss} +7 -8
- data/app/assets/stylesheets/proclaim/{comments.css.scss → comments.scss} +0 -0
- data/app/assets/stylesheets/proclaim/{posts.css.scss → posts.scss} +60 -25
- data/app/assets/stylesheets/proclaim/{subscriptions.css.scss → subscriptions.scss} +0 -0
- data/app/controllers/proclaim/application_controller.rb +60 -56
- data/app/controllers/proclaim/comments_controller.rb +13 -42
- data/app/controllers/proclaim/posts_controller.rb +25 -57
- data/app/controllers/proclaim/subscriptions_controller.rb +3 -3
- data/app/jobs/proclaim/application_job.rb +4 -0
- data/app/mailers/proclaim/application_mailer.rb +5 -0
- data/app/mailers/proclaim/subscription_mailer.rb +19 -17
- data/app/models/proclaim/application_record.rb +5 -0
- data/app/models/proclaim/comment.rb +6 -1
- data/app/models/proclaim/post.rb +20 -28
- data/app/models/proclaim/subscription.rb +33 -11
- data/app/views/layouts/proclaim/subscription_mailer.html.erb +15 -36
- data/app/views/proclaim/comments/_comment.html.erb +7 -7
- data/app/views/proclaim/comments/_form.html.erb +7 -5
- data/app/views/proclaim/posts/_form.html.erb +34 -21
- data/app/views/proclaim/posts/show.html.erb +16 -3
- data/app/views/proclaim/subscription_mailer/welcome_email.html.erb +2 -6
- data/config/initializers/friendly_id.rb +20 -1
- data/config/routes.rb +1 -5
- data/db/migrate/20141108222616_create_proclaim_posts.rb +8 -1
- data/db/migrate/20141114235359_create_proclaim_comments.rb +1 -1
- data/db/migrate/20141115022230_create_proclaim_comment_hierarchies.rb +1 -1
- data/db/migrate/20141210234057_create_proclaim_subscriptions.rb +5 -4
- data/db/migrate/20150213015321_create_friendly_id_slugs.rb +1 -1
- data/lib/generators/proclaim/install_generator.rb +1 -1
- data/lib/generators/proclaim/templates/initialize_proclaim.rb +31 -29
- data/lib/generators/proclaim/views_generator.rb +1 -1
- data/lib/proclaim.rb +15 -15
- data/lib/proclaim/engine.rb +21 -19
- data/lib/proclaim/version.rb +1 -1
- data/vendor/assets/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Bold.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Italic.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Math-Italic.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Script-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/vendor/assets/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/vendor/assets/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/vendor/assets/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/vendor/assets/javascripts/contrib/auto-render.js +339 -0
- data/vendor/assets/javascripts/contrib/auto-render.min.js +1 -0
- data/vendor/assets/javascripts/contrib/auto-render.mjs +215 -0
- data/vendor/assets/javascripts/contrib/copy-tex.css +14 -0
- data/vendor/assets/javascripts/contrib/copy-tex.js +213 -0
- data/vendor/assets/javascripts/contrib/copy-tex.min.css +1 -0
- data/vendor/assets/javascripts/contrib/copy-tex.min.js +1 -0
- data/vendor/assets/javascripts/contrib/copy-tex.mjs +85 -0
- data/vendor/assets/javascripts/contrib/mathtex-script-type.js +137 -0
- data/vendor/assets/javascripts/contrib/mathtex-script-type.min.js +1 -0
- data/vendor/assets/javascripts/contrib/mathtex-script-type.mjs +24 -0
- data/vendor/assets/javascripts/contrib/mhchem.js +3241 -0
- data/vendor/assets/javascripts/contrib/mhchem.min.js +1 -0
- data/vendor/assets/javascripts/contrib/mhchem.mjs +3109 -0
- data/vendor/assets/javascripts/katex.js +16517 -0
- data/vendor/assets/javascripts/katex.min.js +1 -0
- data/vendor/assets/javascripts/katex.mjs +16122 -0
- data/vendor/assets/javascripts/quill.core.js +8522 -0
- data/vendor/assets/javascripts/quill.js +11489 -0
- data/vendor/assets/javascripts/quill.min.js +8 -0
- data/vendor/assets/javascripts/quill.min.js.map +1 -0
- data/vendor/assets/stylesheets/katex.css +1011 -0
- data/vendor/assets/stylesheets/katex.min.css +1 -0
- data/vendor/assets/stylesheets/quill.bubble.css +952 -0
- data/vendor/assets/stylesheets/quill.core.css +397 -0
- data/vendor/assets/stylesheets/quill.snow.css +945 -0
- metadata +169 -278
- data/CHANGELOG +0 -77
- data/Gemfile +0 -14
- data/VERSION +0 -1
- data/app/assets/javascripts/proclaim/editor.js.coffee +0 -52
- data/app/assets/javascripts/proclaim/images.js.coffee +0 -3
- data/app/assets/javascripts/proclaim/subscriptions.js.coffee +0 -3
- data/app/assets/stylesheets/proclaim/images.scss +0 -3
- data/app/controllers/proclaim/images_controller.rb +0 -67
- data/app/helpers/proclaim/comments_helper.rb +0 -4
- data/app/helpers/proclaim/images_helper.rb +0 -4
- data/app/helpers/proclaim/subscriptions_helper.rb +0 -4
- data/app/models/proclaim/image.rb +0 -19
- data/app/policies/proclaim/image_policy.rb +0 -29
- data/app/uploaders/proclaim/image_uploader.rb +0 -82
- data/db/migrate/20141222224905_create_proclaim_images.rb +0 -12
- data/db/migrate/20150123115226_add_name_to_subscriptions.rb +0 -7
- data/db/migrate/20150213015850_add_slug_to_posts.rb +0 -20
- data/proclaim.gemspec +0 -51
- data/test/controllers/proclaim/comments_controller_test.rb +0 -228
- data/test/controllers/proclaim/images_controller_test.rb +0 -166
- data/test/controllers/proclaim/posts_controller_test.rb +0 -465
- data/test/controllers/proclaim/subscriptions_controller_test.rb +0 -154
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/javascripts/application.js +0 -14
- data/test/dummy/app/assets/stylesheets/application.css +0 -16
- data/test/dummy/app/controllers/application_controller.rb +0 -15
- data/test/dummy/app/helpers/application_helper.rb +0 -28
- data/test/dummy/app/models/user.rb +0 -7
- data/test/dummy/app/views/layouts/application.html.erb +0 -16
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -24
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -45
- data/test/dummy/config/environments/production.rb +0 -80
- data/test/dummy/config/environments/test.rb +0 -49
- data/test/dummy/config/initializers/assets.rb +0 -8
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -5
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/db/migrate/20141117214323_create_users.rb +0 -10
- data/test/dummy/db/schema.rb +0 -91
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/factories/proclaim/comment.rb +0 -11
- data/test/factories/proclaim/image.rb +0 -6
- data/test/factories/proclaim/post.rb +0 -14
- data/test/factories/proclaim/subscription.rb +0 -14
- data/test/factories/user.rb +0 -6
- data/test/helpers/proclaim/comments_helper_test.rb +0 -6
- data/test/helpers/proclaim/posts_helper_test.rb +0 -6
- data/test/helpers/proclaim/subscriptions_helper_test.rb +0 -6
- data/test/integration/with_javascript/comment_test.rb +0 -391
- data/test/integration/with_javascript/post_form_test.rb +0 -225
- data/test/integration/with_javascript/post_show_test.rb +0 -47
- data/test/integration/with_javascript/post_subscription_test.rb +0 -302
- data/test/integration/without_javascript/blog_subscription_test.rb +0 -114
- data/test/integration/without_javascript/manage_subscriptions_test.rb +0 -37
- data/test/integration/without_javascript/post_test.rb +0 -234
- data/test/integration/without_javascript/subscription_email_test.rb +0 -95
- data/test/integration/without_javascript/unsubscribe_test.rb +0 -32
- data/test/mailers/previews/proclaim/subscription_mailer_preview.rb +0 -22
- data/test/mailers/proclaim/subscription_mailer_test.rb +0 -91
- data/test/models/proclaim/comment_test.rb +0 -41
- data/test/models/proclaim/image_test.rb +0 -70
- data/test/models/proclaim/post_test.rb +0 -193
- data/test/models/proclaim/subscription_test.rb +0 -77
- data/test/policies/application_policy_test.rb +0 -87
- data/test/policies/proclaim/comment_policy_test.rb +0 -71
- data/test/policies/proclaim/image_policy_test.rb +0 -83
- data/test/policies/proclaim/post_policy_test.rb +0 -98
- data/test/policies/proclaim/subscription_policy_test.rb +0 -103
- data/test/proclaim_test.rb +0 -7
- data/test/support/images/test.jpg +0 -0
- data/test/support/pages/posts/edit_page.rb +0 -5
- data/test/support/pages/posts/show_page.rb +0 -47
- data/test/support/wait_for_ajax.rb +0 -11
- data/test/test_helper.rb +0 -71
- data/test/unit/proclaim/new_comment_callback_test.rb +0 -62
- data/test/unit/proclaim/new_subscription_callback_test.rb +0 -62
- data/test/unit/proclaim/post_published_callback_test.rb +0 -74
- data/vendor/assets/images/link.png +0 -0
- data/vendor/assets/images/remove.png +0 -0
- data/vendor/assets/images/resize-bigger.png +0 -0
- data/vendor/assets/images/resize-smaller.png +0 -0
- data/vendor/assets/images/unlink.png +0 -0
- data/vendor/assets/javascripts/addons/medium-editor-insert-embeds.js +0 -197
- data/vendor/assets/javascripts/addons/medium-editor-insert-images.js +0 -572
- data/vendor/assets/javascripts/addons/medium-editor-insert-maps.js +0 -50
- data/vendor/assets/javascripts/addons/medium-editor-insert-plugin.js +0 -496
- data/vendor/assets/javascripts/addons/medium-editor-insert-tables.js +0 -132
- data/vendor/assets/javascripts/medium-editor-insert-plugin.all.js +0 -1415
- data/vendor/assets/stylesheets/medium-editor-insert-plugin-frontend.css.scss +0 -55
- data/vendor/assets/stylesheets/medium-editor-insert-plugin.css.scss +0 -277
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
module Proclaim
|
|
4
|
-
class SubscriptionsControllerTest < ActionController::TestCase
|
|
5
|
-
setup do
|
|
6
|
-
@routes = Engine.routes
|
|
7
|
-
|
|
8
|
-
@controller.stubs(:current_user).returns(nil)
|
|
9
|
-
@controller.stubs(:authenticate_user).returns(false)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
test "should get index if logged in" do
|
|
13
|
-
user = FactoryGirl.create(:user)
|
|
14
|
-
sign_in user
|
|
15
|
-
|
|
16
|
-
subscription1 = FactoryGirl.create(:subscription)
|
|
17
|
-
subscription2 = FactoryGirl.create(:subscription)
|
|
18
|
-
|
|
19
|
-
get :index
|
|
20
|
-
assert_response :success
|
|
21
|
-
assert_not_nil assigns(:subscriptions)
|
|
22
|
-
assert_includes assigns(:subscriptions), subscription1
|
|
23
|
-
assert_includes assigns(:subscriptions), subscription2
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
test "should not get index if not logged in" do
|
|
27
|
-
get :index
|
|
28
|
-
assert_response :redirect
|
|
29
|
-
assert_match /not authorized/, flash[:error]
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
test "should get show if logged in" do
|
|
33
|
-
user = FactoryGirl.create(:user)
|
|
34
|
-
sign_in user
|
|
35
|
-
|
|
36
|
-
subscription = FactoryGirl.create(:subscription)
|
|
37
|
-
|
|
38
|
-
get :show, token: subscription.token
|
|
39
|
-
assert_response :success
|
|
40
|
-
assert_equal subscription, assigns(:subscription)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
test "should get show if not logged in" do
|
|
44
|
-
subscription = FactoryGirl.create(:subscription)
|
|
45
|
-
|
|
46
|
-
get :show, token: subscription.token
|
|
47
|
-
assert_response :success
|
|
48
|
-
assert_equal subscription, assigns(:subscription)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
test "show should return not found is token is invalid" do
|
|
52
|
-
assert_raises ActiveRecord::RecordNotFound do
|
|
53
|
-
get :show, token: 12345
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
test "should get new if logged in" do
|
|
58
|
-
user = FactoryGirl.create(:user)
|
|
59
|
-
sign_in user
|
|
60
|
-
|
|
61
|
-
get :new
|
|
62
|
-
assert_response :success
|
|
63
|
-
assert_not_nil assigns(:subscription)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
test "should get new if not logged in" do
|
|
67
|
-
get :new
|
|
68
|
-
assert_response :success
|
|
69
|
-
assert_not_nil assigns(:subscription)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
test "should create subscription if logged in" do
|
|
73
|
-
user = FactoryGirl.create(:user)
|
|
74
|
-
sign_in user
|
|
75
|
-
|
|
76
|
-
newSubscription = FactoryGirl.build(:subscription)
|
|
77
|
-
|
|
78
|
-
assert_difference('Subscription.count') do
|
|
79
|
-
post :create,
|
|
80
|
-
subscription: {
|
|
81
|
-
name: newSubscription.name,
|
|
82
|
-
email: newSubscription.email
|
|
83
|
-
},
|
|
84
|
-
antispam: {
|
|
85
|
-
solution: 5,
|
|
86
|
-
answer: 5
|
|
87
|
-
}
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
assert_redirected_to subscription_path(assigns(:subscription).token)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
test "should create subscription if not logged in" do
|
|
94
|
-
newSubscription = FactoryGirl.build(:subscription)
|
|
95
|
-
|
|
96
|
-
assert_difference('Subscription.count') do
|
|
97
|
-
post :create,
|
|
98
|
-
subscription: {
|
|
99
|
-
name: newSubscription.name,
|
|
100
|
-
email: newSubscription.email
|
|
101
|
-
},
|
|
102
|
-
antispam: {
|
|
103
|
-
solution: 3,
|
|
104
|
-
answer: 3
|
|
105
|
-
}
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
assert_redirected_to subscription_path(assigns(:subscription).token)
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
test "should not create subscription if spammy" do
|
|
112
|
-
newSubscription = FactoryGirl.build(:subscription)
|
|
113
|
-
|
|
114
|
-
assert_no_difference('Subscription.count') do
|
|
115
|
-
post :create,
|
|
116
|
-
subscription: {
|
|
117
|
-
name: newSubscription.name,
|
|
118
|
-
email: newSubscription.email
|
|
119
|
-
},
|
|
120
|
-
antispam: {
|
|
121
|
-
solution: 5,
|
|
122
|
-
answer: 3
|
|
123
|
-
}
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
test "should delete subscription if logged in" do
|
|
128
|
-
user = FactoryGirl.create(:user)
|
|
129
|
-
sign_in user
|
|
130
|
-
|
|
131
|
-
subscription = FactoryGirl.create(:subscription)
|
|
132
|
-
|
|
133
|
-
assert_difference('Subscription.count', -1) do
|
|
134
|
-
delete :destroy, token: subscription.token
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
# If a user is logged in, deletion should take them back to the
|
|
138
|
-
# subscriptions index
|
|
139
|
-
assert_redirected_to subscriptions_path
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
test "should delete subscription if not logged in" do
|
|
143
|
-
subscription = FactoryGirl.create(:subscription)
|
|
144
|
-
|
|
145
|
-
assert_difference('Subscription.count', -1) do
|
|
146
|
-
delete :destroy, token: subscription.token
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# If no user is logged in, deletion should take them back to the
|
|
150
|
-
# posts index
|
|
151
|
-
assert_redirected_to posts_path
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
end
|
data/test/dummy/README.rdoc
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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>.
|
data/test/dummy/Rakefile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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 proclaim
|
|
14
|
-
//= require_tree .
|
|
@@ -1,16 +0,0 @@
|
|
|
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 proclaim
|
|
14
|
-
*= require_tree .
|
|
15
|
-
*= require_self
|
|
16
|
-
*/
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
class ApplicationController < ActionController::Base
|
|
2
|
-
# Prevent CSRF attacks by raising an exception.
|
|
3
|
-
# For APIs, you may want to use :null_session instead.
|
|
4
|
-
protect_from_forgery with: :exception
|
|
5
|
-
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
def current_user
|
|
9
|
-
nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def authenticate_user!
|
|
13
|
-
false
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module ApplicationHelper
|
|
2
|
-
def bootstrapClassFor(flashType)
|
|
3
|
-
case flashType.to_sym
|
|
4
|
-
when :success
|
|
5
|
-
return "alert-success"
|
|
6
|
-
when :error
|
|
7
|
-
return "alert-danger"
|
|
8
|
-
when :alert
|
|
9
|
-
return "alert-warning"
|
|
10
|
-
when :notice
|
|
11
|
-
return "alert-info"
|
|
12
|
-
else
|
|
13
|
-
return flashType.to_s
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def flashMessages(opts = {})
|
|
18
|
-
flash.each do |messageType, message|
|
|
19
|
-
concat(content_tag(:div,
|
|
20
|
-
message,
|
|
21
|
-
class: "alert #{bootstrapClassFor(messageType)} fade in") do
|
|
22
|
-
concat message
|
|
23
|
-
end)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
return nil
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Dummy</title>
|
|
5
|
-
<%= stylesheet_link_tag 'application', media: 'all' %>
|
|
6
|
-
<%= javascript_include_tag 'application' %>
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
|
|
11
|
-
<%= flashMessages %>
|
|
12
|
-
|
|
13
|
-
<%= yield %>
|
|
14
|
-
|
|
15
|
-
</body>
|
|
16
|
-
</html>
|
data/test/dummy/bin/bundle
DELETED
data/test/dummy/bin/rails
DELETED
data/test/dummy/bin/rake
DELETED
data/test/dummy/config.ru
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
|
2
|
-
|
|
3
|
-
require 'rails/all'
|
|
4
|
-
|
|
5
|
-
Bundler.require(*Rails.groups)
|
|
6
|
-
require "proclaim"
|
|
7
|
-
|
|
8
|
-
module Dummy
|
|
9
|
-
class Application < Rails::Application
|
|
10
|
-
# Settings in config/environments/* take precedence over those specified here.
|
|
11
|
-
# Application configuration should go into files in config/initializers
|
|
12
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
13
|
-
|
|
14
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
15
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
16
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
|
17
|
-
|
|
18
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
19
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
20
|
-
# config.i18n.default_locale = :de
|
|
21
|
-
|
|
22
|
-
config.action_mailer.preview_path = "#{Rails.root}/../mailers/previews"
|
|
23
|
-
end
|
|
24
|
-
end
|
data/test/dummy/config/boot.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SQLite version 3.x
|
|
2
|
-
# gem install sqlite3
|
|
3
|
-
#
|
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
-
# gem 'sqlite3'
|
|
6
|
-
#
|
|
7
|
-
default: &default
|
|
8
|
-
adapter: sqlite3
|
|
9
|
-
pool: 5
|
|
10
|
-
timeout: 5000
|
|
11
|
-
|
|
12
|
-
development:
|
|
13
|
-
<<: *default
|
|
14
|
-
database: db/development.sqlite3
|
|
15
|
-
|
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
|
17
|
-
# re-generated from your development database when you run "rake".
|
|
18
|
-
# Do not set this db to the same as development or production.
|
|
19
|
-
test:
|
|
20
|
-
<<: *default
|
|
21
|
-
database: db/test.sqlite3
|
|
22
|
-
|
|
23
|
-
production:
|
|
24
|
-
<<: *default
|
|
25
|
-
database: db/production.sqlite3
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Rails.application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
|
-
|
|
4
|
-
# In the development environment your application's code is reloaded on
|
|
5
|
-
# every request. This slows down response time but is perfect for development
|
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
8
|
-
|
|
9
|
-
# Do not eager load code on boot.
|
|
10
|
-
config.eager_load = false
|
|
11
|
-
|
|
12
|
-
# Show full error reports and disable caching.
|
|
13
|
-
config.consider_all_requests_local = true
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
15
|
-
|
|
16
|
-
# Don't care if the mailer can't send.
|
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
|
18
|
-
|
|
19
|
-
# Print deprecation notices to the Rails logger.
|
|
20
|
-
config.active_support.deprecation = :log
|
|
21
|
-
|
|
22
|
-
# Raise an error on page load if there are pending migrations.
|
|
23
|
-
config.active_record.migration_error = :page_load
|
|
24
|
-
|
|
25
|
-
config.active_record.raise_in_transactional_callbacks = true
|
|
26
|
-
|
|
27
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
|
28
|
-
# This option may cause significant delays in view rendering with a large
|
|
29
|
-
# number of complex assets.
|
|
30
|
-
config.assets.debug = true
|
|
31
|
-
|
|
32
|
-
# Adds additional error checking when serving assets at runtime.
|
|
33
|
-
# Checks for improperly declared sprockets dependencies.
|
|
34
|
-
# Raises helpful error messages.
|
|
35
|
-
config.assets.raise_runtime_errors = true
|
|
36
|
-
|
|
37
|
-
# Raises error for missing translations
|
|
38
|
-
# config.action_view.raise_on_missing_translations = true
|
|
39
|
-
|
|
40
|
-
# Set the default URL for named route helpers
|
|
41
|
-
routes.default_url_options = { host: 'localhost', port: 3000 }
|
|
42
|
-
|
|
43
|
-
# Set the default URL so mailers can contain URLs
|
|
44
|
-
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
|
45
|
-
end
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Rails.application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
|
-
|
|
4
|
-
# Code is not reloaded between requests.
|
|
5
|
-
config.cache_classes = true
|
|
6
|
-
|
|
7
|
-
# Eager load code on boot. This eager loads most of Rails and
|
|
8
|
-
# your application in memory, allowing both threaded web servers
|
|
9
|
-
# and those relying on copy on write to perform better.
|
|
10
|
-
# Rake tasks automatically ignore this option for performance.
|
|
11
|
-
config.eager_load = true
|
|
12
|
-
|
|
13
|
-
# Full error reports are disabled and caching is turned on.
|
|
14
|
-
config.consider_all_requests_local = false
|
|
15
|
-
config.action_controller.perform_caching = true
|
|
16
|
-
|
|
17
|
-
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
|
18
|
-
# Add `rack-cache` to your Gemfile before enabling this.
|
|
19
|
-
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
|
20
|
-
# config.action_dispatch.rack_cache = true
|
|
21
|
-
|
|
22
|
-
# Disable Rails's static asset server (Apache or nginx will already do this).
|
|
23
|
-
config.serve_static_files = false
|
|
24
|
-
|
|
25
|
-
# Compress JavaScripts and CSS.
|
|
26
|
-
config.assets.js_compressor = :uglifier
|
|
27
|
-
# config.assets.css_compressor = :sass
|
|
28
|
-
|
|
29
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
30
|
-
config.assets.compile = false
|
|
31
|
-
|
|
32
|
-
# Generate digests for assets URLs.
|
|
33
|
-
config.assets.digest = true
|
|
34
|
-
|
|
35
|
-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
36
|
-
|
|
37
|
-
# Specifies the header that your server uses for sending files.
|
|
38
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
39
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
40
|
-
|
|
41
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
42
|
-
# config.force_ssl = true
|
|
43
|
-
|
|
44
|
-
# Set to :debug to see everything in the log.
|
|
45
|
-
config.log_level = :info
|
|
46
|
-
|
|
47
|
-
# Prepend all log lines with the following tags.
|
|
48
|
-
# config.log_tags = [ :subdomain, :uuid ]
|
|
49
|
-
|
|
50
|
-
# Use a different logger for distributed setups.
|
|
51
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
52
|
-
|
|
53
|
-
# Use a different cache store in production.
|
|
54
|
-
# config.cache_store = :mem_cache_store
|
|
55
|
-
|
|
56
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
57
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
|
58
|
-
|
|
59
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
|
60
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
61
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
62
|
-
|
|
63
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
64
|
-
# the I18n.default_locale when a translation cannot be found).
|
|
65
|
-
config.i18n.fallbacks = true
|
|
66
|
-
|
|
67
|
-
# Send deprecation notices to registered listeners.
|
|
68
|
-
config.active_support.deprecation = :notify
|
|
69
|
-
|
|
70
|
-
# Disable automatic flushing of the log to improve performance.
|
|
71
|
-
# config.autoflush_log = false
|
|
72
|
-
|
|
73
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
74
|
-
config.log_formatter = ::Logger::Formatter.new
|
|
75
|
-
|
|
76
|
-
# Do not dump schema after migrations.
|
|
77
|
-
config.active_record.dump_schema_after_migration = false
|
|
78
|
-
|
|
79
|
-
config.active_record.raise_in_transactional_callbacks = true
|
|
80
|
-
end
|