stripe_saas 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.asc +159 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/stripe_saas/application.js +13 -0
  6. data/app/assets/stylesheets/stripe_saas/application.css +15 -0
  7. data/app/concerns/stripe_saas/feature.rb +23 -0
  8. data/app/concerns/stripe_saas/plan.rb +45 -0
  9. data/app/concerns/stripe_saas/plan_feature.rb +25 -0
  10. data/app/concerns/stripe_saas/subscription.rb +182 -0
  11. data/app/controllers/stripe_saas/application_controller.rb +5 -0
  12. data/app/controllers/stripe_saas/subscriptions_controller.rb +200 -0
  13. data/app/helpers/stripe_saas/application_helper.rb +26 -0
  14. data/app/views/stripe_saas/subscriptions/_card.html.erb +51 -0
  15. data/app/views/stripe_saas/subscriptions/_card_form.html.erb +42 -0
  16. data/app/views/stripe_saas/subscriptions/_pricing_table.html.erb +43 -0
  17. data/app/views/stripe_saas/subscriptions/edit.html.erb +7 -0
  18. data/app/views/stripe_saas/subscriptions/index.html.erb +2 -0
  19. data/app/views/stripe_saas/subscriptions/new.html.erb +1 -0
  20. data/app/views/stripe_saas/subscriptions/show.html.erb +15 -0
  21. data/app/views/stripe_saas/subscriptions/unauthorized.html.erb +1 -0
  22. data/config/environment.rb +0 -0
  23. data/config/routes.rb +10 -0
  24. data/lib/generators/stripe_saas/install_generator.rb +60 -0
  25. data/lib/generators/stripe_saas/templates/app/models/feature.rb +8 -0
  26. data/lib/generators/stripe_saas/templates/app/models/plan.rb +9 -0
  27. data/lib/generators/stripe_saas/templates/app/models/plan_feature.rb +6 -0
  28. data/lib/generators/stripe_saas/templates/app/models/subscription.rb +5 -0
  29. data/lib/generators/stripe_saas/templates/config/initializers/stripe_saas.rb +7 -0
  30. data/lib/generators/stripe_saas/views_generator.rb +20 -0
  31. data/lib/stripe_saas.rb +9 -0
  32. data/lib/stripe_saas/configuration.rb +51 -0
  33. data/lib/stripe_saas/engine.rb +41 -0
  34. data/lib/stripe_saas/version.rb +3 -0
  35. data/lib/tasks/stripe_saas_tasks.rake +11 -0
  36. data/spec/concerns/plan_spec.rb +50 -0
  37. data/spec/dummy/README.rdoc +28 -0
  38. data/spec/dummy/Rakefile +6 -0
  39. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  40. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  41. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  43. data/spec/dummy/app/models/plan.rb +7 -0
  44. data/spec/dummy/app/models/subscription.rb +5 -0
  45. data/spec/dummy/app/models/user.rb +8 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +16 -0
  47. data/spec/dummy/bin/bundle +3 -0
  48. data/spec/dummy/bin/rails +4 -0
  49. data/spec/dummy/bin/rake +4 -0
  50. data/spec/dummy/bin/setup +29 -0
  51. data/spec/dummy/config.ru +4 -0
  52. data/spec/dummy/config/application.rb +27 -0
  53. data/spec/dummy/config/boot.rb +5 -0
  54. data/spec/dummy/config/database.yml +25 -0
  55. data/spec/dummy/config/environment.rb +5 -0
  56. data/spec/dummy/config/environments/development.rb +41 -0
  57. data/spec/dummy/config/environments/production.rb +79 -0
  58. data/spec/dummy/config/environments/test.rb +42 -0
  59. data/spec/dummy/config/initializers/assets.rb +11 -0
  60. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  61. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  62. data/spec/dummy/config/initializers/devise.rb +259 -0
  63. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  64. data/spec/dummy/config/initializers/inflections.rb +16 -0
  65. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  66. data/spec/dummy/config/initializers/session_store.rb +3 -0
  67. data/spec/dummy/config/initializers/stripe_saas.rb +7 -0
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  69. data/spec/dummy/config/locales/devise.en.yml +60 -0
  70. data/spec/dummy/config/locales/en.yml +23 -0
  71. data/spec/dummy/config/routes.rb +10 -0
  72. data/spec/dummy/config/secrets.yml +22 -0
  73. data/spec/dummy/db/development.sqlite3 +0 -0
  74. data/spec/dummy/db/migrate/20150101233243_devise_create_users.rb +42 -0
  75. data/spec/dummy/db/migrate/20150102001921_create_subscriptions.rb +14 -0
  76. data/spec/dummy/db/migrate/20150102001930_create_plans.rb +19 -0
  77. data/spec/dummy/db/schema.rb +61 -0
  78. data/spec/dummy/db/test.sqlite3 +0 -0
  79. data/spec/dummy/log/development.log +170 -0
  80. data/spec/dummy/log/test.log +110 -0
  81. data/spec/dummy/public/404.html +67 -0
  82. data/spec/dummy/public/422.html +67 -0
  83. data/spec/dummy/public/500.html +66 -0
  84. data/spec/dummy/public/favicon.ico +0 -0
  85. data/spec/integration/navigation_test.rb +9 -0
  86. data/spec/rails_helper.rb +23 -0
  87. data/spec/spec_helper.rb +22 -0
  88. metadata +278 -0
@@ -0,0 +1,110 @@
1
+ ActiveRecord::SchemaMigration Load (1.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
+  (4.1ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
3
+  (1.8ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
4
+  (2.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime) 
5
+  (2.9ms) select sqlite_version(*)
6
+  (1.3ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
7
+  (0.1ms) SELECT sql
8
+ FROM sqlite_master
9
+ WHERE name='index_users_on_email' AND type='index'
10
+ UNION ALL
11
+ SELECT sql
12
+ FROM sqlite_temp_master
13
+ WHERE name='index_users_on_email' AND type='index'
14
+
15
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
16
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
17
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18
+  (0.1ms) SELECT version FROM "schema_migrations"
19
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
20
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
21
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
22
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
24
+  (2.2ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
25
+  (2.2ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
26
+  (2.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime) 
27
+  (0.1ms) select sqlite_version(*)
28
+  (1.5ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
29
+  (0.1ms) SELECT sql
30
+ FROM sqlite_master
31
+ WHERE name='index_users_on_email' AND type='index'
32
+ UNION ALL
33
+ SELECT sql
34
+ FROM sqlite_temp_master
35
+ WHERE name='index_users_on_email' AND type='index'
36
+
37
+  (1.3ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
38
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
39
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
40
+  (0.1ms) SELECT version FROM "schema_migrations"
41
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
42
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
43
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
44
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
45
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
46
+  (2.1ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
47
+  (1.6ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
48
+  (2.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime) 
49
+  (2.6ms) select sqlite_version(*)
50
+  (3.2ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
51
+  (0.1ms) SELECT sql
52
+ FROM sqlite_master
53
+ WHERE name='index_users_on_email' AND type='index'
54
+ UNION ALL
55
+ SELECT sql
56
+ FROM sqlite_temp_master
57
+ WHERE name='index_users_on_email' AND type='index'
58
+
59
+  (1.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
60
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
61
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
62
+  (0.1ms) SELECT version FROM "schema_migrations"
63
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
64
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
65
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
66
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
67
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
68
+  (1.7ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
69
+  (1.7ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
70
+  (2.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime) 
71
+  (0.1ms) select sqlite_version(*)
72
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
73
+  (0.1ms) SELECT sql
74
+ FROM sqlite_master
75
+ WHERE name='index_users_on_email' AND type='index'
76
+ UNION ALL
77
+ SELECT sql
78
+ FROM sqlite_temp_master
79
+ WHERE name='index_users_on_email' AND type='index'
80
+
81
+  (2.0ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
82
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
83
+  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
84
+  (0.1ms) SELECT version FROM "schema_migrations"
85
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
86
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
87
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
88
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
89
+ ActiveRecord::SchemaMigration Load (1.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
90
+  (2.4ms) CREATE TABLE "plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "name" varchar, "price_cents" integer, "interval" varchar, "interval_count" integer, "trial_period_days" integer, "metadata_as_json" text, "statement_descriptor" text, "features_as_json" text, "highlight" boolean, "display_order" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
91
+  (3.2ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "plan_id" integer, "last_four" varchar, "card_type" varchar, "current_price_cents" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
92
+  (7.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime, "updated_at" datetime) 
93
+  (0.1ms) select sqlite_version(*)
94
+  (2.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
95
+  (0.2ms) SELECT sql
96
+ FROM sqlite_master
97
+ WHERE name='index_users_on_email' AND type='index'
98
+ UNION ALL
99
+ SELECT sql
100
+ FROM sqlite_temp_master
101
+ WHERE name='index_users_on_email' AND type='index'
102
+
103
+  (1.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
104
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
105
+  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
106
+  (0.1ms) SELECT version FROM "schema_migrations"
107
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001930')
108
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150101233243')
109
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150102001921')
110
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,9 @@
1
+ # require 'test_helper'
2
+ #
3
+ # class NavigationTest < ActionDispatch::IntegrationTest
4
+ # fixtures :all
5
+ #
6
+ # # test "the truth" do
7
+ # # assert true
8
+ # # end
9
+ # end
@@ -0,0 +1,23 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ require 'spec_helper'
5
+ require File.expand_path("../../config/environment", __FILE__)
6
+ require 'rspec/rails'
7
+ # Add additional requires below this line. Rails is not loaded until this point!
8
+
9
+
10
+ ActiveRecord::Migration.maintain_test_schema!
11
+
12
+ RSpec.configure do |config|
13
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
14
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
15
+
16
+ config.use_transactional_fixtures = true
17
+
18
+ config.infer_spec_type_from_file_location!
19
+ end
20
+
21
+ # improve the performance of the specs suite by not logging anything
22
+ # see http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/
23
+ Rails.logger.level = 4
@@ -0,0 +1,22 @@
1
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
2
+ require "bundler"
3
+ Bundler.setup
4
+
5
+ RSpec.configure do |config|
6
+
7
+ config.expect_with :rspec do |expectations|
8
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
9
+ end
10
+
11
+ config.mock_with :rspec do |mocks|
12
+ mocks.verify_partial_doubles = true
13
+ end
14
+
15
+ if config.files_to_run.one?
16
+ config.default_formatter = 'doc'
17
+ end
18
+
19
+ config.order = :random
20
+
21
+ Kernel.srand config.seed
22
+ end
metadata ADDED
@@ -0,0 +1,278 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stripe_saas
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brian Sam-Bodden
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 4.2.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 4.2.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: stripe
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.31'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.31'
47
+ - !ruby/object:Gem::Dependency
48
+ name: money-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.4'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.4'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec-rails
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.4'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.4'
75
+ - !ruby/object:Gem::Dependency
76
+ name: sqlite3
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.3'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.3'
89
+ - !ruby/object:Gem::Dependency
90
+ name: devise
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.4'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 3.4.1
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '3.4'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 3.4.1
109
+ description: Stripe Payments/Subscription Engine for Rails 4.
110
+ email:
111
+ - bsbodden@integrallis.com
112
+ executables: []
113
+ extensions: []
114
+ extra_rdoc_files: []
115
+ files:
116
+ - MIT-LICENSE
117
+ - README.asc
118
+ - Rakefile
119
+ - app/assets/javascripts/stripe_saas/application.js
120
+ - app/assets/stylesheets/stripe_saas/application.css
121
+ - app/concerns/stripe_saas/feature.rb
122
+ - app/concerns/stripe_saas/plan.rb
123
+ - app/concerns/stripe_saas/plan_feature.rb
124
+ - app/concerns/stripe_saas/subscription.rb
125
+ - app/controllers/stripe_saas/application_controller.rb
126
+ - app/controllers/stripe_saas/subscriptions_controller.rb
127
+ - app/helpers/stripe_saas/application_helper.rb
128
+ - app/views/stripe_saas/subscriptions/_card.html.erb
129
+ - app/views/stripe_saas/subscriptions/_card_form.html.erb
130
+ - app/views/stripe_saas/subscriptions/_pricing_table.html.erb
131
+ - app/views/stripe_saas/subscriptions/edit.html.erb
132
+ - app/views/stripe_saas/subscriptions/index.html.erb
133
+ - app/views/stripe_saas/subscriptions/new.html.erb
134
+ - app/views/stripe_saas/subscriptions/show.html.erb
135
+ - app/views/stripe_saas/subscriptions/unauthorized.html.erb
136
+ - config/environment.rb
137
+ - config/routes.rb
138
+ - lib/generators/stripe_saas/install_generator.rb
139
+ - lib/generators/stripe_saas/templates/app/models/feature.rb
140
+ - lib/generators/stripe_saas/templates/app/models/plan.rb
141
+ - lib/generators/stripe_saas/templates/app/models/plan_feature.rb
142
+ - lib/generators/stripe_saas/templates/app/models/subscription.rb
143
+ - lib/generators/stripe_saas/templates/config/initializers/stripe_saas.rb
144
+ - lib/generators/stripe_saas/views_generator.rb
145
+ - lib/stripe_saas.rb
146
+ - lib/stripe_saas/configuration.rb
147
+ - lib/stripe_saas/engine.rb
148
+ - lib/stripe_saas/version.rb
149
+ - lib/tasks/stripe_saas_tasks.rake
150
+ - spec/concerns/plan_spec.rb
151
+ - spec/dummy/README.rdoc
152
+ - spec/dummy/Rakefile
153
+ - spec/dummy/app/assets/javascripts/application.js
154
+ - spec/dummy/app/assets/stylesheets/application.css
155
+ - spec/dummy/app/controllers/application_controller.rb
156
+ - spec/dummy/app/helpers/application_helper.rb
157
+ - spec/dummy/app/models/plan.rb
158
+ - spec/dummy/app/models/subscription.rb
159
+ - spec/dummy/app/models/user.rb
160
+ - spec/dummy/app/views/layouts/application.html.erb
161
+ - spec/dummy/bin/bundle
162
+ - spec/dummy/bin/rails
163
+ - spec/dummy/bin/rake
164
+ - spec/dummy/bin/setup
165
+ - spec/dummy/config.ru
166
+ - spec/dummy/config/application.rb
167
+ - spec/dummy/config/boot.rb
168
+ - spec/dummy/config/database.yml
169
+ - spec/dummy/config/environment.rb
170
+ - spec/dummy/config/environments/development.rb
171
+ - spec/dummy/config/environments/production.rb
172
+ - spec/dummy/config/environments/test.rb
173
+ - spec/dummy/config/initializers/assets.rb
174
+ - spec/dummy/config/initializers/backtrace_silencers.rb
175
+ - spec/dummy/config/initializers/cookies_serializer.rb
176
+ - spec/dummy/config/initializers/devise.rb
177
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
178
+ - spec/dummy/config/initializers/inflections.rb
179
+ - spec/dummy/config/initializers/mime_types.rb
180
+ - spec/dummy/config/initializers/session_store.rb
181
+ - spec/dummy/config/initializers/stripe_saas.rb
182
+ - spec/dummy/config/initializers/wrap_parameters.rb
183
+ - spec/dummy/config/locales/devise.en.yml
184
+ - spec/dummy/config/locales/en.yml
185
+ - spec/dummy/config/routes.rb
186
+ - spec/dummy/config/secrets.yml
187
+ - spec/dummy/db/development.sqlite3
188
+ - spec/dummy/db/migrate/20150101233243_devise_create_users.rb
189
+ - spec/dummy/db/migrate/20150102001921_create_subscriptions.rb
190
+ - spec/dummy/db/migrate/20150102001930_create_plans.rb
191
+ - spec/dummy/db/schema.rb
192
+ - spec/dummy/db/test.sqlite3
193
+ - spec/dummy/log/development.log
194
+ - spec/dummy/log/test.log
195
+ - spec/dummy/public/404.html
196
+ - spec/dummy/public/422.html
197
+ - spec/dummy/public/500.html
198
+ - spec/dummy/public/favicon.ico
199
+ - spec/integration/navigation_test.rb
200
+ - spec/rails_helper.rb
201
+ - spec/spec_helper.rb
202
+ homepage: https://github.com/integrallis/stripe_saas
203
+ licenses:
204
+ - MIT
205
+ metadata: {}
206
+ post_install_message:
207
+ rdoc_options: []
208
+ require_paths:
209
+ - lib
210
+ required_ruby_version: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ required_rubygems_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ requirements: []
221
+ rubyforge_project:
222
+ rubygems_version: 2.4.8
223
+ signing_key:
224
+ specification_version: 4
225
+ summary: Stripe Payments/Subscription Engine for Rails 4.
226
+ test_files:
227
+ - spec/concerns/plan_spec.rb
228
+ - spec/dummy/app/assets/javascripts/application.js
229
+ - spec/dummy/app/assets/stylesheets/application.css
230
+ - spec/dummy/app/controllers/application_controller.rb
231
+ - spec/dummy/app/helpers/application_helper.rb
232
+ - spec/dummy/app/models/plan.rb
233
+ - spec/dummy/app/models/subscription.rb
234
+ - spec/dummy/app/models/user.rb
235
+ - spec/dummy/app/views/layouts/application.html.erb
236
+ - spec/dummy/bin/bundle
237
+ - spec/dummy/bin/rails
238
+ - spec/dummy/bin/rake
239
+ - spec/dummy/bin/setup
240
+ - spec/dummy/config/application.rb
241
+ - spec/dummy/config/boot.rb
242
+ - spec/dummy/config/database.yml
243
+ - spec/dummy/config/environment.rb
244
+ - spec/dummy/config/environments/development.rb
245
+ - spec/dummy/config/environments/production.rb
246
+ - spec/dummy/config/environments/test.rb
247
+ - spec/dummy/config/initializers/assets.rb
248
+ - spec/dummy/config/initializers/backtrace_silencers.rb
249
+ - spec/dummy/config/initializers/cookies_serializer.rb
250
+ - spec/dummy/config/initializers/devise.rb
251
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
252
+ - spec/dummy/config/initializers/inflections.rb
253
+ - spec/dummy/config/initializers/mime_types.rb
254
+ - spec/dummy/config/initializers/session_store.rb
255
+ - spec/dummy/config/initializers/stripe_saas.rb
256
+ - spec/dummy/config/initializers/wrap_parameters.rb
257
+ - spec/dummy/config/locales/devise.en.yml
258
+ - spec/dummy/config/locales/en.yml
259
+ - spec/dummy/config/routes.rb
260
+ - spec/dummy/config/secrets.yml
261
+ - spec/dummy/config.ru
262
+ - spec/dummy/db/development.sqlite3
263
+ - spec/dummy/db/migrate/20150101233243_devise_create_users.rb
264
+ - spec/dummy/db/migrate/20150102001921_create_subscriptions.rb
265
+ - spec/dummy/db/migrate/20150102001930_create_plans.rb
266
+ - spec/dummy/db/schema.rb
267
+ - spec/dummy/db/test.sqlite3
268
+ - spec/dummy/log/development.log
269
+ - spec/dummy/log/test.log
270
+ - spec/dummy/public/404.html
271
+ - spec/dummy/public/422.html
272
+ - spec/dummy/public/500.html
273
+ - spec/dummy/public/favicon.ico
274
+ - spec/dummy/Rakefile
275
+ - spec/dummy/README.rdoc
276
+ - spec/integration/navigation_test.rb
277
+ - spec/rails_helper.rb
278
+ - spec/spec_helper.rb