bullet_train 1.0.48 → 1.0.51

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: f97118eaaa7253406852b09625acb890ba8d2653e0266628795bde576044eec5
4
- data.tar.gz: 47688fa0493151a13a4b5060efd32703c9bc9bfa5a4f13052519c6afb6a864a6
3
+ metadata.gz: 6e120bbb8234554fc860e6bbdbf9376e1899e8c4c3e024075eb84a4dc60b9a10
4
+ data.tar.gz: 5f144328a9c105ad2b434fe0fccbf514973f54c41c698910fa36c5932ba6fd5e
5
5
  SHA512:
6
- metadata.gz: 5c750045603680f1d1ffcff0bbc7ffb1e3d334ca6e280f2d4332c2d5270ae94228d0f230876f63223d5aeeca146b5678a8b6fb9ed6b0656b3fecb7b5a751f54e
7
- data.tar.gz: 15a90ab25fa884ae6004423c6469d2dd974f08da0c88eae230cbd4e60bfb3c64af1011ff02c2bf6bfe1a732518324c8c55cb0898a10f88ca25e0c9e2059a21a8
6
+ metadata.gz: 382b6f890fa62609c0600b533958e89d67679bd6ff0c2a71e3c871566d878db20b405970e3dbb8353138e17c9c886df19e502914df51b45908c2091467631268
7
+ data.tar.gz: d0c09be2dc04291ed0bbe9d94857980e13a72823dea16f85e29edd9596ff8b5e890e46f60bf555bc24e5d8fc04b982bc3b5236711ef21976f1b73bcdf675d2e4
@@ -0,0 +1,2 @@
1
+ <%= render 'account/oauth/stripe_accounts/index', context: @user, stripe_accounts: @user.oauth_stripe_accounts if stripe_enabled? %>
2
+ <% # 🚅 super scaffolding will insert new oauth providers above this line. %>
@@ -23,8 +23,7 @@
23
23
  </div>
24
24
 
25
25
  <div class="xl:col-span-1 space-y-8">
26
- <%= render 'account/oauth/stripe_accounts/index', context: @user, stripe_accounts: @user.oauth_stripe_accounts if stripe_enabled? %>
27
- <% # 🚅 super scaffolding will insert new oauth providers above this line. %>
26
+ <%= render 'account/users/oauth' %>
28
27
 
29
28
  <%= render 'account/shared/box', divider: true do |p| %>
30
29
  <% p.content_for :title, t('.password.header') %>
@@ -1,2 +1,3 @@
1
+ <!-- This line is intentionally left blank. -->
1
2
  <%= render @needle do |p| %>
2
3
  <% end %>
@@ -23,7 +23,7 @@ Bullet Train's Super Scaffolding engine is a unique approach to code generation,
23
23
 
24
24
  ## Prerequisites
25
25
 
26
- Before getting started with Super Scaffolding, we recommend reading about [the philosophy of domain modeling in Bullet Train](/docs/topics/domain-modeling.md).
26
+ Before getting started with Super Scaffolding, we recommend reading about [the philosophy of domain modeling in Bullet Train](/docs/modeling.md).
27
27
 
28
28
  ## Usage
29
29
 
@@ -0,0 +1,18 @@
1
+ require "unicode/emoji"
2
+
3
+ module BulletTrain
4
+ module CoreExt
5
+ module StringEmojiHelper
6
+ def strip_emojis
7
+ gsub(Unicode::Emoji::REGEX, "")
8
+ end
9
+
10
+ def only_emoji?
11
+ return false if strip.empty?
12
+ strip_emojis.strip.empty?
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ String.include(BulletTrain::CoreExt::StringEmojiHelper)
@@ -92,7 +92,7 @@ module BulletTrain
92
92
  result[:absolute_path] = class_path || partial_path || locale_path || file_path
93
93
 
94
94
  if result[:absolute_path]
95
- base_path = "bullet_train" + result[:absolute_path].split("/bullet_train").last
95
+ base_path = "bullet_train" + result[:absolute_path].partition("/bullet_train").last
96
96
 
97
97
  # Try to calculate which package the file is from, and what it's path is within that project.
98
98
  ["app", "config", "lib"].each do |directory|
@@ -138,7 +138,9 @@ module BulletTrain
138
138
 
139
139
  def file_path
140
140
  # We don't have to do anything here... the absolute path is what we're passed, and we just pass it back.
141
- @needle
141
+ if @needle[0] == "/"
142
+ @needle
143
+ end
142
144
  end
143
145
 
144
146
  def locale_path
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.48"
2
+ VERSION = "1.0.51"
3
3
  end
data/lib/bullet_train.rb CHANGED
@@ -9,7 +9,7 @@ require "bullet_train/has_uuid"
9
9
  require "bullet_train/scope_validator"
10
10
 
11
11
  require "colorizer"
12
- require "string/emoji"
12
+ require "bullet_train/core_ext/string_emoji_helper"
13
13
 
14
14
  require "devise"
15
15
  # require "devise-two-factor"
@@ -97,11 +97,14 @@ def two_factor_authentication_enabled?
97
97
  ENV["TWO_FACTOR_ENCRYPTION_KEY"].present?
98
98
  end
99
99
 
100
- def any_oauth_enabled?
101
- [
102
- stripe_enabled?,
103
- # 🚅 super scaffolding will insert new oauth provider checks above this line.
104
- ].select(&:present?).any?
100
+ # Don't redefine this if an application redefines it locally.
101
+ unless defined?(any_oauth_enabled?)
102
+ def any_oauth_enabled?
103
+ [
104
+ stripe_enabled?,
105
+ # 🚅 super scaffolding will insert new oauth provider checks above this line.
106
+ ].select(&:present?).any?
107
+ end
105
108
  end
106
109
 
107
110
  def invitation_only?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.48
4
+ version: 1.0.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-07 00:00:00.000000000 Z
11
+ date: 2022-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -360,6 +360,20 @@ dependencies:
360
360
  - - ">="
361
361
  - !ruby/object:Gem::Version
362
362
  version: '0'
363
+ - !ruby/object:Gem::Dependency
364
+ name: unicode-emoji
365
+ requirement: !ruby/object:Gem::Requirement
366
+ requirements:
367
+ - - ">="
368
+ - !ruby/object:Gem::Version
369
+ version: '0'
370
+ type: :runtime
371
+ prerelease: false
372
+ version_requirements: !ruby/object:Gem::Requirement
373
+ requirements:
374
+ - - ">="
375
+ - !ruby/object:Gem::Version
376
+ version: '0'
363
377
  description: Bullet Train
364
378
  email:
365
379
  - andrew.culver@gmail.com
@@ -476,6 +490,7 @@ files:
476
490
  - app/views/account/users/_breadcrumbs.html.erb
477
491
  - app/views/account/users/_fields.html.erb
478
492
  - app/views/account/users/_form.html.erb
493
+ - app/views/account/users/_oauth.html.erb
479
494
  - app/views/account/users/edit.html.erb
480
495
  - app/views/account/users/show.html.erb
481
496
  - app/views/bullet_train/partial_resolver.html.erb
@@ -578,11 +593,11 @@ files:
578
593
  - docs/webhooks/incoming.md
579
594
  - docs/webhooks/outgoing.md
580
595
  - lib/bullet_train.rb
596
+ - lib/bullet_train/core_ext/string_emoji_helper.rb
581
597
  - lib/bullet_train/engine.rb
582
598
  - lib/bullet_train/resolver.rb
583
599
  - lib/bullet_train/version.rb
584
600
  - lib/colorizer.rb
585
- - lib/string/emoji.rb
586
601
  - lib/tasks/bullet_train_tasks.rake
587
602
  homepage: https://github.com/bullet-train-co/bullet_train
588
603
  licenses:
data/lib/string/emoji.rb DELETED
@@ -1,10 +0,0 @@
1
- class String
2
- def strip_emojis
3
- gsub(Unicode::Emoji::REGEX, "")
4
- end
5
-
6
- def only_emoji?
7
- return false if strip.empty?
8
- strip_emojis.strip.empty?
9
- end
10
- end