code_manifest 1.6.0 → 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: 211b0ae49d5f5dce85d9f53d13c20c27e6d1cb00a57a6a74dc7ac2a2382531e7
4
- data.tar.gz: 112bd81d18216f690854b91959fcd0b8751f1920c0c91a6f4f04e7d1a6966456
3
+ metadata.gz: ce96e05345e51d540aacc972db444154ae247a78ff6bf49e5b2b7ffa1c3f387c
4
+ data.tar.gz: 6a11aa482a2aacd63e2013bdf1a17eb7a329c9003727daf90ed4b730f847fafc
5
5
  SHA512:
6
- metadata.gz: 91c7488e0b6f981f86b7abd43528c5c6f042092f8fa5ae48719aa4ebb8a2185c5119e638b48d7b07f716a77391da126bdbd152288b1a930d03dc9d60117067a4
7
- data.tar.gz: 4c95aaa6414587ff839299847a3e583808fb98538ba378a0b90aae29660362082cbfc5912f6dad70d3a594d37f6aadb5fd7ee7dc351faa0b6dd992df9c92d999
6
+ metadata.gz: ab83455ee76f574238dc5de1f3c1ca5263302719c915557021ef8aa4291e938ee81e7672b1f28c9800c167ef5ae6ad86f441d063ef22d7a1e18a33d4eba75c35
7
+ data.tar.gz: eb00e5a8bb44dcf64f636ba3a4509e410ab5fee7f83a6afb7433aab0abf96b7bf8674dbc0c0542229532a86fd757dc9cd484a6614469bf45f461ae2068d9dcdc
data/README.md CHANGED
@@ -39,4 +39,4 @@ CodeManifest['js'].digest
39
39
 
40
40
  ## Contributing
41
41
 
42
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/code_manifest.
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rubyatscale/code_manifest.
@@ -43,6 +43,10 @@ module CodeManifest
43
43
  result_paths.sort!
44
44
  end
45
45
 
46
+ def matches_all?(paths)
47
+ matches(paths) == paths
48
+ end
49
+
46
50
  private
47
51
 
48
52
  def inclusion_rules
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeManifest
4
- VERSION = '1.6.0'
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.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-28 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
@@ -42,7 +56,7 @@ metadata:
42
56
  homepage_uri: https://github.com/rubyatscale/code_manifest
43
57
  source_code_uri: https://github.com/rubyatscale/code_manifest
44
58
  changelog_uri: https://github.com/rubyatscale/code_manifest/releases
45
- post_install_message:
59
+ post_install_message:
46
60
  rdoc_options: []
47
61
  require_paths:
48
62
  - lib
@@ -57,8 +71,8 @@ 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.7
61
- signing_key:
74
+ rubygems_version: 3.5.9
75
+ signing_key:
62
76
  specification_version: 4
63
77
  summary: A code manifest
64
78
  test_files: []