yaml_normalizer 2.0.0.rc3 → 2.0.0

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: 64bf7d5fc2a4e87abf2804d165a46ea8001028bc73aced88f9b282a9179a8edf
4
- data.tar.gz: 2410def89831cdba0d34d9354b4eec01277e758ec30e9b01132bb47717f16339
3
+ metadata.gz: 4dd002fd2b568ad18986f04868de54c371d9a4c93f2e6955f9bbe578f2cab86b
4
+ data.tar.gz: ecad36bc46f4cde9983045633bdb0a6d6c5c819dbd58ef899b6fe707f0d82303
5
5
  SHA512:
6
- metadata.gz: 4b2b58516921ebbba165be4c9715268d80f0da05b5856adc0a760f8bb6edacb42e98abeb862561763799dadb8c2a13b5f93c5c3c53caf05b398c90806ca5cf93
7
- data.tar.gz: 064fc27c2b078ac794108da080a84ddc596a95855900d4e188edf6a6602896379d55cbc595a5807c0fda6aa48b3c437090f217c20f7b1e286ff2f7b618bac13c
6
+ metadata.gz: 4506ab09d6a8f5565b48e2d517aab6e9d8db777996f0a0a160ced6db6abfc556559445edac561a6f0c06465380f6e2ef03c050bc8e7d2ce692eb69c553139975
7
+ data.tar.gz: 7a2b86157806013d274f20611595e93238dc7c35c55921e3885ab8aa9fe7a7dd3c34eb9fbcb15e071a1dd5f8a9bb569f0df53f576e48b5f8a9f0ae5e0eee0c00
@@ -37,21 +37,20 @@ module YamlNormalizer
37
37
  def process(file)
38
38
  return true if IsYaml.call(file) && normalized?(file)
39
39
 
40
+ $stderr.print "#{file} not a YAML file\n"
40
41
  nil
41
42
  end
42
43
 
43
44
  def normalized?(file)
44
- $stdout.print "Processing #{file}\n"
45
-
46
45
  file = relative_path_for(file)
47
46
  input = read(file)
48
47
  norm = normalize_yaml(input)
49
48
  check = input.eql?(norm)
50
49
 
51
50
  if check
52
- $stdout.print "\t[PASSED] file is already normalized\n\n"
51
+ $stdout.print "[PASSED] already normalized #{file}\n"
53
52
  else
54
- $stdout.print "\t[FAILED] file needs normalization\n\n"
53
+ $stdout.print "[FAILED] normalization suggested for #{file}\n"
55
54
  end
56
55
 
57
56
  check
@@ -37,8 +37,7 @@ module YamlNormalizer
37
37
  # boolean value
38
38
  def parseable?
39
39
  parse(read(file))
40
- rescue Psych::SyntaxError => e
41
- $stderr.print "\t[ERROR] #{file} is not parseable as YAML - #{e.message}\n\n"
40
+ rescue Psych::SyntaxError
42
41
  false
43
42
  end
44
43
 
@@ -33,18 +33,20 @@ module YamlNormalizer
33
33
  private
34
34
 
35
35
  def process(file)
36
- normalize!(file) if IsYaml.call(file)
36
+ if IsYaml.call(file)
37
+ normalize!(file)
38
+ else
39
+ $stderr.print "#{file} not a YAML file\n"
40
+ end
37
41
  end
38
42
 
39
43
  def normalize!(file)
40
- $stdout.print "Processing #{file}\n"
41
44
  file = relative_path_for(file)
42
-
43
45
  if stable?(input = read(file), norm = normalize_yaml(input))
44
46
  File.open(file, 'w') { |f| f.write(norm) }
45
- $stdout.print "\t[PASSED] file has been normalized\n\n"
47
+ $stderr.print "[NORMALIZED] #{file}\n"
46
48
  else
47
- $stdout.print "\t[FAILED] file could not normalized\n\n"
49
+ $stderr.print "[ERROR] Could not normalize #{file}\n"
48
50
  end
49
51
  end
50
52
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module YamlNormalizer
4
4
  # The current Yaml Normalizer version
5
- VERSION = '2.0.0.rc3'
5
+ VERSION = '2.0.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_normalizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Sage Group plc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: peach
@@ -364,9 +364,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
364
364
  version: '3.0'
365
365
  required_rubygems_version: !ruby/object:Gem::Requirement
366
366
  requirements:
367
- - - ">"
367
+ - - ">="
368
368
  - !ruby/object:Gem::Version
369
- version: 1.3.1
369
+ version: '0'
370
370
  requirements: []
371
371
  rubygems_version: 3.3.5
372
372
  signing_key: