macmillan-utils 1.0.33 → 1.0.34

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
  SHA1:
3
- metadata.gz: 082720f53c08e7a389f791d4859adf4ff408ee1d
4
- data.tar.gz: 686bbcdebb11405d314be7fc2eaceca800070539
3
+ metadata.gz: 0de1c896375db7381540df9d9fe2b4edad6fd926
4
+ data.tar.gz: b93172e537a04416b9e74bef0fa76d0e6646cbb6
5
5
  SHA512:
6
- metadata.gz: 72fe89d06f184fb910a157b96330231438767a830b91c702741d7751f65a82ed7baa3e3b80b1eade25c42e671d50b80211ccbd4280d498a8e308596bb42e1d5b
7
- data.tar.gz: 893e33789d9f0b892ce93d0dc9c7333f595374d1b2143c1affb4708dfc920064224f51c3aea2f3ab07f7d2076b87aa416b8fd8ee3fb197798a1720dfd95f0bb0
6
+ metadata.gz: 4114d1edfca40206a2192a227ea8f48f56fd6f9bb77b7520f76e1daa174791a750f8667a0ceca2b1483bc796f14ae5d154d053ab15f13de1b8c41a5ccfdb3c44
7
+ data.tar.gz: 9f979a93bc577163de9f8fe64d1fffc6fdb206e198c4b9a571782e376b1329b6e5f5568ad09f7d30258d7d8dd79fe38c0ff77a8c0299c01f28e86b3d340d5680
@@ -1,11 +1,20 @@
1
+ require 'colorize'
2
+
1
3
  def check_config_file(filename)
2
4
  # ASSUMPTION: We are running the RSpec suite from the root of a project tree
3
5
  update_config = true
4
6
  local_config_file = File.join(Dir.getwd, filename)
5
7
 
6
8
  if File.exist?(local_config_file)
7
- latest_conf = File.read(File.expand_path("../../../../../#{filename}", __FILE__))
8
- current_conf = File.read(local_config_file)
9
+ @message ||= []
10
+
11
+ latest_conf_path = File.expand_path("../../../../../#{filename}", __FILE__)
12
+ latest_conf = File.read(latest_conf_path)
13
+ @message << "macmillan-utils config file = #{latest_conf_path}"
14
+
15
+ current_conf = File.read(local_config_file)
16
+ @message << "current repo config file = #{local_config_file}"
17
+
9
18
  update_config = false if current_conf == latest_conf
10
19
  end
11
20
 
@@ -26,12 +35,18 @@ RSpec.configure do |config|
26
35
  config_updated = config_files.map { |file| check_config_file(file) }.any?
27
36
 
28
37
  if config_updated
29
- puts 'WARNING: You do not have the latest set of Macmillan::Utils config files.'
30
- puts ' These have now been updated for you. :)'
31
- puts ''
32
- puts ' You can run RSpec again now.'
33
- puts ''
34
- puts " Don't forget to commit the config files (#{config_files.join(', ')}) to git!"
38
+ puts "\nWARNING: Your local config file(s) have been replaced with the versions \n"\
39
+ "from macmillan-utils gem, on the assumption macmillan-utils is up-to-date.\n"\
40
+ "\nIf you see this failure on *CI*, you may want to run *locally*: \n"\
41
+ "$ bundle update macmillan-utils \n"\
42
+ "before re-running the specs, then committing and pushing the updated configs.\n".red
43
+
44
+ @message.each do |msg|
45
+ puts "Please note: \n #{msg}".red
46
+ end
47
+
48
+ puts "\nYou can now re-run RSpec without this failure interfering.".red
49
+
35
50
  raise '...'
36
51
  end
37
52
  end
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency 'multi_test'
31
31
  spec.add_dependency 'syslog-logger'
32
32
  spec.add_dependency 'rubocop'
33
+ spec.add_dependency 'colorize'
33
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macmillan-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.33
4
+ version: 1.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Springer Nature
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: colorize
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
209
223
  description:
210
224
  email:
211
225
  - npp-developers@macmillan.com