bullet_train 1.0.46 → 1.0.47

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: c4a10e169bed7e2cc9dfef7fe304ff60ab66a1eecceb50129ca616c1c7b390f7
4
+ data.tar.gz: 5370e36c4d668fe9282abb1c3c6d9552bd6351eb045a646ad388f74bc83e49b5
5
5
  SHA512:
6
- metadata.gz: 9b6f9ce718307c62a69e49faf9948ba43b1fad9269c49b8562683c9deff3f7c00595d5d0216e2d01bf8b0a25a619164d8e48ca37570b0cbace136ec23fa9b7e3
7
- data.tar.gz: 534d607fb41150372dcaea0af84b8aa8fa5897c1af3bf6bab4019cfbb06bf565819a543896dd131b081c39c7081b89144159f42e0118278a304ffd21bd745760
6
+ metadata.gz: 341306e5e082f27c17a1240a156b7680e0fb150d21dcf1621bbca7f273af8560f17b131742022b10b0a29ceb8dd5af9d82f037bea24a11bff50b6ecbc0ee2165
7
+ data.tar.gz: 14a518a963da1f8f122ceb2ba332f6839f5cc92d23b147820c57dba59554a4241a9224e1760729710a29770792c83d5d0deffc6c68fc05c885701d816799ef4b
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
@@ -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
  ```
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.46"
2
+ VERSION = "1.0.47"
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.47
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-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard