bullet_train-super_scaffolding 1.2.13 → 1.2.15

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: 2b891afd2ffdfb5c960dc409911d2fce58515ffc2b4a86ca25f848cbb9550489
4
- data.tar.gz: 39250a644ffabfa4c0095a3cf8276e13822edb5f827a4cfa2ed55ca6a57a5493
3
+ metadata.gz: 0f25e68a8d5e6257c11351c319e43b4c5f69fd3eb784cf15842f0de801df780b
4
+ data.tar.gz: a773728d985eedcfc7626e174ab6a37556e7b4957835b8407869805089f5afa9
5
5
  SHA512:
6
- metadata.gz: dd0c77206a5ff177586b7dc43a158b632e4156e615fca4e5768733c23b8ae0556165c1257421dbb14df91657f95e46feaa55e1c63c62ea31546b02dc7463be6f
7
- data.tar.gz: c4e23f16581652f1808068b87e28be3affd35aad6f81d1724eaa950b55a845f44266d625557da7972aae0a45ea9550ca7689625339986d186ce644711fd35b84
6
+ metadata.gz: 67b9a9e136773001ea105c2cd83fbfe27db04cb1485dbc7e1b69d73323ba8bd95f15fe951003e013b49da6513d509083483503bd6b69af7a52f01af5b3b34e22
7
+ data.tar.gz: af00092a3660a4ef73c8944dda88c881210142c953ef6a71c85a00c83c47caa4261ebb2111a0f05f2ef4449b943e1b0f4518c5260cd06d96287272c57dfd6803
@@ -10,7 +10,7 @@
10
10
  <%= render 'account/shared/box' do |p| %>
11
11
  <% p.content_for :title, t(".contexts.#{context.class.name.underscore}.header") %>
12
12
  <% p.content_for :description do %>
13
- <%= t(".contexts.#{context.class.name.underscore}.#{creative_concepts.any? ? 'description' : 'description_empty'}") %>
13
+ <%= t(".contexts.#{context.class.name.underscore}.description").html_safe %>
14
14
  <%= render "shared/limits/index", model: creative_concepts.model %>
15
15
  <% end %>
16
16
 
@@ -41,6 +41,10 @@
41
41
  <%= link_to t('.buttons.new'), [:new, :account, @team, :scaffolding_absolutely_abstract_creative_concept], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} new" %>
42
42
  <% end %>
43
43
 
44
+ <%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %>
45
+ <%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
46
+ <%= render "shared/bulk_action_select" %>
47
+
44
48
  <%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} back" unless hide_back %>
45
49
  <% end %>
46
50
  <% end %>
@@ -63,18 +63,10 @@ en:
63
63
  contexts:
64
64
  team:
65
65
  header: Creative Concepts
66
- description_admin: Below is a list of all Creative Concepts for %{team_name}. You can manage them with the options below.
67
- description: Below is a list of Creative Concepts you can see on %{team_name}. You can manage them with the options below.
68
- description_empty_admin: No Creative Concepts have been added for %{team_name} yet. To get started, use the button below!
69
- description_empty: There are no Creative Concepts for you to see on %{team_name} yet. To add your own, use the button below!
66
+ description:
67
+ If you're wondering what this is and how to hide it, read the "<a href="/docs/super-scaffolding" target="_blank">Code Generation with Super Scaffolding</a>" section of the Bullet Train documentation.
70
68
  fields: *fields
71
69
  buttons: *buttons
72
- commentary:
73
- If you're wondering what a "Creative Concept" is, don't worry, there's nothing to understand here!
74
- <code>Scaffolding::AbsolutelyAbstract::CreativeConcept</code> is a model that exists by default in Bullet Train to serve as part of Super Scaffolding's template system.
75
- It also provides an example of what a scaffolded model looks like by default.
76
- Yes, the class has a very weird name, but the weird name serves an important purpose when we're generating code.
77
- For more details and instructions on how to hide this, see "<a href="https://bullettrain.co/docs/super-scaffolding">Code Generation with Super Scaffolding</a>".
78
70
  show:
79
71
  section: "%{creative_concept_name}"
80
72
  header: Creative Concept Details
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.2.13"
3
+ VERSION = "1.2.15"
4
4
  end
5
5
  end
@@ -185,6 +185,21 @@ class Scaffolding::Transformer
185
185
  end.compact.first || raise("Couldn't find the Super Scaffolding template for `#{file}` in any of the following locations:\n\n#{BulletTrain::SuperScaffolding.template_paths.join("\n")}")
186
186
  end
187
187
 
188
+ def resolve_target_path(file)
189
+ # Only do something here if they are trying to specify a target directory.
190
+ return file unless ENV["TARGET"]
191
+
192
+ # If the file exists in the application repository, we want to target it there.
193
+ return file if File.exist?(file)
194
+
195
+ ENV["OTHER_TARGETS"].split(",").each do |possible_target|
196
+ candidate_path = "#{possible_target}/#{file}".gsub("//", "/")
197
+ return candidate_path if File.exist?(candidate_path)
198
+ end
199
+
200
+ "#{ENV["TARGET"]}/#{file}".gsub("//", "/")
201
+ end
202
+
188
203
  def get_transformed_file_content(file)
189
204
  transformed_file_content = []
190
205
 
@@ -265,7 +280,7 @@ class Scaffolding::Transformer
265
280
 
266
281
  def scaffold_file(file, overrides: false)
267
282
  transformed_file_content = get_transformed_file_content(file)
268
- transformed_file_name = transform_string(file)
283
+ transformed_file_name = resolve_target_path(transform_string(file))
269
284
 
270
285
  # Remove `_overrides` from the file name if we're sourcing from a local override folder.
271
286
  transformed_file_name.gsub!("_overrides", "") if overrides
@@ -400,14 +415,14 @@ class Scaffolding::Transformer
400
415
  end
401
416
 
402
417
  def scaffold_add_line_to_file(file, content, hook, options = {})
403
- file = transform_string(file)
418
+ file = resolve_target_path(transform_string(file))
404
419
  content = transform_string(content)
405
420
  hook = transform_string(hook)
406
421
  add_line_to_file(file, content, hook, options)
407
422
  end
408
423
 
409
424
  def scaffold_replace_line_in_file(file, content, in_place_of)
410
- file = transform_string(file)
425
+ file = resolve_target_path(transform_string(file))
411
426
  # we specifically don't transform the content, we assume a builder function created this content.
412
427
  in_place_of = transform_string(in_place_of)
413
428
  Scaffolding::FileManipulator.replace_line_in_file(file, content, in_place_of, suppress_could_not_find: suppress_could_not_find)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.13
4
+ version: 1.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard