code_manifest 1.9.0 → 1.9.1

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: 493688f36f07b44bcbe54fb5750c3ed0498a9953ad8291ad002feceb40a77e39
4
- data.tar.gz: cc2209736087e9314de1375c10eaefc582210078b5aafcf976e68e3c9c75b538
3
+ metadata.gz: a0c3afdd39ef7e2ddbf9c04b6b9d57b8cbe8800e6d4defb5b0627afb8b38028e
4
+ data.tar.gz: 320709af1bc9356e20bd6afb8e4395a88ad8103ed8f67b5085ab5930428c3986
5
5
  SHA512:
6
- metadata.gz: 4f9b50ac2ac16f43407801008b26adb5a3c28abfdad8d560db7a0980cbca04999c494a80d13871b7236984d78cbe84176cf82ac08d66910eff8960df197e0e67
7
- data.tar.gz: 1c374ea0515a88ab73f0f8b319740aec550c7493d2c137fc4ae9fee2bb64740e0a8f9de3ae520f0cbe6d70ecbf6405155d56b6814effff9a6916dc929b918e8b
6
+ metadata.gz: b4e8fe44ca73e2e9a332e8e6ac4a624fe3c1eadf0d6a9d64521e155e0cf08bfccb324737bf9db676c06ccf264a8ce55f0cb81554c01512801a0e9a76ccba816f
7
+ data.tar.gz: bb3b91e251da00091f9b4708e6ef4317043d3275ea1d4915c32afb03ef93429da15016d2938423c1e37506e52912ac1ef58677d67ba4b38d7a831a217bf887cc
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Gusto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -40,3 +40,7 @@ CodeManifest[:js].digest
40
40
  ## Contributing
41
41
 
42
42
  Bug reports and pull requests are welcome on GitHub at https://github.com/rubyatscale/code_manifest.
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](LICENSE).
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'digest/md5'
4
- require_relative 'rule'
3
+ require "digest/md5"
4
+
5
+ require_relative "rule"
5
6
 
6
7
  module CodeManifest
7
8
  class Manifest
@@ -13,6 +14,7 @@ module CodeManifest
13
14
  @rules ||= Array(patterns).map do |pattern|
14
15
  Rule.new(pattern)
15
16
  end
17
+
16
18
  @cache = {}
17
19
  end
18
20
 
@@ -31,9 +33,9 @@ module CodeManifest
31
33
  end
32
34
 
33
35
  def matches(paths)
34
- Array(paths).select do |path|
35
- cached_match =
36
- if @cache.key?(path)
36
+ Array(paths)
37
+ .select do |path|
38
+ cached_match = if @cache.key?(path)
37
39
  @cache.fetch(path)
38
40
  else
39
41
  @cache[path] = [
@@ -41,8 +43,10 @@ module CodeManifest
41
43
  exclusion_rules.any? { |rule| rule.match?(path) }
42
44
  ]
43
45
  end
44
- cached_match.first && !cached_match.last
45
- end.sort!
46
+
47
+ cached_match.first && !cached_match.last
48
+ end
49
+ .sort!
46
50
  end
47
51
 
48
52
  def matches_all?(paths)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeManifest
4
- VERSION = '1.9.0'
4
+ VERSION = "1.9.1"
5
5
  end
data/lib/code_manifest.rb CHANGED
@@ -1,14 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pathname'
4
- require 'yaml'
5
- require_relative 'code_manifest/version'
6
- require_relative 'code_manifest/manifest'
3
+ require "pathname"
4
+ require "yaml"
5
+
6
+ require_relative "code_manifest/version"
7
+ require_relative "code_manifest/manifest"
7
8
 
8
9
  module CodeManifest
9
- class Error < StandardError; end
10
+ class Error < StandardError
11
+ end
10
12
 
11
- MANIFEST_FILE = '.code_manifest.yml'
13
+ MANIFEST_FILE = ".code_manifest.yml"
12
14
  KEY_PATTERN = /[a-z_0-9]+/.freeze
13
15
 
14
16
  class << self
metadata CHANGED
@@ -1,29 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_manifest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  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
27
12
  - !ruby/object:Gem::Dependency
28
13
  name: rspec
29
14
  requirement: !ruby/object:Gem::Requirement
@@ -59,18 +44,19 @@ executables: []
59
44
  extensions: []
60
45
  extra_rdoc_files: []
61
46
  files:
47
+ - LICENSE
62
48
  - README.md
63
49
  - lib/code_manifest.rb
64
50
  - lib/code_manifest/manifest.rb
65
51
  - lib/code_manifest/rule.rb
66
52
  - lib/code_manifest/version.rb
67
53
  homepage: https://github.com/rubyatscale/code_manifest
68
- licenses: []
54
+ licenses:
55
+ - MIT
69
56
  metadata:
70
57
  homepage_uri: https://github.com/rubyatscale/code_manifest
71
58
  source_code_uri: https://github.com/rubyatscale/code_manifest
72
59
  changelog_uri: https://github.com/rubyatscale/code_manifest/releases
73
- post_install_message:
74
60
  rdoc_options: []
75
61
  require_paths:
76
62
  - lib
@@ -78,15 +64,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
64
  requirements:
79
65
  - - ">="
80
66
  - !ruby/object:Gem::Version
81
- version: '2.7'
67
+ version: '3.3'
82
68
  required_rubygems_version: !ruby/object:Gem::Requirement
83
69
  requirements:
84
70
  - - ">="
85
71
  - !ruby/object:Gem::Version
86
72
  version: '0'
87
73
  requirements: []
88
- rubygems_version: 3.5.22
89
- signing_key:
74
+ rubygems_version: 3.6.9
90
75
  specification_version: 4
91
76
  summary: A code manifest
92
77
  test_files: []