bullet_train 1.0.45 → 1.0.46

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 041e2b16ba7fe195c4622eca9f52ba3f2ece36e2ca4990e81091dcd7dce77f67
4
- data.tar.gz: 4343cfb1d33be84c52dd412e335d15928ad13afb9d8a95eddbc41b751452c335
3
+ metadata.gz: 9e6c930c4e6fad0f50e6869cdfcceec0b40ac27e4eef3dc04facde80918c9276
4
+ data.tar.gz: bf9576a58a7c27ac23b46fbacbf93b16a4ac03bae5abc573ffc468e6dce11dc5
5
5
  SHA512:
6
- metadata.gz: fa1d5423f1a3b3ab31ac94b2c75b6d298b9c0fb670f70178a2aec8e8638e9adaf07d3e8c77a2bb0e99edcc79961407058cbf0807a7972fbc50c08e008312de45
7
- data.tar.gz: 7875607106a2cb2932a30a537717ac947e62121709a0389c2144be1f4c39366dbd799d5286d2548f8d2b513136992e1b526f5a66782eea4aebea0137ce2c3c9f
6
+ metadata.gz: 9b6f9ce718307c62a69e49faf9948ba43b1fad9269c49b8562683c9deff3f7c00595d5d0216e2d01bf8b0a25a619164d8e48ca37570b0cbace136ec23fa9b7e3
7
+ data.tar.gz: 534d607fb41150372dcaea0af84b8aa8fa5897c1af3bf6bab4019cfbb06bf565819a543896dd131b081c39c7081b89144159f42e0118278a304ffd21bd745760
@@ -46,7 +46,7 @@ module Account::LocaleHelper
46
46
  begin
47
47
  super(key + "šŸ’£", options.except(:default))
48
48
  rescue I18n::MissingTranslationData => exception
49
- full_key = exception.message.rpartition(" ").last.gsub("šŸ’£", "")
49
+ full_key = exception.message.rpartition(" ").last.delete("šŸ’£")
50
50
  end
51
51
  end
52
52
  end
@@ -75,7 +75,7 @@ module Account::LocaleHelper
75
75
  end
76
76
  end
77
77
 
78
- return result
78
+ result
79
79
  end
80
80
 
81
81
  # like 't', but if the key isn't found, it returns nil.
@@ -1,5 +1,5 @@
1
1
  class Invitation < ApplicationRecord
2
- include Invitations::Core
2
+ include Invitations::Base
3
3
  # šŸš… add concerns above.
4
4
 
5
5
  # šŸš… add belongs_to associations above.
@@ -1,5 +1,5 @@
1
1
  class Membership < ApplicationRecord
2
- include Memberships::Core
2
+ include Memberships::Base
3
3
  # šŸš… add concerns above.
4
4
 
5
5
  # šŸš… add belongs_to associations above.
data/app/models/team.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class Team < ApplicationRecord
2
- include Teams::Core
3
- include Webhooks::Outgoing::TeamSupport
2
+ include Teams::Base
3
+ # include Webhooks::Outgoing::TeamSupport
4
4
  # šŸš… add concerns above.
5
5
 
6
6
  # šŸš… add belongs_to associations above.
data/app/models/user.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class User < ApplicationRecord
2
- include Users::Core
2
+ include Users::Base
3
3
  # šŸš… add concerns above.
4
4
 
5
5
  # šŸš… add belongs_to associations above.
data/docs/overriding.md CHANGED
@@ -12,7 +12,7 @@ For this reason, common points of extension like framework-provided models and c
12
12
 
13
13
  ```
14
14
  class User < ApplicationRecord
15
- include Users::Core
15
+ include Users::Base
16
16
 
17
17
  # ...
18
18
  end
@@ -1,4 +1,4 @@
1
- require 'io/wait'
1
+ require "io/wait"
2
2
 
3
3
  module BulletTrain
4
4
  class Resolver
@@ -13,28 +13,26 @@ module BulletTrain
13
13
  source_file = calculate_source_file_details
14
14
 
15
15
  if source_file[:absolute_path]
16
+ puts ""
16
17
  if source_file[:package_name].present?
17
- puts ""
18
18
  puts "Absolute path:".green
19
19
  puts " #{source_file[:absolute_path]}".green
20
20
  puts ""
21
21
  puts "Package name:".green
22
22
  puts " #{source_file[:package_name]}".green
23
- puts ""
24
23
  else
25
- puts ""
26
24
  puts "Project path:".green
27
25
  puts " #{source_file[:project_path]}".green
28
26
  puts ""
29
27
  puts "Note: If this file was previously ejected from a package, we can no longer see which package it came from. However, it should say at the top of the file where it was ejected from.".yellow
30
- puts ""
31
28
  end
29
+ puts ""
32
30
 
33
31
  if interactive && !eject
34
32
  puts "\nWould you like to eject the file into the local project? (y/n)\n"
35
33
  input = $stdin.gets
36
34
  $stdin.getc while $stdin.ready?
37
- if input.first.downcase == 'y'
35
+ if input.first.downcase == "y"
38
36
  eject = true
39
37
  end
40
38
  end
@@ -46,7 +44,7 @@ module BulletTrain
46
44
  else
47
45
  `mkdir -p #{source_file[:project_path].split("/")[0...-1].join("/")}`
48
46
  puts "Ejecting `#{source_file[:absolute_path]}` to `#{source_file[:project_path]}`".green
49
- File.open("#{source_file[:project_path]}", "w+") do |file|
47
+ File.open((source_file[:project_path]).to_s, "w+") do |file|
50
48
  case source_file[:project_path].split(".").last
51
49
  when "rb", "yml"
52
50
  file.puts "# Ejected from `#{source_file[:package_name]}`.\n\n"
@@ -69,13 +67,13 @@ module BulletTrain
69
67
  puts "\nWould you like to open `#{source_file[:absolute_path]}`? (y/n)\n"
70
68
  input = $stdin.gets
71
69
  $stdin.getc while $stdin.ready?
72
- if input.first.downcase == 'y'
70
+ if input.first.downcase == "y"
73
71
  open = true
74
72
  end
75
73
  end
76
74
 
77
75
  if open
78
- path = source_file[:package_name] ? source_file[:absolute_path] : "#{source_file[:project_path]}"
76
+ path = source_file[:package_name] ? source_file[:absolute_path] : (source_file[:project_path]).to_s
79
77
  puts "Opening `#{path}`.\n".green
80
78
  exec "open #{path}"
81
79
  end
@@ -121,25 +119,21 @@ module BulletTrain
121
119
  end
122
120
 
123
121
  def class_path
124
- begin
125
- @needle.constantize
126
- return Object.const_source_location(@needle).first
127
- rescue NameError => _
128
- return false
129
- end
122
+ @needle.constantize
123
+ Object.const_source_location(@needle).first
124
+ rescue NameError => _
125
+ false
130
126
  end
131
127
 
132
128
  def partial_path
133
- begin
134
- xray_path = ApplicationController.render(template: "bullet_train/partial_resolver", layout: nil, assigns: {needle: @needle}).lines[1].chomp
135
- if xray_path.match(/<!--XRAY START \d+ (.*)-->/)
136
- return $1
137
- else
138
- raise "It looks like Xray-rails isn't properly enabled?"
139
- end
140
- rescue ActionView::Template::Error => _
141
- return nil
129
+ xray_path = ApplicationController.render(template: "bullet_train/partial_resolver", layout: nil, assigns: {needle: @needle}).lines[1].chomp
130
+ if xray_path =~ /<!--XRAY START \d+ (.*)-->/
131
+ $1
132
+ else
133
+ raise "It looks like Xray-rails isn't properly enabled?"
142
134
  end
135
+ rescue ActionView::Template::Error => _
136
+ nil
143
137
  end
144
138
 
145
139
  def file_path
@@ -149,7 +143,7 @@ module BulletTrain
149
143
 
150
144
  def locale_path
151
145
  # This is a complete list of translation files provided by this app or any linked Bullet Train packages.
152
- (["#{Rails.root.to_s}/config/locales"] + `find ./tmp/gems/*`.lines.map(&:strip).map { |link| File.readlink(link) + "/config/locales" }).each do |locale_source|
146
+ (["#{Rails.root}/config/locales"] + `find ./tmp/gems/*`.lines.map(&:strip).map { |link| File.readlink(link) + "/config/locales" }).each do |locale_source|
153
147
  if File.exist?(locale_source)
154
148
  `find -L #{locale_source} | grep ".yml"`.lines.map(&:strip).each do |file_path|
155
149
  yaml = YAML.load_file(file_path, aliases: true)
@@ -161,7 +155,7 @@ module BulletTrain
161
155
  end
162
156
  end
163
157
 
164
- return nil
158
+ nil
165
159
  end
166
160
  end
167
161
  end
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.45"
2
+ VERSION = "1.0.46"
3
3
  end
@@ -1,13 +1,13 @@
1
- require 'io/wait'
1
+ require "io/wait"
2
2
 
3
3
  namespace :bt do
4
4
  desc "Symlink registered gems in `./tmp/gems` so their views, etc. can be inspected by Tailwind CSS."
5
- task :link => :environment do
6
- if Dir.exists?("tmp/gems")
5
+ task link: :environment do
6
+ if Dir.exist?("tmp/gems")
7
7
  puts "Removing previously linked gems."
8
8
  `rm -f tmp/gems/*`
9
9
  else
10
- if File.exists?("tmp/gems")
10
+ if File.exist?("tmp/gems")
11
11
  raise "A file named `tmp/gems` already exists? It has to be removed before we can create the required directory."
12
12
  end
13
13
 
@@ -43,7 +43,7 @@ namespace :bullet_train do
43
43
  $stdin.getc while $stdin.ready?
44
44
 
45
45
  # Extract absolute paths from XRAY comments.
46
- if input.match(/<!--XRAY START \d+ (.*)-->/)
46
+ if input =~ /<!--XRAY START \d+ (.*)-->/
47
47
  input = $1
48
48
  end
49
49
 
@@ -53,7 +53,7 @@ namespace :bullet_train do
53
53
  if ARGV.first.present?
54
54
  BulletTrain::Resolver.new(ARGV.first).run(eject: ARGV.include?("--eject"), open: ARGV.include?("--open"), force: ARGV.include?("--force"), interactive: ARGV.include?("--interactive"))
55
55
  else
56
- $stderr.puts "\nšŸš… Usage: `bin/resolve [path, partial, or URL] (--eject) (--open)`\n".blue
56
+ warn "\nšŸš… Usage: `bin/resolve [path, partial, or URL] (--eject) (--open)`\n".blue
57
57
  end
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.45
4
+ version: 1.0.46
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-03-26 00:00:00.000000000 Z
11
+ date: 2022-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: standard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rails
15
29
  requirement: !ruby/object:Gem::Requirement