wbase 0.0.4 → 0.0.5

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.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +219 -2
  3. data/app/assets/javascripts/wbase/auth/bootstrap.min.js +7 -0
  4. data/app/assets/javascripts/wbase/auth/detect.js +7 -0
  5. data/app/assets/javascripts/wbase/auth/fastclick.js +841 -0
  6. data/app/assets/javascripts/wbase/auth/jquery.app.js +318 -0
  7. data/app/assets/javascripts/wbase/auth/jquery.blockUI.js +620 -0
  8. data/app/assets/javascripts/wbase/auth/jquery.core.js +323 -0
  9. data/app/assets/javascripts/wbase/auth/jquery.min.js +5 -0
  10. data/app/assets/javascripts/wbase/auth/jquery.nicescroll.js +113 -0
  11. data/app/assets/javascripts/wbase/auth/jquery.scrollTo.min.js +7 -0
  12. data/app/assets/javascripts/wbase/auth/jquery.slimscroll.js +474 -0
  13. data/app/assets/javascripts/wbase/auth/modernizr.min.js +1 -0
  14. data/app/assets/javascripts/wbase/auth/pace.min.js +2 -0
  15. data/app/assets/javascripts/wbase/auth/waves.js +498 -0
  16. data/app/assets/javascripts/wbase/auth/wow.min.js +2 -0
  17. data/app/assets/javascripts/wbase/auth.js +12 -0
  18. data/app/assets/stylesheets/wbase/auth/components.css +2362 -0
  19. data/app/assets/stylesheets/wbase/auth/core.css +2190 -0
  20. data/app/assets/stylesheets/wbase/auth/icons.css +12067 -0
  21. data/app/assets/stylesheets/wbase/auth/pages.css +2039 -0
  22. data/app/assets/stylesheets/wbase/auth/responsive.css +162 -0
  23. data/app/assets/stylesheets/wbase/auth/typicons.css +1370 -0
  24. data/app/assets/stylesheets/wbase/auth/variables.css +0 -0
  25. data/app/assets/stylesheets/wbase/auth.scss +9 -0
  26. data/app/controllers/wbase/application_controller.rb +13 -0
  27. data/app/controllers/wbase/mail_events_controller.rb +21 -0
  28. data/app/controllers/wbase/password_resets_controller.rb +43 -0
  29. data/app/controllers/wbase/sessions_controller.rb +35 -0
  30. data/app/controllers/wbase/static_pages_controller.rb +4 -0
  31. data/app/controllers/wbase/stripe_webhooks_controller.rb +54 -0
  32. data/app/controllers/wbase/subscriptions_controller.rb +50 -0
  33. data/app/controllers/wbase/users_controller.rb +65 -0
  34. data/app/helpers/wbase/auth_helper.rb +44 -0
  35. data/app/jobs/wbase/activate_drip_subscriber_job.rb +15 -0
  36. data/app/jobs/wbase/create_drip_subscriber_job.rb +13 -0
  37. data/app/jobs/wbase/dripable.rb +22 -0
  38. data/app/mailers/application_mailer.rb +4 -0
  39. data/app/mailers/wbase/admin_mailer.rb +35 -0
  40. data/app/mailers/wbase/password_reset_mailer.rb +20 -0
  41. data/app/models/wbase/mail_event.rb +21 -0
  42. data/app/models/wbase/plan.rb +26 -0
  43. data/app/models/wbase/ssl_verification.rb +21 -0
  44. data/app/models/wbase/stripe_webhook.rb +22 -0
  45. data/app/models/wbase/subscription.rb +47 -0
  46. data/app/models/wbase/userable.rb +85 -0
  47. data/app/services/wbase/mail_event_batch.rb +22 -0
  48. data/app/services/wbase/start_subscription.rb +81 -0
  49. data/app/views/layouts/mailer.html.erb +53 -0
  50. data/app/views/layouts/mailer.text.erb +1 -0
  51. data/app/views/layouts/wbase/_common_head.html.erb +46 -0
  52. data/app/views/layouts/wbase/auth.html.erb +23 -0
  53. data/app/views/layouts/wbase/landing.html.erb +9 -56
  54. data/app/views/shared/_errors.html.erb +10 -0
  55. data/app/views/wbase/admin_mailer/new_subscription.html.erb +33 -0
  56. data/app/views/wbase/admin_mailer/new_user.html.erb +7 -0
  57. data/app/views/wbase/password_reset_mailer/reset.html.erb +10 -0
  58. data/app/views/wbase/password_reset_mailer/reset.text.erb +5 -0
  59. data/app/views/wbase/password_resets/edit.html.erb +22 -0
  60. data/app/views/wbase/password_resets/new.html.erb +41 -0
  61. data/app/views/wbase/sessions/new.html.erb +58 -0
  62. data/app/views/wbase/static_pages/landing/_pricing.html.erb +6 -2
  63. data/app/views/wbase/static_pages/start.html.erb +1 -1
  64. data/app/views/wbase/static_pages/welcome.html.erb +1 -1
  65. data/app/views/wbase/subscriptions/edit.html.erb +2 -0
  66. data/app/views/wbase/subscriptions/new.html.erb +91 -0
  67. data/app/views/wbase/subscriptions/show.html.erb +2 -0
  68. data/app/views/wbase/users/_affiliate.html.erb +66 -0
  69. data/app/views/wbase/users/_plan.html.erb +11 -0
  70. data/app/views/wbase/users/_plans.html.erb +11 -0
  71. data/app/views/wbase/users/edit.html.erb +2 -0
  72. data/app/views/wbase/users/new.html.erb +38 -0
  73. data/app/views/wbase/users/show.html.erb +37 -0
  74. data/config/initializers/assets.rb +1 -3
  75. data/config/routes.rb +9 -0
  76. data/db/migrate/20161127212521_create_wbase_subscriptions.rb +17 -0
  77. data/db/migrate/20161127212831_create_wbase_plans.rb +15 -0
  78. data/db/migrate/20161127224117_create_wbase_ssl_verifications.rb +10 -0
  79. data/db/migrate/20161128022640_create_wbase_mail_events.rb +16 -0
  80. data/db/migrate/20161128031211_create_wbase_stripe_webhooks.rb +17 -0
  81. data/lib/wbase/engine.rb +37 -28
  82. data/lib/wbase/version.rb +1 -1
  83. data/test/controllers/wbase/mail_events_controller_test.rb +13 -0
  84. data/test/controllers/wbase/password_resets_controller_test.rb +13 -0
  85. data/test/controllers/wbase/sessions_controller_test.rb +13 -0
  86. data/test/controllers/wbase/stripe_webhooks_controller_test.rb +13 -0
  87. data/test/controllers/wbase/subscriptions_controller_test.rb +13 -0
  88. data/test/controllers/wbase/users_controller_test.rb +13 -0
  89. data/test/dummy/config/database.yml +4 -7
  90. data/test/dummy/db/development.sqlite3 +0 -0
  91. data/test/dummy/db/schema.rb +85 -0
  92. data/test/dummy/log/development.log +225 -0
  93. data/test/fixtures/wbase/mail_events.yml +38 -0
  94. data/test/fixtures/wbase/plans.yml +40 -0
  95. data/test/fixtures/wbase/stripe_webhooks.yml +41 -0
  96. data/test/fixtures/wbase/subscriptions.yml +46 -0
  97. data/test/jobs/wbase/activate_drip_subscriber_job_test.rb +9 -0
  98. data/test/jobs/wbase/create_drip_subscriber_job_job_test.rb +9 -0
  99. data/test/mailers/previews/wbase/admin_mailer_preview.rb +11 -0
  100. data/test/mailers/previews/wbase/password_reset_mailer_preview.rb +11 -0
  101. data/test/mailers/wbase/admin_mailer_test.rb +14 -0
  102. data/test/mailers/wbase/password_reset_mailer_test.rb +14 -0
  103. data/test/models/wbase/mail_event_test.rb +26 -0
  104. data/test/models/wbase/plan_test.rb +30 -0
  105. data/test/models/wbase/ssl_verification_test.rb +20 -0
  106. data/test/models/wbase/stripe_webhook_test.rb +27 -0
  107. data/test/models/wbase/subscription_test.rb +32 -0
  108. metadata +121 -12
  109. data/app/helpers/wbase/application_helper.rb +0 -4
  110. data/app/helpers/wbase/static_pages_helper.rb +0 -4
  111. data/app/views/wbase/static_pages/_map.html.erb +0 -17
  112. data/app/views/wbase/static_pages/_order_stats.html.erb +0 -28
  113. data/app/views/wbase/static_pages/_pricing.html.erb +0 -89
  114. data/app/views/wbase/static_pages/_stats.html.erb +0 -28
  115. data/app/views/wbase/static_pages/_testimonial.html.erb +0 -16
  116. data/app/views/wbase/static_pages/affiliate.html.erb +0 -54
  117. data/app/views/wbase/static_pages/faq.html.erb +0 -63
@@ -0,0 +1,91 @@
1
+ <div class="panel-heading">
2
+ <h3 class="text-center">
3
+ <%= current_user.get_selected_plan.name %>
4
+ </h3>
5
+ </div>
6
+
7
+ <p class="text-center">
8
+ <%= number_to_currency(current_user.get_selected_plan.price) %> / <small>month</small>
9
+ </p>
10
+
11
+ <p class="text-center">
12
+ <%= link_to "See other plans", "/welcome#pricing-section" %>
13
+ </p>
14
+
15
+ <script type="text/javascript" src="https://js.stripe.com/v2/"></script>
16
+ <script type="text/javascript">
17
+ Stripe.setPublishableKey('<%= ENV["STRIPE_PUBLISHABLE_KEY"] %>');
18
+ </script>
19
+
20
+ <form action="/subscription" method="POST" id="payment-form">
21
+ <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
22
+ <input type="hidden" name="subscription[plan_id]" value="<%= current_user.get_selected_plan.id %>">
23
+ <span class="payment-errors"></span>
24
+
25
+ <div class="form-group">
26
+ <label for="card-number" class="control-label">Card Number</label>
27
+ <input id="card-number" type="text" size="20" data-stripe="number" class="form-control boxed" autofocus>
28
+ </div>
29
+
30
+ <div class="row form-group">
31
+ <div class="col-xs-6">
32
+ <label for="exp_month">Exp (MM / YY)</label>
33
+ </div>
34
+ <div class="col-xs-4 col-xs-offset-2">
35
+ <label for="cvc">CVC</label>
36
+ </div>
37
+ <div class="col-xs-3">
38
+ <input id="exp_month" type="text" size="2" data-stripe="exp_month" class="form-control boxed" placeholder="MM">
39
+ </div>
40
+ <div class="col-xs-3">
41
+ <input type="text" size="2" data-stripe="exp_year" class="form-control boxed" placeholder="YY">
42
+ </div>
43
+ <div class="col-xs-4 col-xs-offset-2">
44
+ <input id="cvc" type="text" size="4" data-stripe="cvc" class="form-control boxed" placeholder="CVC">
45
+ </div>
46
+ </div>
47
+
48
+ <input type="submit" class="submit btn btn-block btn-primary" value="Get Started!">
49
+ <hr>
50
+
51
+ <div class="form-group">
52
+ <p class="text-muted text-center"><a href="/logout">Nevermind...</a></p>
53
+ </div>
54
+ </form>
55
+
56
+ <% content_for :javascripts do %>
57
+ <script type="text/javascript">
58
+ function stripeResponseHandler(status, response) {
59
+ // Grab the form:
60
+ var $form = $('#payment-form');
61
+
62
+ if (response.error) { // Problem!
63
+ // Show the errors on the form:
64
+ $form.find('.payment-errors').text(response.error.message);
65
+ $form.find('.submit').prop('disabled', false); // Re-enable submission
66
+ } else { // Token was created!
67
+ // Get the token ID:
68
+ var token = response.id,
69
+ lastFour = response.card.last4,
70
+ cardType = response.card.brand;
71
+ // Insert the token ID into the form so it gets submitted to the server:
72
+ $form.append($('<input type="hidden" name="subscription[credit_card_token]">').val(token));
73
+ $form.append($('<input type="hidden" name="subscription[last_four]">').val(lastFour));
74
+ $form.append($('<input type="hidden" name="subscription[card_type]">').val(cardType));
75
+ // Submit the form:
76
+ $form.get(0).submit();
77
+ }
78
+ };
79
+ $(function() {
80
+ var $form = $('#payment-form');
81
+ $form.submit(function(event) {
82
+ // Disable the submit button to prevent repeated clicks:
83
+ $form.find('.submit').prop('disabled', true);
84
+ // Request a token from Stripe:
85
+ Stripe.card.createToken($form, stripeResponseHandler);
86
+ // Prevent the form from being submitted:
87
+ return false;
88
+ });
89
+ });
90
+ </script>
91
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h1>Subscriptions#show</h1>
2
+ <p>Find me in app/views/subscriptions/show.html.erb</p>
@@ -0,0 +1,66 @@
1
+ <div class="card-block">
2
+ <div class="title-block">
3
+ <h4 class="title">
4
+ Account Settings
5
+ </h4>
6
+ <p class="title-description"></p>
7
+ </div>
8
+ <div class="row row-sm">
9
+ <div class="col-xs-12 col-sm-12 stat-col">
10
+ <div class="stat-icon">
11
+ <i class="fa fa-rocket"></i>
12
+ </div>
13
+ <div class="stat">
14
+ <div class="value"> <%= current_user.email %></div>
15
+ <div class="name"> Email </div>
16
+ </div>
17
+ <progress class="progress stat-progress" value="100" max="100">
18
+ <div class="progress">
19
+ <span class="progress-bar" style="width: 100%;"></span>
20
+ </div>
21
+ </progress>
22
+ </div>
23
+ <div class="col-xs-12 col-sm-12 stat-col">
24
+ <div class="stat-icon">
25
+ <i class="fa fa-pencil-square-o"></i>
26
+ </div>
27
+ <div class="stat">
28
+ <div class="value"> 1 </div>
29
+ <div class="name"> Active Forms </div>
30
+ </div>
31
+ <progress class="progress stat-progress" value="100" max="100">
32
+ <div class="progress">
33
+ <span class="progress-bar" style="width: 100%;"></span>
34
+ </div>
35
+ </progress>
36
+ </div>
37
+ <div class="col-xs-12 col-sm-12 stat-col">
38
+ <div class="stat-icon">
39
+ <i class="fa fa-link"></i>
40
+ </div>
41
+ <div class="stat">
42
+ <div class="value"> <%= new_user_url(af: current_user.affiliate_key) %> </div>
43
+ <div class="name"> Invite Link </div>
44
+ </div>
45
+ <progress class="progress stat-progress" value="100" max="100">
46
+ <div class="progress">
47
+ <span class="progress-bar" style="width: 100%;"></span>
48
+ </div>
49
+ </progress>
50
+ </div>
51
+ <div class="col-xs-12 col-sm-12 stat-col">
52
+ <div class="stat-icon">
53
+ <i class="fa fa-key"></i>
54
+ </div>
55
+ <div class="stat">
56
+ <div class="value"> <%= current_user.api_key %> </div>
57
+ <div class="name"> API Key (Use with Zapier) </div>
58
+ </div>
59
+ <progress class="progress stat-progress" value="100" max="100">
60
+ <div class="progress">
61
+ <span class="progress-bar" style="width: 100%;"></span>
62
+ </div>
63
+ </progress>
64
+ </div>
65
+ </div>
66
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="card-block">
2
+ <div class="title-block">
3
+ <h4 class="title">
4
+ Current Plan
5
+ </h4>
6
+ <p class="title-description"></p>
7
+ </div>
8
+ <div class="row row-sm">
9
+ <%= current_user.subscription.plan.name %>
10
+ </div>
11
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="card-block">
2
+ <div class="title-block">
3
+ <h4 class="title">
4
+ Available Plans
5
+ </h4>
6
+ <p class="title-description"></p>
7
+ </div>
8
+ <div class="row row-sm">
9
+ <%= render partial: 'static_pages/pricing' %>
10
+ </div>
11
+ </div>
@@ -0,0 +1,2 @@
1
+ <h1>Users#edit</h1>
2
+ <p>Find me in app/views/users/edit.html.erb</p>
@@ -0,0 +1,38 @@
1
+ <div class="panel-heading">
2
+ <h3 class="text-center">
3
+ Sign Up for
4
+ <strong class="text-custom"><%= Wbase.site_name %></strong>
5
+ </h3>
6
+ </div>
7
+
8
+ <div class="panel-body">
9
+ <form class="form-horizontal m-t-20" action="/user" method="POST">
10
+ <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
11
+
12
+ <div class="form-group ">
13
+ <div class="col-xs-12">
14
+ <label for="email">Email</label>
15
+ <input class="form-control" id="email" type="email" name="user[email]" required="" placeholder="first.last@gmail.com">
16
+ </div>
17
+ </div>
18
+
19
+ <div class="form-group">
20
+ <div class="col-xs-12">
21
+ <label for="password">Password</label>
22
+ <input class="form-control" id="password" type="password" name="user[password]" required="" placeholder="Password">
23
+ </div>
24
+ </div>
25
+
26
+ <div class="form-group text-center m-t-40">
27
+ <div class="col-xs-12">
28
+ <button class="btn btn-pink btn-block text-uppercase waves-effect waves-light" type="submit">Sign Up</button>
29
+ </div>
30
+ </div>
31
+ </form>
32
+ </div>
33
+
34
+ <div class="row">
35
+ <div class="col-sm-12 text-center">
36
+ <p>Already have an account? <a href="/session/new" class="m-l-5"><b>Log In</b></a></p>
37
+ </div>
38
+ </div>
@@ -0,0 +1,37 @@
1
+ <article class="content dashboard-page">
2
+ <div class="title-block">
3
+ <h3 class="title">
4
+ <%= current_user.email %>
5
+ <p class="title-description">
6
+ Settings
7
+ </p>
8
+ <span class="sparkline bar" data-type="bar"></span>
9
+ </h3>
10
+ </div>
11
+
12
+ <section class="section">
13
+ <div class="row sameheight-container">
14
+ <% if flash[:errors] %>
15
+ <div class="alert alert-danger">
16
+ <% flash[:errors].each do |error| %>
17
+ <%= error %>
18
+ <% end %>
19
+ </div>
20
+ <% end %>
21
+ <div class="col-md-6">
22
+ <div class="card card-block">
23
+ <h3>Account</h3>
24
+ <form action="/user" method="post">
25
+ <input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
26
+ <input type="hidden" name="_method" value="PUT" />
27
+ <div class="form-group">
28
+ <label for="email">Email</label>
29
+ <input type="email" id="email" name="user[email]" class="form-control" value="<%= current_user.email %>">
30
+ </div>
31
+ <button class="btn btn-success-outline">Update</button>
32
+ </form>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ </article>
@@ -1,5 +1,3 @@
1
- # Rails.application.config.assets.precompile += [/^[-_a-zA-Z0-9]*\..*/]
2
1
  Rails.application.config.assets.paths << Rails.root.join('assets', 'wbase', 'fonts')
3
- Rails.application.config.assets.precompile += %w( wbase/landing.css )
4
- Rails.application.config.assets.precompile += %w( wbase/landing.js )
2
+ Rails.application.config.assets.precompile += %w( wbase/landing.css wbase/landing.js wbase/auth.css wbase/auth.js )
5
3
  Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
data/config/routes.rb CHANGED
@@ -14,4 +14,13 @@ Wbase::Engine.routes.draw do
14
14
  get "/#{ action }", to: "static_pages##{ action }"
15
15
  get "/#{ action.gsub('_', '-') }", to: "static_pages##{ action }"
16
16
  end
17
+
18
+ get '/logout', to: 'sessions#destroy'
19
+ resource :user, exclude: [:destroy]
20
+ resource :session, only: [:new, :create, :destroy]
21
+ resource :password_reset, only: [:new, :create, :edit, :update]
22
+ resource :subscription, only: [:new, :create]
23
+ resources :mail_events
24
+ resources :stripe_webhooks
25
+ get '/.well-known/acme-challenge/:id' => 'static_pages#letsencrypt'
17
26
  end
@@ -0,0 +1,17 @@
1
+ class CreateWbaseSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ create_table :wbase_subscriptions do |t|
4
+ t.string :stripe_id, null: false
5
+ t.integer :plan_id, null: false, index: true
6
+ t.string :last_four
7
+ t.integer :coupon_id
8
+ t.string :card_type
9
+ t.integer :current_price
10
+ t.integer :user_id, null: false, index: true
11
+ t.datetime :paid_thru
12
+ t.string :credit_card_token
13
+
14
+ t.timestamps null: false
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ class CreateWbasePlans < ActiveRecord::Migration
2
+ def change
3
+ create_table :wbase_plans do |t|
4
+ t.string :name, null: false, index: true
5
+ t.string :stripe_id, null: false, index: true
6
+ t.integer :price, null: false
7
+ t.string :interval, default: 'monthly'
8
+ t.text :features
9
+ t.boolean :highlight, default: false
10
+ t.integer :display_order, default: 0
11
+
12
+ t.timestamps null: false
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ class CreateWbaseSslVerifications < ActiveRecord::Migration
2
+ def change
3
+ create_table :wbase_ssl_verifications do |t|
4
+ t.string :key, null: false
5
+ t.string :value, null: false
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ class CreateWbaseMailEvents < ActiveRecord::Migration
2
+ def change
3
+ create_table :wbase_mail_events do |t|
4
+ t.string :sg_message_id
5
+ t.string :email
6
+ t.string :timestamp
7
+ t.string :smtp_id
8
+ t.string :event
9
+ t.json :data
10
+ t.integer :mail_eventable_id
11
+ t.string :mail_eventable_type
12
+
13
+ t.timestamps null: false
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ class CreateWbaseStripeWebhooks < ActiveRecord::Migration
2
+ def change
3
+ create_table :wbase_stripe_webhooks do |t|
4
+ t.string :external_id
5
+ t.string :object
6
+ t.string :api_version
7
+ t.datetime :created
8
+ t.json :data
9
+ t.boolean :livemode
10
+ t.integer :pending_webhooks
11
+ t.string :external_type
12
+ t.string :external_request
13
+
14
+ t.timestamps null: false
15
+ end
16
+ end
17
+ end
data/lib/wbase/engine.rb CHANGED
@@ -8,6 +8,8 @@ module Wbase
8
8
  :image,
9
9
  :keywords,
10
10
  :site_name,
11
+ :admin_email,
12
+ :firehose_email,
11
13
 
12
14
  # Landing
13
15
  :sub_title,
@@ -29,35 +31,35 @@ module Wbase
29
31
  :testimonials,
30
32
  :socials,
31
33
  :plans].each do |setting|
32
- mattr_accessor setting do
33
- []
34
- end
35
- end
34
+ mattr_accessor setting do
35
+ []
36
+ end
37
+ end
36
38
 
37
- landing_sections = [
38
- :nav,
39
- :header,
40
- :features,
41
- :description,
42
- :video,
43
- :customers,
44
- :pricing,
45
- :trial,
46
- :about,
47
- :newsletter,
48
- :team,
49
- :social,
50
- :contact,
51
- :footer,
52
- ]
53
- landing_sections.each do |setting|
54
- mattr_accessor setting do
55
- true
56
- end
57
- end
58
- mattr_accessor :landing_sections do
59
- landing_sections
60
- end
39
+ landing_sections = [
40
+ :nav_view,
41
+ :header_view,
42
+ :features_view,
43
+ :description_view,
44
+ :video_view,
45
+ :customers_view,
46
+ :pricing_view,
47
+ :trial_view,
48
+ :about_view,
49
+ :newsletter_view,
50
+ :team_view,
51
+ :social_view,
52
+ :contact_view,
53
+ :footer_view,
54
+ ]
55
+ landing_sections.each do |setting|
56
+ mattr_accessor setting do
57
+ true
58
+ end
59
+ end
60
+ mattr_accessor :landing_sections do
61
+ landing_sections
62
+ end
61
63
  end
62
64
 
63
65
  def self.setup(&block)
@@ -66,5 +68,12 @@ module Wbase
66
68
 
67
69
  class Engine < ::Rails::Engine
68
70
  isolate_namespace Wbase
71
+ config.generators do |g|
72
+ g.orm :active_record
73
+ g.template_engine :erb
74
+ end
75
+ config.to_prepare do
76
+ Wbase::ApplicationController.helper Rails.application.helpers
77
+ end
69
78
  end
70
79
  end
data/lib/wbase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wbase
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class MailEventsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class PasswordResetsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class SessionsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class StripeWebhooksControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class SubscriptionsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Wbase
4
+ class UsersControllerTest < ActionController::TestCase
5
+ setup do
6
+ @routes = Engine.routes
7
+ end
8
+
9
+ # test "the truth" do
10
+ # assert true
11
+ # end
12
+ end
13
+ end
@@ -5,21 +5,18 @@
5
5
  # gem 'sqlite3'
6
6
  #
7
7
  default: &default
8
- adapter: sqlite3
8
+ adapter: postgresql
9
+ encoding: unicode
9
10
  pool: 5
10
11
  timeout: 5000
11
12
 
12
13
  development:
13
14
  <<: *default
14
- database: db/development.sqlite3
15
+ database: wbase_dev
15
16
 
16
17
  # Warning: The database defined as "test" will be erased and
17
18
  # re-generated from your development database when you run "rake".
18
19
  # Do not set this db to the same as development or production.
19
20
  test:
20
21
  <<: *default
21
- database: db/test.sqlite3
22
-
23
- production:
24
- <<: *default
25
- database: db/production.sqlite3
22
+ database: wbase_test
Binary file
@@ -0,0 +1,85 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20161128031211) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "wbase_mail_events", force: :cascade do |t|
20
+ t.string "sg_message_id"
21
+ t.string "email"
22
+ t.string "timestamp"
23
+ t.string "smtp_id"
24
+ t.string "event"
25
+ t.json "data"
26
+ t.integer "mail_eventable_id"
27
+ t.string "mail_eventable_type"
28
+ t.datetime "created_at", null: false
29
+ t.datetime "updated_at", null: false
30
+ end
31
+
32
+ create_table "wbase_plans", force: :cascade do |t|
33
+ t.string "name", null: false
34
+ t.string "stripe_id", null: false
35
+ t.integer "price", null: false
36
+ t.string "interval", default: "monthly"
37
+ t.text "features"
38
+ t.boolean "highlight", default: false
39
+ t.integer "display_order", default: 0
40
+ t.datetime "created_at", null: false
41
+ t.datetime "updated_at", null: false
42
+ end
43
+
44
+ add_index "wbase_plans", ["name"], name: "index_wbase_plans_on_name", using: :btree
45
+ add_index "wbase_plans", ["stripe_id"], name: "index_wbase_plans_on_stripe_id", using: :btree
46
+
47
+ create_table "wbase_ssl_verifications", force: :cascade do |t|
48
+ t.string "key", null: false
49
+ t.string "value", null: false
50
+ t.datetime "created_at", null: false
51
+ t.datetime "updated_at", null: false
52
+ end
53
+
54
+ create_table "wbase_stripe_webhooks", force: :cascade do |t|
55
+ t.string "external_id"
56
+ t.string "object"
57
+ t.string "api_version"
58
+ t.datetime "created"
59
+ t.json "data"
60
+ t.boolean "livemode"
61
+ t.integer "pending_webhooks"
62
+ t.string "external_type"
63
+ t.string "external_request"
64
+ t.datetime "created_at", null: false
65
+ t.datetime "updated_at", null: false
66
+ end
67
+
68
+ create_table "wbase_subscriptions", force: :cascade do |t|
69
+ t.string "stripe_id", null: false
70
+ t.integer "plan_id", null: false
71
+ t.string "last_four"
72
+ t.integer "coupon_id"
73
+ t.string "card_type"
74
+ t.integer "current_price"
75
+ t.integer "user_id", null: false
76
+ t.datetime "paid_thru"
77
+ t.string "credit_card_token"
78
+ t.datetime "created_at", null: false
79
+ t.datetime "updated_at", null: false
80
+ end
81
+
82
+ add_index "wbase_subscriptions", ["plan_id"], name: "index_wbase_subscriptions_on_plan_id", using: :btree
83
+ add_index "wbase_subscriptions", ["user_id"], name: "index_wbase_subscriptions_on_user_id", using: :btree
84
+
85
+ end