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
@@ -1 +0,0 @@
1
- = Forgery('lorem_ipsum').paragraphs(5)
@@ -1,83 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in
3
- # config/application.rb.
4
-
5
- # Code is not reloaded between requests.
6
- config.cache_classes = true
7
-
8
- # Eager load code on boot. This eager loads most of Rails and
9
- # your application in memory, allowing both threaded web servers
10
- # and those relying on copy on write to perform better.
11
- # Rake tasks automatically ignore this option for performance.
12
- config.eager_load = true
13
-
14
- # Full error reports are disabled and caching is turned on.
15
- config.consider_all_requests_local = false
16
- config.action_controller.perform_caching = true
17
-
18
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
19
- # Add `rack-cache` to your Gemfile before enabling this.
20
- # For large-scale production use, consider using a caching reverse proxy like
21
- # NGINX, varnish or squid.
22
- # config.action_dispatch.rack_cache = true
23
-
24
- # Disable serving static files from the `/public` folder by default since
25
- # Apache or NGINX already handles this.
26
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
-
28
- # Compress JavaScripts and CSS.
29
- config.assets.js_compressor = :uglifier
30
- # config.assets.css_compressor = :sass
31
-
32
- # Do not fallback to assets pipeline if a precompiled asset is missed.
33
- config.assets.compile = false
34
-
35
- # Asset digests allow you to set far-future HTTP expiration dates on all
36
- # assets, yet still be able to expire them through the digest params.
37
- config.assets.digest = true
38
-
39
- # `config.assets.precompile` and `config.assets.version` have moved to
40
- # config/initializers/assets.rb
41
-
42
- # Specifies the header that your server uses for sending files.
43
- # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
44
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
45
-
46
- # Force all access to the app over SSL, use Strict-Transport-Security, and use
47
- # secure cookies.
48
- # config.force_ssl = true
49
-
50
- # Use the lowest log level to ensure availability of diagnostic information
51
- # when problems arise.
52
- config.log_level = :debug
53
-
54
- # Prepend all log lines with the following tags.
55
- # config.log_tags = [ :subdomain, :uuid ]
56
-
57
- # Use a different logger for distributed setups.
58
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
59
-
60
- # Use a different cache store in production.
61
- # config.cache_store = :mem_cache_store
62
-
63
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
64
- # config.action_controller.asset_host = 'http://assets.example.com'
65
-
66
- # Ignore bad email addresses and do not raise email delivery errors.
67
- # Set this to true and configure the email server for immediate delivery to
68
- # raise delivery errors.
69
- # config.action_mailer.raise_delivery_errors = false
70
-
71
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72
- # the I18n.default_locale when a translation cannot be found).
73
- config.i18n.fallbacks = true
74
-
75
- # Send deprecation notices to registered listeners.
76
- config.active_support.deprecation = :notify
77
-
78
- # Use default logging formatter so that PID and timestamp are not suppressed.
79
- config.log_formatter = ::Logger::Formatter.new
80
-
81
- # Do not dump schema after migrations.
82
- config.active_record.dump_schema_after_migration = false
83
- end
@@ -1,3 +0,0 @@
1
- HighVoltage.configure do |config|
2
- config.home_page = 'index'
3
- end