bullet_train-super_scaffolding 1.0.6 → 1.0.7

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: ce5d6f3d2cb0ff2a0ed85aa5928e2a9e390b17709b41889c0fb6c25b9d7c4293
4
- data.tar.gz: af398b0b3cbc631f42e38d8643899678399bf1d7e819a1261f0142980029ec97
3
+ metadata.gz: 3bcd9e0be2aa17210990067b3a2d43f624450d380d50503be510bd2744d7da11
4
+ data.tar.gz: 2550d7faf22d005b3997d185f05dd6a4cb7c8d26c97130497e84b5dc5b3c34ef
5
5
  SHA512:
6
- metadata.gz: 6a1450d9449295670cd943ad637da3405b6b509c09905520c93bfdbab32eb471d93eedd3df5915db3cf325d77a5bd2d0ea8b4add6cf29b9811aba12b4242d74b
7
- data.tar.gz: f5c3879c59b9ed29c0982856e206e569756f6861f5f80784ef6ae04cdc5cd315771adfebdb18bcf3b7ae0a7aa32482ddf7c9f025f90befc7f7632b7c38f18cda
6
+ metadata.gz: 951c8ae79449a58036bd66b87cfba7d07b6a5e33c6b2fbac99f32cf9d81ea58bc53046a793dee952d7d1455f44f2c6e970605b0ff7c0f6a6bdf17c4c602bd347
7
+ data.tar.gz: 222c2cd02aa95cc849449130a1d59647d6abf3ad5ed3e4c12524f46138432388c1e33d67c57a60c10fecc0586695477eb6c710f5ed3440960974c65f7888fe38
@@ -1,6 +1,14 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
3
  class Engine < ::Rails::Engine
4
+ initializer "bullet_train.super_scaffolding.register_template_path" do |app|
5
+ # Templates from the application itself should always be highest priority.
6
+ # This allows application developers to locally overload any template from any package.
7
+ BulletTrain::SuperScaffolding.template_paths << Rails.root.to_s
8
+
9
+ # Register the base path of this package with the Super Scaffolding engine.
10
+ BulletTrain::SuperScaffolding.template_paths << File.expand_path('../../../..', __FILE__)
11
+ end
4
12
  end
5
13
  end
6
14
  end
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require "indefinite_article"
2
2
  require "yaml"
3
+ require "scaffolding/class_names_transformer"
3
4
 
4
5
  class Scaffolding::Transformer
5
6
  attr_accessor :child, :parent, :parents, :class_names_transformer, :cli_options, :additional_steps, :namespace, :suppress_could_not_find
@@ -111,11 +112,11 @@ class Scaffolding::Transformer
111
112
  # Originally all the potential source files were in the repository alongside the application.
112
113
  # Now the files could be provided by an included Ruby gem, so we allow those Ruby gems to register their base
113
114
  # path and then we check them in order to see which template we should use.
114
- BulletTrain::SuperScaffolding.template_paths.reverse.map do |base_path|
115
+ BulletTrain::SuperScaffolding.template_paths.map do |base_path|
115
116
  base_path = Pathname.new(base_path)
116
117
  resolved_path = base_path.join(file).to_s
117
- File.exists?(resolved_path) ? resolved_path : file
118
- end.compact.first
118
+ File.exist?(resolved_path) ? resolved_path : nil
119
+ 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")}")
119
120
  end
120
121
 
121
122
  def get_transformed_file_content(file)
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.0.6
4
+ version: 1.0.7
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-02-02 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails