paid_up 0.9.13 → 0.9.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +20 -0
  3. data/Gemfile +5 -1
  4. data/Rakefile +12 -10
  5. data/VERSION +1 -1
  6. data/app/controllers/paid_up/paid_up_controller.rb +8 -3
  7. data/app/controllers/paid_up/plans_controller.rb +2 -1
  8. data/app/controllers/paid_up/subscriptions_controller.rb +19 -6
  9. data/app/helpers/paid_up/features_helper.rb +19 -6
  10. data/app/helpers/paid_up/paid_up_helper.rb +6 -3
  11. data/app/helpers/paid_up/plans_helper.rb +12 -5
  12. data/app/helpers/paid_up/subscriptions_helper.rb +10 -3
  13. data/app/models/paid_up/ability.rb +43 -44
  14. data/app/models/paid_up/plan.rb +81 -69
  15. data/app/models/paid_up/plan_feature_setting.rb +17 -9
  16. data/app/models/paid_up/unlimited.rb +15 -13
  17. data/app/views/devise/confirmations/new.html.haml +1 -1
  18. data/app/views/devise/passwords/edit.html.haml +1 -1
  19. data/app/views/devise/passwords/new.html.haml +1 -1
  20. data/app/views/devise/registrations/_new_form.html.haml +1 -1
  21. data/app/views/devise/registrations/new.html.haml +1 -1
  22. data/app/views/devise/sessions/new.html.haml +1 -1
  23. data/app/views/devise/unlocks/new.html.haml +1 -1
  24. data/app/views/layouts/mailer.html.haml +1 -1
  25. data/app/views/layouts/mailer.text.haml +1 -1
  26. data/app/views/paid_up/features/_abilities_table.html.haml +1 -1
  27. data/app/views/paid_up/plans/index.html.haml +1 -1
  28. data/app/views/paid_up/subscriptions/new.html.haml +1 -1
  29. data/config/initializers/stripe.rb +3 -3
  30. data/coverage/.last_run.json +1 -1
  31. data/coverage/.resultset.json +414 -253
  32. data/db/migrate/20150407110101_create_paid_up_plans_table.rb +3 -3
  33. data/lib/generators/paid_up/install/install_generator.rb +42 -33
  34. data/lib/generators/paid_up/install/templates/ability.rb +1 -0
  35. data/lib/generators/paid_up/install/templates/initializer.rb +16 -14
  36. data/lib/generators/paid_up/utils.rb +11 -4
  37. data/lib/paid_up/configuration.rb +13 -8
  38. data/lib/paid_up/engine.rb +4 -3
  39. data/lib/paid_up/extensions/integer.rb +8 -5
  40. data/lib/paid_up/extensions/stripe.rb +10 -9
  41. data/lib/paid_up/feature.rb +27 -17
  42. data/lib/paid_up/localization.rb +17 -18
  43. data/lib/paid_up/mixins/paid_for.rb +66 -54
  44. data/lib/paid_up/mixins/subscriber.rb +154 -161
  45. data/lib/paid_up/railtie.rb +1 -1
  46. data/lib/paid_up/validators/rolify_rows.rb +14 -6
  47. data/lib/paid_up/validators/table_rows.rb +14 -6
  48. data/lib/paid_up/version.rb +1 -1
  49. data/lib/paid_up.rb +7 -8
  50. data/paid_up.gemspec +21 -8
  51. data/spec/controllers/paid_up/plans_spec.rb +6 -6
  52. data/spec/controllers/paid_up/subscriptions_spec.rb +68 -68
  53. data/spec/dummy/Rakefile +2 -1
  54. data/spec/dummy/app/assets/stylesheets/application.css.scss +3 -16
  55. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  56. data/spec/dummy/app/models/doodad.rb +1 -1
  57. data/spec/dummy/app/models/group.rb +1 -1
  58. data/spec/dummy/app/models/role.rb +4 -4
  59. data/spec/dummy/app/models/user.rb +1 -1
  60. data/spec/dummy/app/views/layouts/application.html.haml +2 -2
  61. data/spec/dummy/app/views/pages/index.html.haml +1 -1
  62. data/spec/dummy/config/application.rb +16 -12
  63. data/spec/dummy/config/environments/development.rb +4 -3
  64. data/spec/dummy/config/environments/production.rb +10 -6
  65. data/spec/dummy/config/environments/test.rb +3 -2
  66. data/spec/dummy/config/initializers/assets.rb +2 -1
  67. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -2
  68. data/spec/dummy/config/initializers/devise.rb +58 -42
  69. data/spec/dummy/config/initializers/high_voltage.rb +1 -1
  70. data/spec/dummy/config/initializers/mime_types.rb +1 -1
  71. data/spec/dummy/config/initializers/paid_up.rb +16 -14
  72. data/spec/dummy/config/initializers/rolify.rb +3 -2
  73. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -1
  74. data/spec/dummy/config/routes.rb +2 -2
  75. data/spec/dummy/db/migrate/20150523010827_add_devise_to_users.rb +2 -2
  76. data/spec/dummy/db/migrate/20150523010837_rolify_create_roles.rb +2 -2
  77. data/spec/dummy/db/migrate/20160207184112_create_paid_up_plans_table.paid_up.rb +3 -3
  78. data/spec/dummy/db/schema.rb +53 -53
  79. data/spec/dummy/db/seeds.rb +41 -56
  80. data/spec/dummy/db/test.sqlite3 +0 -0
  81. data/spec/dummy/lib/tasks/system.rake +2 -2
  82. data/spec/factories/group.rb +1 -1
  83. data/spec/factories/plan.rb +1 -1
  84. data/spec/factories/plan_feature_setting.rb +1 -1
  85. data/spec/factories/user.rb +13 -11
  86. data/spec/models/group_spec.rb +8 -7
  87. data/spec/models/paid_up/feature_spec.rb +18 -4
  88. data/spec/models/paid_up/plan_feature_setting_spec.rb +2 -2
  89. data/spec/models/paid_up/plan_spec.rb +12 -8
  90. data/spec/models/user_spec.rb +88 -78
  91. data/spec/paid_up_spec.rb +1 -1
  92. data/spec/rails_helper.rb +5 -5
  93. data/spec/routing/paid_up/plans_spec.rb +3 -3
  94. data/spec/routing/paid_up/subscription_spec.rb +30 -7
  95. data/spec/spec_helper.rb +7 -52
  96. data/spec/support/controller_macros.rb +2 -2
  97. data/spec/support/factory_girl.rb +1 -1
  98. data/spec/support/{features.rb → loaded_site/features.rb} +2 -2
  99. data/spec/support/{groups.rb → loaded_site/groups.rb} +1 -1
  100. data/spec/support/{loaded_site.rb → loaded_site/loaded_site.rb} +1 -1
  101. data/spec/support/{plans.rb → loaded_site/plans.rb} +8 -4
  102. data/spec/support/{users.rb → loaded_site/users.rb} +1 -1
  103. data/spec/support/stripe.rb +10 -13
  104. data/spec/views/paid_up/plans_spec.rb +17 -17
  105. data/spec/views/paid_up/subscriptions_spec.rb +24 -14
  106. metadata +64 -7
@@ -10,4 +10,4 @@
10
10
  .col-sm-offset-2
11
11
  = f.submit :resend_confirmation_instructions.l
12
12
  - add_widget do
13
- = render "devise/shared/links"
13
+ = render 'devise/shared/links'
@@ -16,4 +16,4 @@
16
16
  .col-sm-offset-2
17
17
  = f.submit :change_your_password.l, class: 'btn btn-primary'
18
18
  - add_widget do
19
- = render "devise/shared/links"
19
+ = render 'devise/shared/links'
@@ -11,4 +11,4 @@
11
11
  .col-sm-offset-2
12
12
  = f.submit :send_me_reset_password_instructions.l, class: 'btn btn-primary'
13
13
  - add_widget do
14
- = render "devise/shared/links"
14
+ = render 'devise/shared/links'
@@ -20,4 +20,4 @@
20
20
  .col-sm-2
21
21
  .col-sm-8
22
22
  .col-sm-offset-2
23
- = f.submit :sign_up.l, class: 'form-control btn btn-primary'
23
+ = f.submit :sign_up.l, class: 'form-control btn btn-primary'
@@ -8,4 +8,4 @@
8
8
  %h2= :or_sign_in.l
9
9
  = render 'devise/sessions/new_form'
10
10
  - add_widget do
11
- = render "devise/shared/links"
11
+ = render 'devise/shared/links'
@@ -8,4 +8,4 @@
8
8
  %h2= :or_sign_up.l
9
9
  = render 'devise/registrations/new_form'
10
10
  - add_widget do
11
- = render "devise/shared/links"
11
+ = render 'devise/shared/links'
@@ -11,4 +11,4 @@
11
11
  .col-sm-offset-2
12
12
  = f.submit :resend_unlock_instructions.l
13
13
  - add_widget do
14
- = render "devise/shared/links"
14
+ = render 'devise/shared/links'
@@ -1,3 +1,3 @@
1
1
  %hmtl
2
2
  %body
3
- = yield
3
+ = yield
@@ -1 +1 @@
1
- = yield
1
+ = yield
@@ -46,4 +46,4 @@
46
46
  - else
47
47
  = :x_of_y_remaining.l x: remaining, y: allowed
48
48
  - else
49
- = :error.l
49
+ = :error.l
@@ -15,4 +15,4 @@
15
15
  - if user_signed_in?
16
16
  = features_table highlight: current_user.plan
17
17
  - else
18
- = features_table
18
+ = features_table
@@ -108,4 +108,4 @@
108
108
  }
109
109
  });
110
110
  $('#new-card').hide();
111
- });
111
+ });
@@ -1,6 +1,6 @@
1
1
  Rails.configuration.stripe = {
2
- :publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'],
3
- :secret_key => ENV['STRIPE_SECRET_KEY']
2
+ publishable_key: ENV['STRIPE_PUBLISHABLE_KEY'],
3
+ secret_key: ENV['STRIPE_SECRET_KEY']
4
4
  }
5
5
 
6
- Stripe.api_key = Rails.configuration.stripe[:secret_key]
6
+ Stripe.api_key = Rails.configuration.stripe[:secret_key]
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 94.82
3
+ "covered_percent": 95.29
4
4
  }
5
5
  }