bullet_train 1.0.46 → 1.0.49

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: 9e6c930c4e6fad0f50e6869cdfcceec0b40ac27e4eef3dc04facde80918c9276
4
- data.tar.gz: bf9576a58a7c27ac23b46fbacbf93b16a4ac03bae5abc573ffc468e6dce11dc5
3
+ metadata.gz: 19e5c8305a3e7ce83247284b23e76be08322536689153e4a1cf7befef4acde70
4
+ data.tar.gz: 89eb7c47e0373d460be3112c7b908297f59e68e9987a8465940403d64aa6a841
5
5
  SHA512:
6
- metadata.gz: 9b6f9ce718307c62a69e49faf9948ba43b1fad9269c49b8562683c9deff3f7c00595d5d0216e2d01bf8b0a25a619164d8e48ca37570b0cbace136ec23fa9b7e3
7
- data.tar.gz: 534d607fb41150372dcaea0af84b8aa8fa5897c1af3bf6bab4019cfbb06bf565819a543896dd131b081c39c7081b89144159f42e0118278a304ffd21bd745760
6
+ metadata.gz: 256d4903dc195d2bbd353f8b5baa9c0d5bfad13a45f3e7a6414ee098e2cc8864d18dcd7f37ad6804709e41daa226c1d4632f64d0275e1a2d780e953c3e1d3cac
7
+ data.tar.gz: 81e6a40fc87106333eb12dfc97de853ed1ec342d8f5e2889791cc2a9043a1ff641f1bf5055f6633121ec0043a31ab3ebfb10999322072d277a410354b134ed31
data/README.md CHANGED
@@ -13,12 +13,12 @@ gem "bullet_train"
13
13
 
14
14
  And then execute:
15
15
  ```bash
16
- $ bundle
16
+ bundle
17
17
  ```
18
18
 
19
19
  Or install it yourself as:
20
20
  ```bash
21
- $ gem install bullet_train
21
+ gem install bullet_train
22
22
  ```
23
23
 
24
24
  ## Contributing
@@ -2,7 +2,7 @@ module CurrentAttributes::Base
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- attribute :user, :team, :membership, :ability
5
+ attribute :user, :team, :membership, :ability, :context
6
6
 
7
7
  resets do
8
8
  Time.zone = nil
@@ -1,2 +1,3 @@
1
+ <!-- This line is intentionally left blank. -->
1
2
  <%= render @needle do |p| %>
2
3
  <% end %>
@@ -5,8 +5,8 @@ Bullet Train uses [Devise](https://github.com/heartcombo/devise) for authenticat
5
5
  Bullet Train registers its own slightly customized registration and session controllers for Devise. If you want to customize them further, you can simply eject those controllers from the framework and override them locally, like so:
6
6
 
7
7
  ```
8
- $ bin/resolve RegistrationsController --eject --open
9
- $ bin/resolve SessionsController --eject --open
8
+ bin/resolve RegistrationsController --eject --open
9
+ bin/resolve SessionsController --eject --open
10
10
  ```
11
11
 
12
12
  ## Customizing Views
@@ -11,45 +11,45 @@ If you're using Bullet Train for the first time, begin by learning these five im
11
11
  1. Use `rails g model` to create and `bin/super-scaffold` to scaffold a new model:
12
12
 
13
13
  ```
14
- $ rails g model Project team:references name:string
15
- $ bin/super-scaffold crud Project Team name:text_field
14
+ rails g model Project team:references name:string
15
+ bin/super-scaffold crud Project Team name:text_field
16
16
  ```
17
17
 
18
- In this example, `Team` refers to the immediate parent of the `Project` resource. For more details, just run `bin/super-scaffold` or [read the documentation](https://github.com/bullet-train-co/bullet_train-base/blob/main/docs/super-scaffolding.md).
18
+ In this example, `Team` refers to the immediate parent of the `Project` resource. For more details, just run `bin/super-scaffold` or [read the documentation](/docs/super-scaffolding.md).
19
19
 
20
20
  2. Use `rails g migration` and `bin/super-scaffold` to add a new field to a model you've already scaffolded:
21
21
 
22
22
  ```
23
- $ rails g migration add_description_to_projects description:text
24
- $ bin/super-scaffold crud-field Project description:trix_editor
23
+ rails g migration add_description_to_projects description:text
24
+ bin/super-scaffold crud-field Project description:trix_editor
25
25
  ```
26
26
 
27
- These first two points about Super Scaffolding are just the tip of the iceberg, so be sure to circle around and [read the full documentation](https://github.com/bullet-train-co/bullet_train-base/blob/main/docs/super-scaffolding.md).
27
+ These first two points about Super Scaffolding are just the tip of the iceberg, so be sure to circle around and [read the full documentation](/docs/super-scaffolding.md).
28
28
 
29
29
  3. Figure out which ERB views are powering something you see in the UI by:
30
30
 
31
31
  - Right clicking the element.
32
32
  - Selecting "Inspect Element".
33
- - Looking for the `<!--XRAY START ...-->` comment above the element you've selected.
33
+ - Looking for the `<!-- BEGIN ... -->` comment above the element you've selected.
34
34
 
35
35
  4. Figure out the full I18N translation key of any string on the page by adding `?show_locales=true` to the URL.
36
36
 
37
37
  5. Use `bin/resolve` to figure out where framework or theme things are coming from and eject them if you need to customize something locally:
38
38
 
39
39
  ```
40
- $ bin/resolve Users::Base
41
- $ bin/resolve en.account.teams.show.header --open
42
- $ bin/resolve shared/box --open --eject
40
+ bin/resolve Users::Base
41
+ bin/resolve en.account.teams.show.header --open
42
+ bin/resolve shared/box --open --eject
43
43
  ```
44
44
 
45
45
  Also, for inputs that can't be provided on the shell, there's an interactive mode where you can paste them:
46
46
 
47
47
  ```
48
- $ bin/resolve --interactive --eject --open
48
+ bin/resolve --interactive --eject --open
49
49
  ```
50
50
 
51
51
  And then paste any input, e.g.:
52
52
 
53
53
  ```
54
- <!--XRAY START 73 /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/commentary/_box.html.erb-->
54
+ <!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/commentary/_box.html.erb -->
55
55
  ```
data/docs/indirection.md CHANGED
@@ -27,20 +27,18 @@ Even in vanilla Rails development, when you're looking at a view file, the path
27
27
  `bin/resolve` makes it easy to figure out where where a partial is being served from:
28
28
 
29
29
  ```
30
- $ bin/resolve shared/box
30
+ bin/resolve shared/box
31
31
  ```
32
32
 
33
- ### Exposing Rendered Views with Xray
33
+ ### Exposing Rendered Views with Annotated Views
34
34
 
35
- > TODO Is this still true in Rails 7? Does it not do something like this by default now?
36
-
37
- If you're looking at a rendered view in the browser, it can be hard to know which file to open in order to make a change. To help, Bullet Train includes [Xray](https://github.com/brentd/xray-rails) by default, so you can right click on any element you see, select "Inspect Element", and you'll see comments in the HTML source telling you which file is powering a particular portion of the view, like this:
35
+ If you're looking at a rendered view in the browser, it can be hard to know which file to open in order to make a change. To help, Bullet Train enables `config.action_view.annotate_rendered_view_with_filenames` by default, so you can right click on any element you see, select "Inspect Element", and you'll see comments in the HTML source telling you which file is powering a particular portion of the view, like this:
38
36
 
39
37
  ```
40
- <!--XRAY START 90 /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb-->
38
+ <!-- BEGIN /Users/andrewculver/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bullet_train-themes-light-1.0.10/app/views/themes/light/workflow/_box.html.erb -->
41
39
  ```
42
40
 
43
- Note that in the example above, the view in question isn't actually coming from the application repository. Instead, it's being included from the `bullet_train-themes-light` package. For instructions on how to customize it, see [Overriding the Framework](/docs/override).
41
+ Note that in the example above, the view in question isn't actually coming from the application repository. Instead, it's being included from the `bullet_train-themes-light` package. For instructions on how to customize it, see [Overriding Framework Defaults](/docs/overriding.md).
44
42
 
45
43
  ### Drilling Down on Translation Keys
46
44
 
@@ -59,5 +57,5 @@ You can also log all the translation key for anything being rendered to the cons
59
57
  Once you have the full I18N translation key, you can use `bin/resolve` to figure out which package and file it's coming from. At that point, if you need to customize it, you can also use the `--eject` option to copy the the framework for customization in your local application:
60
58
 
61
59
  ```
62
- $ bin/resolve en.account.onboarding.user_details.edit.header --eject --open
60
+ bin/resolve en.account.onboarding.user_details.edit.header --eject --open
63
61
  ```
data/docs/namespacing.md CHANGED
@@ -7,5 +7,5 @@ Bullet Train comes preconfigured with an `Account` and controller and view names
7
7
  In Bullet Train applications with [multiple team types](/docs/teams.md), you may find it helpful to introduce additional controller and view namespaces to represent and organize user interfaces and experiences for certain team types that vary substantially from the `Account` namespace default. In Super Scaffolding, you can specify a namespace other than `Account` with the `--namespace` option, for example:
8
8
 
9
9
  ```
10
- $ bin/super-scaffold crud Event Team name:text_field --namespace=customers
10
+ bin/super-scaffold crud Event Team name:text_field --namespace=customers
11
11
  ```
@@ -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|
@@ -126,11 +126,11 @@ module BulletTrain
126
126
  end
127
127
 
128
128
  def partial_path
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+ (.*)-->/
129
+ annotated_path = ApplicationController.render(template: "bullet_train/partial_resolver", layout: nil, assigns: {needle: @needle}).lines[1].chomp
130
+ if annotated_path =~ /<!-- BEGIN (.*) -->/
131
131
  $1
132
132
  else
133
- raise "It looks like Xray-rails isn't properly enabled?"
133
+ raise "It looks like `config.action_view.annotate_rendered_view_with_filenames` isn't enabled?"
134
134
  end
135
135
  rescue ActionView::Template::Error => _
136
136
  nil
@@ -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.46"
2
+ VERSION = "1.0.49"
3
3
  end
@@ -42,8 +42,8 @@ namespace :bullet_train do
42
42
  input = $stdin.gets.strip
43
43
  $stdin.getc while $stdin.ready?
44
44
 
45
- # Extract absolute paths from XRAY comments.
46
- if input =~ /<!--XRAY START \d+ (.*)-->/
45
+ # Extract absolute paths from annotated views.
46
+ if input =~ /<!-- BEGIN (.*) -->/
47
47
  input = $1
48
48
  end
49
49
 
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.46
4
+ version: 1.0.49
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-02 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -254,14 +254,14 @@ dependencies:
254
254
  requirements:
255
255
  - - '='
256
256
  - !ruby/object:Gem::Version
257
- version: 5.0.0.pre8
257
+ version: 5.0.0.pre9
258
258
  type: :runtime
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - '='
263
263
  - !ruby/object:Gem::Version
264
- version: 5.0.0.pre8
264
+ version: 5.0.0.pre9
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: hiredis
267
267
  requirement: !ruby/object:Gem::Requirement