bullet_train-super_scaffolding 1.2.18 → 1.2.20

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: 683addf7e8b5dbf5dadff26e72755fe85c9736701e254cc098e463119559fd43
4
- data.tar.gz: a84a869d258af80092d048b90643e052733875e407de63f9b17c4f89113b1118
3
+ metadata.gz: b554f5ade5ad754c9ebb7c3116a4711e6cd71d84bab640778b6472a074ec6796
4
+ data.tar.gz: c6125f4769afdacd90d2f7d5335f8d6bd3d10c4c7bd4ad6c0426bcf3b86ecb33
5
5
  SHA512:
6
- metadata.gz: '0639210cf54da7c70bacb475b1f4e900e19aaa6e88c5e8e82bad77e75b6509cc6da883d32430ffb50b75f59d806ff212b7563b2f44937e52c0be11ad77c00141'
7
- data.tar.gz: adf9d14df9452b7747177ae57f5aa69af51f8716a11084de52a2f55d175e25b11a0b5d7cf94200ca1ae3d83266584253ead8eb71ac6b01a3b768c6181f66f2da
6
+ metadata.gz: d9897a5217e14b12b3a7bf01b9696f315550b19b9b55c5bcdfabd7411cad631da11a25afbeacd1eb3301848d8e768a424c902b34caeaf56570c40851c42a8643
7
+ data.tar.gz: 8ebb17644c3290782cd77fb3feb2f336bd0fcdca4d63b498e6d2389bb59b9562e7c2c0a604e706cbd64189016dd0891aea2eda884e4fb3334039aa65dc700a2c
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.2.18"
3
+ VERSION = "1.2.20"
4
4
  end
5
5
  end
@@ -23,7 +23,7 @@ module Scaffolding::FileManipulator
23
23
  return false
24
24
  end
25
25
 
26
- if target_file_content.include?(content)
26
+ if options[:content_replacement_transformed] && target_file_content.include?(content)
27
27
  puts "No need to update '#{file}'. It already has '#{content}'."
28
28
  else
29
29
  puts "Updating '#{file}'." unless silence_logs?
@@ -192,7 +192,7 @@ class Scaffolding::Transformer
192
192
  # If the file exists in the application repository, we want to target it there.
193
193
  return file if File.exist?(file)
194
194
 
195
- ENV["OTHER_TARGETS"].split(",").each do |possible_target|
195
+ ENV["OTHER_TARGETS"]&.split(",")&.each do |possible_target|
196
196
  candidate_path = "#{possible_target}/#{file}".gsub("//", "/")
197
197
  return candidate_path if File.exist?(candidate_path)
198
198
  end
@@ -421,11 +421,13 @@ class Scaffolding::Transformer
421
421
  add_line_to_file(file, content, hook, options)
422
422
  end
423
423
 
424
- def scaffold_replace_line_in_file(file, content, in_place_of)
424
+ def scaffold_replace_line_in_file(file, content, content_to_replace)
425
425
  file = resolve_target_path(transform_string(file))
426
426
  # we specifically don't transform the content, we assume a builder function created this content.
427
- in_place_of = transform_string(in_place_of)
428
- Scaffolding::FileManipulator.replace_line_in_file(file, content, in_place_of, suppress_could_not_find: suppress_could_not_find)
427
+ transformed_content_to_replace = transform_string(content_to_replace)
428
+ content_replacement_transformed = content_to_replace != transformed_content_to_replace
429
+ options = {suppress_could_not_find: suppress_could_not_find, content_replacement_transformed: content_replacement_transformed}
430
+ Scaffolding::FileManipulator.replace_line_in_file(file, content, transformed_content_to_replace, **options)
429
431
  end
430
432
 
431
433
  # if class_name isn't specified, we use `child`.
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.18
4
+ version: 1.2.20
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-09 00:00:00.000000000 Z
11
+ date: 2023-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard