paid_up 0.11.7 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +17 -13
  3. data/.rubocop_todo.yml +7 -0
  4. data/.travis.yml +4 -3
  5. data/Gemfile +29 -24
  6. data/README.md +22 -1
  7. data/Rakefile +6 -5
  8. data/VERSION +1 -1
  9. data/app/controllers/paid_up/paid_up_controller.rb +16 -9
  10. data/app/controllers/paid_up/plans_controller.rb +2 -0
  11. data/app/controllers/paid_up/subscriptions_controller.rb +58 -49
  12. data/app/helpers/paid_up/features_helper.rb +35 -34
  13. data/app/helpers/paid_up/paid_up_helper.rb +10 -8
  14. data/app/helpers/paid_up/plans_helper.rb +75 -55
  15. data/app/helpers/paid_up/subscriptions_helper.rb +17 -13
  16. data/app/models/paid_up/ability.rb +53 -46
  17. data/app/models/paid_up/plan.rb +36 -34
  18. data/app/models/paid_up/plan_feature_setting.rb +2 -0
  19. data/app/models/paid_up/unlimited.rb +2 -0
  20. data/app/views/paid_up/features/_abilities_table.html.haml +1 -45
  21. data/app/views/paid_up/features/_boolean_state.html.haml +6 -0
  22. data/app/views/paid_up/features/_setting_state.html.haml +13 -0
  23. data/app/views/paid_up/subscriptions/index.html.haml +2 -2
  24. data/config/initializers/stripe.rb +2 -0
  25. data/config/locales/en.yml +4 -1
  26. data/config/routes.rb +3 -1
  27. data/lib/generators/paid_up/install/install_generator.rb +4 -1
  28. data/lib/generators/paid_up/install/templates/ability.rb +2 -0
  29. data/lib/generators/paid_up/install/templates/initializer.rb +2 -0
  30. data/lib/generators/paid_up/utils.rb +2 -0
  31. data/lib/paid_up/configuration.rb +4 -2
  32. data/lib/paid_up/engine.rb +2 -0
  33. data/lib/paid_up/extensions/integer.rb +2 -0
  34. data/lib/paid_up/extensions/stripe.rb +2 -0
  35. data/lib/paid_up/feature.rb +10 -7
  36. data/lib/paid_up/feature_setting_type.rb +45 -0
  37. data/lib/paid_up/feature_setting_types/rolify.rb +10 -0
  38. data/lib/paid_up/feature_setting_types/table.rb +7 -0
  39. data/lib/paid_up/localization.rb +2 -0
  40. data/lib/paid_up/mixins/paid_for.rb +59 -47
  41. data/lib/paid_up/mixins/subscriber.rb +45 -101
  42. data/lib/paid_up/railtie.rb +2 -0
  43. data/lib/paid_up/ruby_version_check.rb +15 -0
  44. data/lib/paid_up/subscription.rb +80 -0
  45. data/lib/paid_up/validators/rolify_rows.rb +11 -6
  46. data/lib/paid_up/validators/table_rows.rb +9 -6
  47. data/lib/paid_up/version.rb +2 -0
  48. data/lib/paid_up.rb +8 -0
  49. data/paid_up.gemspec +108 -115
  50. data/spec/controllers/paid_up/plans_spec.rb +2 -0
  51. data/spec/controllers/paid_up/subscriptions_spec.rb +18 -11
  52. data/spec/dummy/Rakefile +2 -0
  53. data/spec/dummy/app/assets/stylesheets/application.css.scss +6 -0
  54. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  55. data/spec/dummy/app/models/ability.rb +2 -0
  56. data/spec/dummy/app/models/doodad.rb +2 -0
  57. data/spec/dummy/app/models/group.rb +2 -0
  58. data/spec/dummy/app/models/post.rb +2 -0
  59. data/spec/dummy/app/models/role.rb +2 -0
  60. data/spec/dummy/app/models/user.rb +2 -0
  61. data/spec/dummy/app/views/layouts/application.html.haml +13 -11
  62. data/spec/dummy/bin/bundle +2 -0
  63. data/spec/dummy/bin/rails +2 -0
  64. data/spec/dummy/bin/rake +2 -0
  65. data/spec/dummy/bin/setup +10 -8
  66. data/spec/dummy/config/application.rb +2 -3
  67. data/spec/dummy/config/boot.rb +2 -0
  68. data/spec/dummy/config/environment.rb +2 -0
  69. data/spec/dummy/config/environments/development.rb +2 -0
  70. data/spec/dummy/config/environments/test.rb +2 -4
  71. data/spec/dummy/config/initializers/assets.rb +2 -0
  72. data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -0
  73. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  74. data/spec/dummy/config/initializers/devise.rb +2 -0
  75. data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  76. data/spec/dummy/config/initializers/inflections.rb +1 -0
  77. data/spec/dummy/config/initializers/mime_types.rb +1 -0
  78. data/spec/dummy/config/initializers/paid_up.rb +10 -16
  79. data/spec/dummy/config/initializers/rolify.rb +2 -0
  80. data/spec/dummy/config/initializers/session_store.rb +2 -0
  81. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
  82. data/spec/dummy/config/routes.rb +2 -0
  83. data/spec/dummy/config.ru +2 -0
  84. data/spec/dummy/db/schema.rb +14 -23
  85. data/spec/dummy/db/seeds.rb +8 -6
  86. data/spec/dummy/db/test.sqlite3 +0 -0
  87. data/spec/dummy/lib/tasks/system.rake +2 -0
  88. data/spec/factories/doodad.rb +2 -0
  89. data/spec/factories/group.rb +2 -0
  90. data/spec/factories/plan.rb +2 -0
  91. data/spec/factories/plan_feature_setting.rb +2 -0
  92. data/spec/factories/post.rb +2 -0
  93. data/spec/factories/user.rb +3 -1
  94. data/spec/models/group_spec.rb +9 -7
  95. data/spec/models/paid_up/feature_spec.rb +2 -0
  96. data/spec/models/paid_up/plan_feature_setting_spec.rb +2 -0
  97. data/spec/models/paid_up/plan_spec.rb +2 -0
  98. data/spec/models/scope_spec.rb +9 -7
  99. data/spec/models/user_spec.rb +60 -58
  100. data/spec/paid_up_spec.rb +2 -0
  101. data/spec/rails_helper.rb +16 -2
  102. data/spec/routing/paid_up/plans_spec.rb +2 -0
  103. data/spec/routing/paid_up/subscription_spec.rb +2 -0
  104. data/spec/spec_helper.rb +2 -0
  105. data/spec/support/controller_macros.rb +2 -0
  106. data/spec/support/factory_girl.rb +2 -0
  107. data/spec/support/loaded_site/features.rb +2 -0
  108. data/spec/support/loaded_site/groups.rb +2 -0
  109. data/spec/support/loaded_site/loaded_site.rb +2 -0
  110. data/spec/support/loaded_site/plans.rb +2 -0
  111. data/spec/support/loaded_site/posts.rb +2 -0
  112. data/spec/support/loaded_site/users.rb +4 -2
  113. data/spec/support/stripe.rb +2 -0
  114. data/spec/views/paid_up/plans_spec.rb +9 -7
  115. data/spec/views/paid_up/subscriptions_spec.rb +20 -19
  116. metadata +124 -90
  117. data/app/views/devise/confirmations/new.html.haml +0 -13
  118. data/app/views/devise/passwords/edit.html.haml +0 -19
  119. data/app/views/devise/passwords/new.html.haml +0 -14
  120. data/app/views/devise/registrations/_new_form.html.haml +0 -23
  121. data/app/views/devise/registrations/edit.html.haml +0 -39
  122. data/app/views/devise/registrations/new.html.haml +0 -11
  123. data/app/views/devise/sessions/_new_form.html.haml +0 -21
  124. data/app/views/devise/sessions/new.html.haml +0 -11
  125. data/app/views/devise/shared/_links.html.haml +0 -14
  126. data/app/views/devise/unlocks/new.html.haml +0 -14
  127. data/app/views/layouts/mailer.html.haml +0 -3
  128. data/app/views/layouts/mailer.text.haml +0 -1
  129. data/app/views/paid_up/subscription_mailer/payment_failed_email.html.haml +0 -0
  130. data/app/views/paid_up/subscription_mailer/payment_failed_email.text.haml +0 -0
  131. data/coverage/.last_run.json +0 -5
  132. data/coverage/.resultset.json +0 -1927
  133. data/spec/dummy/app/views/pages/index.html.haml +0 -1
  134. data/spec/dummy/config/environments/production.rb +0 -83
  135. data/spec/dummy/config/initializers/high_voltage.rb +0 -3
data/paid_up.gemspec CHANGED
@@ -1,19 +1,19 @@
1
- # Generated by jeweler
1
+ # Generated by juwelier
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: paid_up 0.11.7 ruby lib
5
+ # stub: paid_up 0.12.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "paid_up"
9
- s.version = "0.11.7"
8
+ s.name = "paid_up".freeze
9
+ s.version = "0.12.3"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Karen Lundgren"]
14
- s.date = "2017-03-12"
15
- s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features."
16
- s.email = "karen.e.lundgren@gmail.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Karen Lundgren".freeze]
14
+ s.date = "2017-04-06"
15
+ s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features.".freeze
16
+ s.email = "karen.e.lundgren@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.md"
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.files = [
22
22
  ".rspec",
23
23
  ".rubocop.yml",
24
+ ".rubocop_todo.yml",
24
25
  ".travis.yml",
25
26
  "Gemfile",
26
27
  "LICENSE.txt",
@@ -39,31 +40,17 @@ Gem::Specification.new do |s|
39
40
  "app/models/paid_up/plan.rb",
40
41
  "app/models/paid_up/plan_feature_setting.rb",
41
42
  "app/models/paid_up/unlimited.rb",
42
- "app/views/devise/confirmations/new.html.haml",
43
- "app/views/devise/passwords/edit.html.haml",
44
- "app/views/devise/passwords/new.html.haml",
45
- "app/views/devise/registrations/_new_form.html.haml",
46
- "app/views/devise/registrations/edit.html.haml",
47
- "app/views/devise/registrations/new.html.haml",
48
- "app/views/devise/sessions/_new_form.html.haml",
49
- "app/views/devise/sessions/new.html.haml",
50
- "app/views/devise/shared/_links.html.haml",
51
- "app/views/devise/unlocks/new.html.haml",
52
- "app/views/layouts/mailer.html.haml",
53
- "app/views/layouts/mailer.text.haml",
54
43
  "app/views/paid_up/features/_abilities_table.html.haml",
44
+ "app/views/paid_up/features/_boolean_state.html.haml",
45
+ "app/views/paid_up/features/_setting_state.html.haml",
55
46
  "app/views/paid_up/features/_table.html.haml",
56
47
  "app/views/paid_up/layouts/_google_analytics_data_layer.html.haml",
57
48
  "app/views/paid_up/plans/index.html.haml",
58
- "app/views/paid_up/subscription_mailer/payment_failed_email.html.haml",
59
- "app/views/paid_up/subscription_mailer/payment_failed_email.text.haml",
60
49
  "app/views/paid_up/subscriptions/index.html.haml",
61
50
  "app/views/paid_up/subscriptions/new.html.haml",
62
51
  "config/initializers/stripe.rb",
63
52
  "config/locales/en.yml",
64
53
  "config/routes.rb",
65
- "coverage/.last_run.json",
66
- "coverage/.resultset.json",
67
54
  "coverage/.resultset.json.lock",
68
55
  "db/migrate/20150407110101_create_paid_up_plans_table.rb",
69
56
  "db/migrate/20150519164237_add_stripe_id_column_to_users.rb",
@@ -79,10 +66,15 @@ Gem::Specification.new do |s|
79
66
  "lib/paid_up/extensions/integer.rb",
80
67
  "lib/paid_up/extensions/stripe.rb",
81
68
  "lib/paid_up/feature.rb",
69
+ "lib/paid_up/feature_setting_type.rb",
70
+ "lib/paid_up/feature_setting_types/rolify.rb",
71
+ "lib/paid_up/feature_setting_types/table.rb",
82
72
  "lib/paid_up/localization.rb",
83
73
  "lib/paid_up/mixins/paid_for.rb",
84
74
  "lib/paid_up/mixins/subscriber.rb",
85
75
  "lib/paid_up/railtie.rb",
76
+ "lib/paid_up/ruby_version_check.rb",
77
+ "lib/paid_up/subscription.rb",
86
78
  "lib/paid_up/validators/rolify_rows.rb",
87
79
  "lib/paid_up/validators/table_rows.rb",
88
80
  "lib/paid_up/version.rb",
@@ -100,7 +92,6 @@ Gem::Specification.new do |s|
100
92
  "spec/dummy/app/models/role.rb",
101
93
  "spec/dummy/app/models/user.rb",
102
94
  "spec/dummy/app/views/layouts/application.html.haml",
103
- "spec/dummy/app/views/pages/index.html.haml",
104
95
  "spec/dummy/bin/bundle",
105
96
  "spec/dummy/bin/rails",
106
97
  "spec/dummy/bin/rake",
@@ -111,14 +102,12 @@ Gem::Specification.new do |s|
111
102
  "spec/dummy/config/database.yml",
112
103
  "spec/dummy/config/environment.rb",
113
104
  "spec/dummy/config/environments/development.rb",
114
- "spec/dummy/config/environments/production.rb",
115
105
  "spec/dummy/config/environments/test.rb",
116
106
  "spec/dummy/config/initializers/assets.rb",
117
107
  "spec/dummy/config/initializers/backtrace_silencers.rb",
118
108
  "spec/dummy/config/initializers/cookies_serializer.rb",
119
109
  "spec/dummy/config/initializers/devise.rb",
120
110
  "spec/dummy/config/initializers/filter_parameter_logging.rb",
121
- "spec/dummy/config/initializers/high_voltage.rb",
122
111
  "spec/dummy/config/initializers/inflections.rb",
123
112
  "spec/dummy/config/initializers/mime_types.rb",
124
113
  "spec/dummy/config/initializers/paid_up.rb",
@@ -145,6 +134,7 @@ Gem::Specification.new do |s|
145
134
  "spec/dummy/db/migrate/20170220001913_add_active_column_to_groups.rb",
146
135
  "spec/dummy/db/schema.rb",
147
136
  "spec/dummy/db/seeds.rb",
137
+ "spec/dummy/db/test.sqlite3",
148
138
  "spec/dummy/lib/assets/.keep",
149
139
  "spec/dummy/lib/tasks/system.rake",
150
140
  "spec/dummy/log/.keep",
@@ -189,99 +179,102 @@ Gem::Specification.new do |s|
189
179
  "spec/views/paid_up/plans_spec.rb",
190
180
  "spec/views/paid_up/subscriptions_spec.rb"
191
181
  ]
192
- s.homepage = "http://www.gemvein.com/museum/cases/paid_up"
193
- s.licenses = ["MIT"]
194
- s.rubygems_version = "2.4.5.1"
195
- s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features."
182
+ s.homepage = "http://www.gemvein.com/museum/cases/paid_up".freeze
183
+ s.licenses = ["MIT".freeze]
184
+ s.rubygems_version = "2.6.11".freeze
185
+ s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features.".freeze
196
186
 
197
187
  if s.respond_to? :specification_version then
198
188
  s.specification_version = 4
199
189
 
200
190
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
201
- s.add_runtime_dependency(%q<rails>, ["~> 4.2"])
202
- s.add_runtime_dependency(%q<rails-i18n>, ["~> 4"])
203
- s.add_runtime_dependency(%q<haml-rails>, ["~> 0.9"])
204
- s.add_runtime_dependency(%q<jquery-rails>, ["~> 4"])
205
- s.add_runtime_dependency(%q<uglifier>, ["~> 2.7"])
206
- s.add_runtime_dependency(%q<bootstrap_leather>, ["~> 0.5"])
207
- s.add_runtime_dependency(%q<chronic>, ["~> 0.10"])
208
- s.add_runtime_dependency(%q<money>, ["~> 6.5"])
209
- s.add_runtime_dependency(%q<devise>, ["~> 3.4"])
210
- s.add_runtime_dependency(%q<cancancan>, ["~> 1.10"])
211
- s.add_runtime_dependency(%q<rolify>, ["~> 5"])
212
- s.add_runtime_dependency(%q<stripe>, ["~> 1.36"])
213
- s.add_development_dependency(%q<dotenv-rails>, ["~> 2.2"])
214
- s.add_development_dependency(%q<jeweler>, ["~> 2"])
215
- s.add_development_dependency(%q<bundler>, ["~> 1"])
216
- s.add_development_dependency(%q<web-console>, ["~> 3.0"])
217
- s.add_development_dependency(%q<pre-commit>, ["~> 0.27"])
218
- s.add_development_dependency(%q<rubocop>, ["~> 0.37"])
219
- s.add_development_dependency(%q<coffeelint>, ["~> 1.14"])
220
- s.add_development_dependency(%q<scss_lint>, ["~> 0.47.0"])
221
- s.add_development_dependency(%q<sqlite3>, ["~> 1.3"])
222
- s.add_development_dependency(%q<forgery>, ["~> 0.6"])
223
- s.add_development_dependency(%q<bootstrap-sass>, ["~> 3.3"])
224
- s.add_development_dependency(%q<sass-rails>, ["~> 5.0"])
225
- s.add_development_dependency(%q<high_voltage>, ["~> 2.3"])
226
- s.add_development_dependency(%q<rspec-rails>, ["~> 3.2"])
227
- s.add_development_dependency(%q<factory_girl_rails>, ["~> 4.5"])
191
+ s.add_runtime_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
192
+ s.add_runtime_dependency(%q<jquery-rails>.freeze, ["~> 4"])
193
+ s.add_runtime_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
194
+ s.add_runtime_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
195
+ s.add_runtime_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
196
+ s.add_runtime_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
197
+ s.add_runtime_dependency(%q<chronic>.freeze, ["~> 0.10"])
198
+ s.add_runtime_dependency(%q<money>.freeze, ["~> 6.5"])
199
+ s.add_runtime_dependency(%q<cancancan>.freeze, ["~> 1"])
200
+ s.add_runtime_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
201
+ s.add_runtime_dependency(%q<rolify>.freeze, ["~> 5"])
202
+ s.add_runtime_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
203
+ s.add_development_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
204
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 1"])
205
+ s.add_development_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
206
+ s.add_development_dependency(%q<juwelier>.freeze, ["~> 2"])
207
+ s.add_development_dependency(%q<nokogiri>.freeze, [">= 1.7"])
208
+ s.add_development_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
209
+ s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
210
+ s.add_development_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
211
+ s.add_development_dependency(%q<web-console>.freeze, ["~> 3"])
212
+ s.add_development_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
213
+ s.add_development_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
214
+ s.add_development_dependency(%q<forgery>.freeze, ["~> 0.6"])
215
+ s.add_development_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
216
+ s.add_development_dependency(%q<rspec-rails>.freeze, ["~> 3"])
217
+ s.add_development_dependency(%q<sass-rails>.freeze, ["~> 5"])
218
+ s.add_development_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
228
219
  else
229
- s.add_dependency(%q<rails>, ["~> 4.2"])
230
- s.add_dependency(%q<rails-i18n>, ["~> 4"])
231
- s.add_dependency(%q<haml-rails>, ["~> 0.9"])
232
- s.add_dependency(%q<jquery-rails>, ["~> 4"])
233
- s.add_dependency(%q<uglifier>, ["~> 2.7"])
234
- s.add_dependency(%q<bootstrap_leather>, ["~> 0.5"])
235
- s.add_dependency(%q<chronic>, ["~> 0.10"])
236
- s.add_dependency(%q<money>, ["~> 6.5"])
237
- s.add_dependency(%q<devise>, ["~> 3.4"])
238
- s.add_dependency(%q<cancancan>, ["~> 1.10"])
239
- s.add_dependency(%q<rolify>, ["~> 5"])
240
- s.add_dependency(%q<stripe>, ["~> 1.36"])
241
- s.add_dependency(%q<dotenv-rails>, ["~> 2.2"])
242
- s.add_dependency(%q<jeweler>, ["~> 2"])
243
- s.add_dependency(%q<bundler>, ["~> 1"])
244
- s.add_dependency(%q<web-console>, ["~> 3.0"])
245
- s.add_dependency(%q<pre-commit>, ["~> 0.27"])
246
- s.add_dependency(%q<rubocop>, ["~> 0.37"])
247
- s.add_dependency(%q<coffeelint>, ["~> 1.14"])
248
- s.add_dependency(%q<scss_lint>, ["~> 0.47.0"])
249
- s.add_dependency(%q<sqlite3>, ["~> 1.3"])
250
- s.add_dependency(%q<forgery>, ["~> 0.6"])
251
- s.add_dependency(%q<bootstrap-sass>, ["~> 3.3"])
252
- s.add_dependency(%q<sass-rails>, ["~> 5.0"])
253
- s.add_dependency(%q<high_voltage>, ["~> 2.3"])
254
- s.add_dependency(%q<rspec-rails>, ["~> 3.2"])
255
- s.add_dependency(%q<factory_girl_rails>, ["~> 4.5"])
220
+ s.add_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
221
+ s.add_dependency(%q<jquery-rails>.freeze, ["~> 4"])
222
+ s.add_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
223
+ s.add_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
224
+ s.add_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
225
+ s.add_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
226
+ s.add_dependency(%q<chronic>.freeze, ["~> 0.10"])
227
+ s.add_dependency(%q<money>.freeze, ["~> 6.5"])
228
+ s.add_dependency(%q<cancancan>.freeze, ["~> 1"])
229
+ s.add_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
230
+ s.add_dependency(%q<rolify>.freeze, ["~> 5"])
231
+ s.add_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
232
+ s.add_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
233
+ s.add_dependency(%q<bundler>.freeze, ["~> 1"])
234
+ s.add_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
235
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2"])
236
+ s.add_dependency(%q<nokogiri>.freeze, [">= 1.7"])
237
+ s.add_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
238
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
239
+ s.add_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
240
+ s.add_dependency(%q<web-console>.freeze, ["~> 3"])
241
+ s.add_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
242
+ s.add_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
243
+ s.add_dependency(%q<forgery>.freeze, ["~> 0.6"])
244
+ s.add_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
245
+ s.add_dependency(%q<rspec-rails>.freeze, ["~> 3"])
246
+ s.add_dependency(%q<sass-rails>.freeze, ["~> 5"])
247
+ s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
256
248
  end
257
249
  else
258
- s.add_dependency(%q<rails>, ["~> 4.2"])
259
- s.add_dependency(%q<rails-i18n>, ["~> 4"])
260
- s.add_dependency(%q<haml-rails>, ["~> 0.9"])
261
- s.add_dependency(%q<jquery-rails>, ["~> 4"])
262
- s.add_dependency(%q<uglifier>, ["~> 2.7"])
263
- s.add_dependency(%q<bootstrap_leather>, ["~> 0.5"])
264
- s.add_dependency(%q<chronic>, ["~> 0.10"])
265
- s.add_dependency(%q<money>, ["~> 6.5"])
266
- s.add_dependency(%q<devise>, ["~> 3.4"])
267
- s.add_dependency(%q<cancancan>, ["~> 1.10"])
268
- s.add_dependency(%q<rolify>, ["~> 5"])
269
- s.add_dependency(%q<stripe>, ["~> 1.36"])
270
- s.add_dependency(%q<dotenv-rails>, ["~> 2.2"])
271
- s.add_dependency(%q<jeweler>, ["~> 2"])
272
- s.add_dependency(%q<bundler>, ["~> 1"])
273
- s.add_dependency(%q<web-console>, ["~> 3.0"])
274
- s.add_dependency(%q<pre-commit>, ["~> 0.27"])
275
- s.add_dependency(%q<rubocop>, ["~> 0.37"])
276
- s.add_dependency(%q<coffeelint>, ["~> 1.14"])
277
- s.add_dependency(%q<scss_lint>, ["~> 0.47.0"])
278
- s.add_dependency(%q<sqlite3>, ["~> 1.3"])
279
- s.add_dependency(%q<forgery>, ["~> 0.6"])
280
- s.add_dependency(%q<bootstrap-sass>, ["~> 3.3"])
281
- s.add_dependency(%q<sass-rails>, ["~> 5.0"])
282
- s.add_dependency(%q<high_voltage>, ["~> 2.3"])
283
- s.add_dependency(%q<rspec-rails>, ["~> 3.2"])
284
- s.add_dependency(%q<factory_girl_rails>, ["~> 4.5"])
250
+ s.add_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
251
+ s.add_dependency(%q<jquery-rails>.freeze, ["~> 4"])
252
+ s.add_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
253
+ s.add_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
254
+ s.add_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
255
+ s.add_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
256
+ s.add_dependency(%q<chronic>.freeze, ["~> 0.10"])
257
+ s.add_dependency(%q<money>.freeze, ["~> 6.5"])
258
+ s.add_dependency(%q<cancancan>.freeze, ["~> 1"])
259
+ s.add_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
260
+ s.add_dependency(%q<rolify>.freeze, ["~> 5"])
261
+ s.add_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
262
+ s.add_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
263
+ s.add_dependency(%q<bundler>.freeze, ["~> 1"])
264
+ s.add_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
265
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2"])
266
+ s.add_dependency(%q<nokogiri>.freeze, [">= 1.7"])
267
+ s.add_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
268
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
269
+ s.add_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
270
+ s.add_dependency(%q<web-console>.freeze, ["~> 3"])
271
+ s.add_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
272
+ s.add_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
273
+ s.add_dependency(%q<forgery>.freeze, ["~> 0.6"])
274
+ s.add_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
275
+ s.add_dependency(%q<rspec-rails>.freeze, ["~> 3"])
276
+ s.add_dependency(%q<sass-rails>.freeze, ["~> 5"])
277
+ s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
285
278
  end
286
279
  end
287
280
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  RSpec.describe PaidUp::PlansController do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  RSpec.describe PaidUp::SubscriptionsController do
@@ -37,7 +39,7 @@ RSpec.describe PaidUp::SubscriptionsController do
37
39
  describe 'when the user is anonymous' do
38
40
  before do
39
41
  access_anonymous
40
- get :new, plan_id: professional_plan.id
42
+ get :new, params: { plan_id: professional_plan.id }
41
43
  end
42
44
  describe 'redirects to the user sign up page' do
43
45
  subject { response }
@@ -50,7 +52,7 @@ RSpec.describe PaidUp::SubscriptionsController do
50
52
  describe 'with a paid plan' do
51
53
  before do
52
54
  sign_in free_subscriber
53
- get :new, plan_id: professional_plan.id
55
+ get :new, params: { plan_id: professional_plan.id }
54
56
  end
55
57
  after do
56
58
  free_subscriber.subscribe_to_plan free_plan
@@ -72,7 +74,7 @@ RSpec.describe PaidUp::SubscriptionsController do
72
74
  describe 'with the free plan' do
73
75
  before do
74
76
  login_subscriber no_ads_subscriber
75
- get :new, plan_id: free_plan.id
77
+ get :new, params: { plan_id: free_plan.id }
76
78
  end
77
79
  after do
78
80
  no_ads_subscriber.subscribe_to_plan no_ads_plan
@@ -93,11 +95,11 @@ RSpec.describe PaidUp::SubscriptionsController do
93
95
  end
94
96
  describe 'when downgrading' do
95
97
  before do
96
- sign_in professional_subscriber
97
- get :new, plan_id: no_ads_plan.id
98
+ sign_in prof_subscriber
99
+ get :new, params: { plan_id: no_ads_plan.id }
98
100
  end
99
101
  after do
100
- professional_subscriber.subscribe_to_plan professional_plan
102
+ prof_subscriber.subscribe_to_plan professional_plan
101
103
  end
102
104
  describe 'redirects to the subscriptions index page' do
103
105
  subject { response }
@@ -135,7 +137,10 @@ RSpec.describe PaidUp::SubscriptionsController do
135
137
  before do
136
138
  sign_in free_subscriber
137
139
  token = working_stripe_token free_subscriber
138
- post :create, plan_id: professional_plan.id, stripeToken: token
140
+ post(
141
+ :create,
142
+ params: { plan_id: professional_plan.id, stripeToken: token }
143
+ )
139
144
  end
140
145
  after do
141
146
  free_subscriber.subscribe_to_plan free_plan
@@ -160,9 +165,11 @@ RSpec.describe PaidUp::SubscriptionsController do
160
165
  token = working_stripe_token free_subscriber
161
166
  post(
162
167
  :create,
163
- plan_id: professional_plan.id,
164
- stripeToken: token,
165
- coupon_code: '25OFF'
168
+ params: {
169
+ plan_id: professional_plan.id,
170
+ stripeToken: token,
171
+ coupon_code: '25OFF'
172
+ }
166
173
  )
167
174
  end
168
175
  after do
@@ -187,7 +194,7 @@ RSpec.describe PaidUp::SubscriptionsController do
187
194
  describe 'without a coupon code' do
188
195
  before do
189
196
  sign_in no_ads_subscriber
190
- post :create, plan_id: professional_plan.id
197
+ post :create, params: { plan_id: professional_plan.id }
191
198
  end
192
199
  after do
193
200
  no_ads_subscriber.subscribe_to_plan no_ads_plan
data/spec/dummy/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
4
  # for example lib/tasks/capistrano.rake, and they will automatically be
3
5
  # available to Rake.
@@ -1,3 +1,9 @@
1
1
  // 'bootstrap-sprockets' must be imported before 'bootstrap' and 'bootstrap/variables'
2
2
  @import 'bootstrap-sprockets';
3
3
  @import 'bootstrap';
4
+
5
+ footer {
6
+ border-top: solid 1px $brand-info;
7
+ background-color: lighten($brand-info, 25%);
8
+ padding-top: 1em;
9
+ }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ApplicationController < ActionController::Base
2
4
  protect_from_forgery
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Ability
2
4
  include CanCan::Ability
3
5
  include PaidUp::Ability
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Doodad < ActiveRecord::Base
2
4
  paid_for
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Group < ActiveRecord::Base
2
4
  paid_for scope: :active
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Post < ActiveRecord::Base
2
4
  paid_for scope: :active
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Role < ActiveRecord::Base
2
4
  has_and_belongs_to_many :users, join_table: :users_roles
3
5
  belongs_to :resource, polymorphic: true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class User < ActiveRecord::Base
2
4
  rolify
3
5
  # Include default devise modules. Others available are:
@@ -18,15 +18,17 @@
18
18
  = yield
19
19
 
20
20
  %footer
21
- - add_widget do
22
- .clearfix
23
- = nav_list class: 'nav-pills nav-stacked' do
24
- = nav_item :plans.l, paid_up.plans_path
25
- - if signed_in?
26
- = nav_item :my_subscription.l, paid_up.subscriptions_path
27
- = nav_item :sign_out.l, main_app.destroy_user_session_path, method: :delete
28
- - else
29
- = nav_item :sign_in.l, main_app.new_user_session_path
30
- = nav_item :sign_up.l, main_app.new_user_registration_path
31
- = render_widgets 'md', 3
21
+ .container
22
+ .row
23
+ - add_widget do
24
+ .clearfix
25
+ = nav_list class: 'nav-pills nav-stacked' do
26
+ = nav_item :plans.l, paid_up.plans_path
27
+ - if signed_in?
28
+ = nav_item :my_subscription.l, paid_up.subscriptions_path
29
+ = nav_item :sign_out.l, main_app.destroy_user_session_path, method: :delete
30
+ - else
31
+ = nav_item :sign_in.l, main_app.new_user_session_path
32
+ = nav_item :sign_up.l, main_app.new_user_registration_path
33
+ = render_widgets 'md', 3
32
34
  = render_footer_javascript
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
5
  load Gem.bin_path('bundler', 'bundle')
data/spec/dummy/bin/rails CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  APP_PATH = File.expand_path('../../config/application', __FILE__)
3
5
  require_relative '../config/boot'
4
6
  require 'rails/commands'
data/spec/dummy/bin/rake CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require_relative '../config/boot'
3
5
  require 'rake'
4
6
  Rake.application.run
data/spec/dummy/bin/setup CHANGED
@@ -1,16 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'pathname'
3
5
 
4
6
  # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
8
 
7
9
  Dir.chdir APP_ROOT do
8
10
  # This script is a starting point to setup your application.
9
11
  # Add necessary setup steps to this file:
10
12
 
11
- puts "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
13
+ puts '== Installing dependencies =='
14
+ system 'gem install bundler --conservative'
15
+ system 'bundle check || bundle install'
14
16
 
15
17
  # puts "\n== Copying sample files =="
16
18
  # unless File.exist?("config/database.yml")
@@ -18,12 +20,12 @@ Dir.chdir APP_ROOT do
18
20
  # end
19
21
 
20
22
  puts "\n== Preparing database =="
21
- system "bin/rake db:setup"
23
+ system 'bin/rake db:setup'
22
24
 
23
25
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
26
+ system 'rm -f log/*'
27
+ system 'rm -rf tmp/cache'
26
28
 
27
29
  puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
30
+ system 'touch tmp/restart.txt'
29
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../boot', __FILE__)
2
4
 
3
5
  # Pick the frameworks you want:
@@ -29,9 +31,6 @@ module Dummy
29
31
  # ]
30
32
  # config.i18n.default_locale = :de
31
33
 
32
- # Do not swallow errors in after_commit/after_rollback callbacks.
33
- config.active_record.raise_in_transactional_callbacks = true
34
-
35
34
  config.generators do |g|
36
35
  g.hidden_namespaces << 'test_unit' << 'erb'
37
36
  g.orm :active_record
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Set up gems listed in the Gemfile.
2
4
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Load the Rails application.
2
4
  require File.expand_path('../application', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in
3
5
  # config/application.rb.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in
3
5
  # config/application.rb.
@@ -13,10 +15,6 @@ Rails.application.configure do
13
15
  # preloads Rails for running tests, you may have to set it to true.
14
16
  config.eager_load = false
15
17
 
16
- # Configure static file server for tests with Cache-Control for performance.
17
- config.serve_static_files = true
18
- config.static_cache_control = 'public, max-age=3600'
19
-
20
18
  # Show full error reports and disable caching.
21
19
  config.consider_all_requests_local = true
22
20
  config.action_controller.perform_caching = false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Version of your assets, change this if you want to expire all your assets.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Be sure to restart your server when you modify this file.
2
3
 
3
4
  # You can add backtrace silencers for libraries that you're using but don't wish