code_manifest 1.6.1 → 1.7.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: 866e5e7d09033a08f9b5f15406e9e068d9a4a89281ca9db08ecf07e818f99f8f
4
- data.tar.gz: '028bc4cdddc7bf719f320ecdd267250fb07de2428a30a61836751a040d853962'
3
+ metadata.gz: ce96e05345e51d540aacc972db444154ae247a78ff6bf49e5b2b7ffa1c3f387c
4
+ data.tar.gz: 6a11aa482a2aacd63e2013bdf1a17eb7a329c9003727daf90ed4b730f847fafc
5
5
  SHA512:
6
- metadata.gz: efe594dbcd73712bdf96bfb5ff51810556f91a0aacbcc11bb1d00aa2b650309cd70964859a89554cd629e7bfbb1c225c05a324cc7d3f90575b9a61a21ac74649
7
- data.tar.gz: c4866e6c9d40160fd00e4325a2df8b8659c64d4a680e6fb155736c43cf345e76d757408b67f015b40b6cd8dcc9826e4824ee8f8e42bde10816e7c431f4cab7d7
6
+ metadata.gz: ab83455ee76f574238dc5de1f3c1ca5263302719c915557021ef8aa4291e938ee81e7672b1f28c9800c167ef5ae6ad86f441d063ef22d7a1e18a33d4eba75c35
7
+ data.tar.gz: eb00e5a8bb44dcf64f636ba3a4509e410ab5fee7f83a6afb7433aab0abf96b7bf8674dbc0c0542229532a86fd757dc9cd484a6614469bf45f461ae2068d9dcdc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeManifest
4
- VERSION = '1.6.1'
4
+ VERSION = '1.7.0'
5
5
  end
data/lib/code_manifest.rb CHANGED
@@ -21,20 +21,20 @@ module CodeManifest
21
21
  @root ||= find_root(start_path)
22
22
  end
23
23
 
24
- private
24
+ def load_file(manifest_file)
25
+ YAML.load_file(manifest_file, aliases: true).each_with_object({}) do |(name, patterns), collection|
26
+ next unless name.match?(KEY_PATTERN)
25
27
 
26
- def manifests
27
- @manifests ||= begin
28
- manifest_file = root.join(MANIFEST_FILE)
28
+ raise ArgumentError, "#{name} defined multiple times in #{manifest_file}" if collection.key?(name)
29
29
 
30
- load_manifest(manifest_file).each_with_object({}) do |(name, patterns), collection|
31
- next unless name.match?(KEY_PATTERN)
30
+ collection[name] = Manifest.new(patterns.flatten)
31
+ end
32
+ end
32
33
 
33
- raise ArgumentError, "#{name} defined multiple times in #{MANIFEST_FILE}" if collection.key?(name)
34
+ private
34
35
 
35
- collection[name] = Manifest.new(patterns.flatten)
36
- end
37
- end
36
+ def manifests
37
+ @manifests ||= load_file(root.join(MANIFEST_FILE))
38
38
  end
39
39
 
40
40
  def find_root(path)
@@ -44,12 +44,5 @@ module CodeManifest
44
44
 
45
45
  raise "#{MANIFEST_FILE} was not found in your project directory, please check README for instructions."
46
46
  end
47
-
48
- # https://stackoverflow.com/a/71192990
49
- def load_manifest(file)
50
- YAML.load_file(file, aliases: true)
51
- rescue ArgumentError
52
- YAML.load_file(file)
53
- end
54
47
  end
55
48
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_manifest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: psych
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -57,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
71
  - !ruby/object:Gem::Version
58
72
  version: '0'
59
73
  requirements: []
60
- rubygems_version: 3.3.13
74
+ rubygems_version: 3.5.9
61
75
  signing_key:
62
76
  specification_version: 4
63
77
  summary: A code manifest