bullet_train 1.0.24 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae940048404ec7a968aa4b625438760513aa6e5d7b54c23acf4e98e02b8c8247
4
- data.tar.gz: c68e36983962b73e19e4a73f890e134fcc45f5b529842b153c6833cfb0479afd
3
+ metadata.gz: f53e93d30c7a323663e913316ef0d2b705a052ab3f8f075e0ea25bcfb233f8ec
4
+ data.tar.gz: 8e33b7ca547682b3cc6b045167ecef56c133c15dd3b2e1996dd660af7871929b
5
5
  SHA512:
6
- metadata.gz: c7034e9fbe128558dfecc7295a013340074e226dd5cbe0a92ad723238cda09afb114e0ddfdc08d92fadda0f7c0299f21fe15bce8d10089813401d03e77354c10
7
- data.tar.gz: d1c87666fa40dac9185d7fbb6f8d5421e2753f089acdf49a1f6fe90f4e1f02cb6b8c041c706cfd3204fcf7733439b3042df4c016880846945f8b6809b8a3025a
6
+ metadata.gz: 8a676d76f96eedefab979c6c6dd3b871351133fb799e0b0618748b2738831ab444e814ddfe3634cd19bd408ad844e43901eac091c836156039865e78618bb7b2
7
+ data.tar.gz: 9f99942b4e68d2a21468fd557edaf14796482f69b385e5b1115af71eabce415d5968d418bb29525da65fd6d88344665cc06d5b4c2e6de0549bba02e76a6b39a5
@@ -0,0 +1,8 @@
1
+ module DocumentationSupport
2
+ extend ActiveSupport::Concern
3
+
4
+ def docs
5
+ @file = params[:page].presence || "index"
6
+ render :docs, layout: "docs"
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module InviteOnlySupport
2
+ extend ActiveSupport::Concern
3
+
4
+ def invitation
5
+ return not_found unless invitation_only?
6
+ return not_found unless params[:key].present?
7
+ return not_found unless invitation_keys.include?(params[:key])
8
+ session[:invitation_key] = params[:key]
9
+ if user_signed_in?
10
+ redirect_to new_account_team_path
11
+ else
12
+ redirect_to new_user_registration_path
13
+ end
14
+ end
15
+
16
+ def not_found
17
+ render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found
18
+ end
19
+ end
@@ -0,0 +1,11 @@
1
+ module RootRedirect
2
+ extend ActiveSupport::Concern
3
+
4
+ def index
5
+ if ENV["MARKETING_SITE_URL"]
6
+ redirect_to ENV["MARKETING_SITE_URL"]
7
+ else
8
+ redirect_to new_user_session_path
9
+ end
10
+ end
11
+ end
data/config/routes.rb CHANGED
@@ -1,6 +1,19 @@
1
1
  Rails.application.routes.draw do
2
+ scope module: "public" do
3
+ root to: "home#index"
4
+ get "invitation" => "home#invitation", :as => "invitation"
5
+
6
+ if Rails.env.production? ? ENV["ENABLE_DOCS"].present? : true
7
+ get "docs", to: "home#docs"
8
+ get "docs/*page", to: "home#docs"
9
+ end
10
+ end
11
+
2
12
  namespace :account do
3
13
  shallow do
14
+ # TODO we need to either implement a dashboard or deprecate this.
15
+ root to: "dashboard#index", as: "dashboard"
16
+
4
17
  resource :two_factor, only: [:create, :destroy]
5
18
 
6
19
  # user-level onboarding tasks.
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.24"
2
+ VERSION = "1.0.25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
@@ -373,7 +373,10 @@ files:
373
373
  - app/controllers/concerns/account/users/controller_base.rb
374
374
  - app/controllers/concerns/controllers/base.rb
375
375
  - app/controllers/concerns/devise_current_attributes.rb
376
+ - app/controllers/concerns/documentation_support.rb
377
+ - app/controllers/concerns/invite_only_support.rb
376
378
  - app/controllers/concerns/registrations/controller_base.rb
379
+ - app/controllers/concerns/root_redirect.rb
377
380
  - app/controllers/concerns/sessions/controller_base.rb
378
381
  - app/controllers/registrations_controller.rb
379
382
  - app/controllers/sessions_controller.rb