metadata_json_deps 1.0.0 → 1.1.0

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: 3e803ae6774dfd82ce39d3d64f1703189034d8c6d78ff66418c430dc2cf2f985
4
- data.tar.gz: e683a52be8a54d95f24f7ade2371989990006cf657a5dada336c96a185840481
3
+ metadata.gz: 6c6840a3a6e17518cfef0344bf3c5cc0108f15d737283f2a9079b226102cffad
4
+ data.tar.gz: 356bcd12f1b3f663fe34bd49065939e99312411fd23f19e9053cdd54768a24de
5
5
  SHA512:
6
- metadata.gz: e7c86f4aaaf908c29f102db2c9c17096e20ffc3f0ccbb9ffaf284ffddf21c9ac50c1039a2f81639cf07a600487aa22a4e37e75aa29d30413bb83fb0799b1fbcc
7
- data.tar.gz: be4e7cdd41619a6150c4abf9e4dbb649d95b3071492cf1d82047d07843fe8a28ebacbb4f1013bd9998af7524fca23b1b19d3d0fcb664b22e64de1d35fb76eab2
6
+ metadata.gz: 1a90c6e2465c768669076fab95b4874923ee746ef29ea6163947906e0cfec8c042768e54de9f89a9aa836f4b97eeede3e982490a8652a763d21778a2be1d1fb7
7
+ data.tar.gz: 3e38f96adb93132466817b9413a296ba3dd2c8f8d4950755578e19183d66691ad971d2ac7aa47f0163a55754e37085209662e29de90296955600a2b32c0636b8
data/README.md CHANGED
@@ -58,7 +58,7 @@ require 'metadata_json_deps'
58
58
  desc 'Run metadata-json-deps'
59
59
  task :metadata_deps do
60
60
  files = FileList['modules/*/metadata.json']
61
- MetadataJsonDeps::run(files)
61
+ abort if MetadataJsonDeps::run(files)
62
62
  end
63
63
  ```
64
64
 
@@ -8,4 +8,4 @@ OptionParser.new do |opts|
8
8
  opts.on("-v", "--[no-]verbose", "Run verbosely")
9
9
  end.parse!(into: options)
10
10
 
11
- MetadataJsonDeps.run(ARGV, options[:verbose])
11
+ exit(MetadataJsonDeps.run(ARGV, options[:verbose]))
@@ -9,7 +9,11 @@ module MetadataJsonDeps
9
9
 
10
10
  def get_module(name)
11
11
  name = PuppetForge::V3.normalize_name(name)
12
- @cache[name] ||= PuppetForge::Module.find(name)
12
+ begin
13
+ @cache[name] ||= PuppetForge::Module.find(name)
14
+ rescue Faraday::ResourceNotFound
15
+ raise PuppetForge::ModuleNotFound.new("Dependency #{name} not found on forge.puppet.com")
16
+ end
13
17
  end
14
18
  end
15
19
 
@@ -76,6 +80,8 @@ module MetadataJsonDeps
76
80
  def self.run(filenames, verbose = false)
77
81
  forge = ForgeVersions.new
78
82
 
83
+ exit_code = 0
84
+
79
85
  filenames.each do |filename|
80
86
  puts "Checking #{filename}"
81
87
  metadata = PuppetMetadata.read(filename)
@@ -84,6 +90,7 @@ module MetadataJsonDeps
84
90
  mod = forge.get_module(dependency)
85
91
 
86
92
  if mod.deprecated_at
93
+ exit_code |= 2
87
94
  if mod.superseded_by
88
95
  puts " #{dependency} was superseded by #{mod.superseded_by[:slug]}"
89
96
  elsif mod.deprecated_for
@@ -99,10 +106,13 @@ module MetadataJsonDeps
99
106
  puts " #{dependency} (#{constraint}) matches #{current}"
100
107
  end
101
108
  else
109
+ exit_code |= 1
102
110
  puts " #{dependency} (#{constraint}) doesn't match #{current}"
103
111
  end
104
112
  end
105
113
  end
114
+
115
+ exit_code
106
116
  end
107
117
  rescue Interrupt
108
118
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_json_deps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ewoud Kohl van Wijngaarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet_forge
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 0.3.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '3'
42
+ version: '4'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 0.3.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '3'
52
+ version: '4'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement