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 +4 -4
- data/README.md +2 -2
- data/app/models/concerns/current_attributes/base.rb +1 -1
- data/app/views/bullet_train/partial_resolver.html.erb +1 -0
- data/docs/authentication.md +2 -2
- data/docs/getting-started.md +12 -12
- data/docs/indirection.md +6 -8
- data/docs/namespacing.md +1 -1
- data/lib/bullet_train/resolver.rb +7 -5
- data/lib/bullet_train/version.rb +1 -1
- data/lib/tasks/bullet_train_tasks.rake +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19e5c8305a3e7ce83247284b23e76be08322536689153e4a1cf7befef4acde70
|
4
|
+
data.tar.gz: 89eb7c47e0373d460be3112c7b908297f59e68e9987a8465940403d64aa6a841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 256d4903dc195d2bbd353f8b5baa9c0d5bfad13a45f3e7a6414ee098e2cc8864d18dcd7f37ad6804709e41daa226c1d4632f64d0275e1a2d780e953c3e1d3cac
|
7
|
+
data.tar.gz: 81e6a40fc87106333eb12dfc97de853ed1ec342d8f5e2889791cc2a9043a1ff641f1bf5055f6633121ec0043a31ab3ebfb10999322072d277a410354b134ed31
|
data/README.md
CHANGED
data/docs/authentication.md
CHANGED
@@ -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
|
-
|
9
|
-
|
8
|
+
bin/resolve RegistrationsController --eject --open
|
9
|
+
bin/resolve SessionsController --eject --open
|
10
10
|
```
|
11
11
|
|
12
12
|
## Customizing Views
|
data/docs/getting-started.md
CHANGED
@@ -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
|
-
|
15
|
-
|
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](
|
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
|
-
|
24
|
-
|
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](
|
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 `<!--
|
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
|
-
|
41
|
-
|
42
|
-
|
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
|
-
|
48
|
+
bin/resolve --interactive --eject --open
|
49
49
|
```
|
50
50
|
|
51
51
|
And then paste any input, e.g.:
|
52
52
|
|
53
53
|
```
|
54
|
-
<!--
|
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
|
-
|
30
|
+
bin/resolve shared/box
|
31
31
|
```
|
32
32
|
|
33
|
-
### Exposing Rendered Views with
|
33
|
+
### Exposing Rendered Views with Annotated Views
|
34
34
|
|
35
|
-
|
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
|
-
<!--
|
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
|
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
|
-
|
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
|
-
|
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].
|
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
|
-
|
130
|
-
if
|
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
|
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
|
data/lib/bullet_train/version.rb
CHANGED
@@ -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
|
46
|
-
if input =~ /<!--
|
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.
|
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-
|
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.
|
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.
|
264
|
+
version: 5.0.0.pre9
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: hiredis
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|