bullet_train-super_scaffolding 1.2.19 → 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: 2a3c3093d8ec80230c40009a71e1e17fcec9763fbc29c550f6b9d58d02bcdabd
4
- data.tar.gz: 7e3574b17f2856743920f385cf6c19a03f939b7684d7907221db7b5c811c737b
3
+ metadata.gz: b554f5ade5ad754c9ebb7c3116a4711e6cd71d84bab640778b6472a074ec6796
4
+ data.tar.gz: c6125f4769afdacd90d2f7d5335f8d6bd3d10c4c7bd4ad6c0426bcf3b86ecb33
5
5
  SHA512:
6
- metadata.gz: e861799518ca1c86b8e4e2c146acde7af79bd08bab5caa0b4ee44c65f7c17728e6a8b6088f359b1a0341987e9ec2026c7c59835993adfc7b0ad99e1bc700581f
7
- data.tar.gz: 3493d0bd968ad720dc04cf6511cda909da9ef1dd94ba4e00d1f5c2a01f5df1c8bdc5788d8c00ec5be9d0d576b8dc5bb49d5bb7d8000e70f3c8df70b7f42901e2
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.19"
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.19
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