process_settings 0.15.0 → 0.15.1
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 +4 -4
- data/README.md +1 -1
- data/bin/combine_process_settings +31 -8
- data/bin/diff_process_settings +1 -4
- data/lib/process_settings/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37586770d262584d6b5f6b2b4a8a7824eb351d9da15d6577dc0591223c0074f0
|
4
|
+
data.tar.gz: 8c61aa64d76749381c1311f7c08f2778a0c99134778c09d45aebd32d1ca10ff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 212169ce11e8ce4c15f056ffc14c15de1e46fadbc93878c922a577b44217bc8c84d3ecfa49773580bbbf06bdae4cb9a58caf55e570c334282e14ed26c9045ff6
|
7
|
+
data.tar.gz: 7afc6259634fba9c6a8e0ebe63ab4ffa361c79fdfb5dde63d4f39168222cb790cfa706989e43eaee5ea7b0f9625d393f4411b673bff68e11e0e609c694372adc
|
data/README.md
CHANGED
@@ -181,7 +181,7 @@ require 'process_settings/testing/helpers'
|
|
181
181
|
RSpec.configure do |config|
|
182
182
|
# ...
|
183
183
|
|
184
|
-
include ProcessSettings::Testing::RSpec::Helpers
|
184
|
+
config.include ProcessSettings::Testing::RSpec::Helpers
|
185
185
|
|
186
186
|
# Note: the include above will automatically register a global after block that will reset process_settings to their initial values.
|
187
187
|
# ...
|
@@ -92,6 +92,26 @@ def warn_if_old_libyaml_version
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
def settings_files_match?(filename_1, filename_2)
|
96
|
+
filename_1 && filename_2 &&
|
97
|
+
File.exist?(filename_1) && File.exist?(filename_2) &&
|
98
|
+
diff_process_settings(filename_1, filename_2)
|
99
|
+
end
|
100
|
+
|
101
|
+
def diff_process_settings(filename_1, filename_2)
|
102
|
+
system(<<~EOS)
|
103
|
+
bundle exec diff_process_settings --silent "#{filename_1}" "#{filename_2}"
|
104
|
+
EOS
|
105
|
+
status_code = $?.exitstatus
|
106
|
+
case status_code
|
107
|
+
when 0
|
108
|
+
true
|
109
|
+
when 1
|
110
|
+
false
|
111
|
+
else
|
112
|
+
raise "diff_process_settings failed with code #{status_code}"
|
113
|
+
end
|
114
|
+
end
|
95
115
|
|
96
116
|
#
|
97
117
|
# main
|
@@ -115,14 +135,17 @@ tmp_output_filename = "#{output_filename}.tmp"
|
|
115
135
|
system("rm -f #{tmp_output_filename}")
|
116
136
|
File.write(tmp_output_filename, yaml_with_warning_comment)
|
117
137
|
|
118
|
-
|
119
|
-
if
|
120
|
-
|
121
|
-
|
138
|
+
if settings_files_match?(options.initial_filename, tmp_output_filename)
|
139
|
+
if settings_files_match?(output_filename, tmp_output_filename)
|
140
|
+
puts "#{options.root_folder}: unchanged" if options.verbose
|
141
|
+
FileUtils.rm_f(tmp_output_filename)
|
122
142
|
else
|
123
|
-
|
124
|
-
mv
|
125
|
-
|
126
|
-
|
143
|
+
puts "#{options.root_folder}: UPDATING (changed now)" if options.verbose
|
144
|
+
FileUtils.mv(tmp_output_filename, output_filename)
|
145
|
+
end
|
146
|
+
else
|
147
|
+
puts "#{options.root_folder}: UPDATING (unchanged now, but changed from initial)" if options.verbose
|
148
|
+
FileUtils.mv(tmp_output_filename, output_filename)
|
149
|
+
end
|
127
150
|
|
128
151
|
exit(0)
|
data/bin/diff_process_settings
CHANGED