code_manifest 1.3.0 → 1.4.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: c1933fca25570b9db88c444401b2be9ebac5f75550959af0afdcfd0df1c94dd2
4
- data.tar.gz: a4372d5d3bc2ebbc1e0373636a23e5b974af6a24dc5f64f496a3794715f93809
3
+ metadata.gz: 85dc605af26d3707bb98d61bf27ff898bb8582c5a11220b3b5d54bf17fc1f824
4
+ data.tar.gz: 856aa8f8a5e703e076aedfa4c4676245e6786eaa7ad834f967bfa8864b00ecee
5
5
  SHA512:
6
- metadata.gz: c848fc474a9a5f59e3e4d55588d1781b2d4a1834314a4a0bf511779046ae7a020635f233e77502fb32f852d58af817fce07ccd3159b8bedc2d4f58f6543495cd
7
- data.tar.gz: 52ebaf7b9d59a2546112f9c5180f3add24cc7ae28c5022db26160a27ff0ee4e1f42c09f8ba49cafcaae733d730799d8215f82f8f4e9731fd06a5d95269e8692d
6
+ metadata.gz: d36a050c65f13dac20af4a540007ad8ef5c8c396492c93a51541bcdffee3ec8413ce0e78d8b62e2c9c821f7a073817bad96f380058c4f5c2f02cc507c60269b0
7
+ data.tar.gz: 597149b71d2a7514989de7843e75621124b15e883a7d5e8bb62e935b3a834f514fedb2cf00f78b13fcfa86790efa6c1e8dd428dd0f50ddbd92c12ead27a8c560
@@ -27,7 +27,7 @@ module CodeManifest
27
27
  end
28
28
 
29
29
  def matches(paths)
30
- result_paths = paths.select do |path|
30
+ result_paths = Array(paths).select do |path|
31
31
  inclusion_rules.any? { |rule| rule.match?(path) }
32
32
  end
33
33
  result_paths.reject! do |path|
@@ -56,12 +56,13 @@ module CodeManifest
56
56
  end
57
57
 
58
58
  def files_with_relative_path(files)
59
- files.map do |file|
60
- pathname = Pathname.new(file)
61
- next if pathname.directory?
59
+ prefix = File.join(CodeManifest.root, "/")
62
60
 
63
- pathname.relative_path_from(CodeManifest.root).to_s
64
- end.compact
61
+ files.filter_map do |file|
62
+ next if File.directory?(file)
63
+
64
+ file.delete_prefix(prefix)
65
+ end
65
66
  end
66
67
  end
67
68
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pathname'
4
-
5
3
  module CodeManifest
6
4
  class Rule
7
5
  attr_reader :exclude, :glob
@@ -26,10 +24,9 @@ module CodeManifest
26
24
  end
27
25
 
28
26
  def match?(file)
29
- file = Pathname.new(file)
30
- file = @root.join(file) unless file.absolute?
27
+ file = File.join(@root, file) unless File.absolute_path?(file)
31
28
 
32
- File.fnmatch?(glob, file.to_s, Manifest::GLOB_OPTIONS)
29
+ File.fnmatch?(glob, file, Manifest::GLOB_OPTIONS)
33
30
  end
34
31
  end
35
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeManifest
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_manifest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.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: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -41,7 +41,7 @@ licenses: []
41
41
  metadata:
42
42
  homepage_uri: https://github.com/rubyatscale/code_manifest
43
43
  source_code_uri: https://github.com/rubyatscale/code_manifest
44
- changelog_uri: https://github.com/rubyatscale/code_manifest/blob/main/releases
44
+ changelog_uri: https://github.com/rubyatscale/code_manifest/releases
45
45
  post_install_message:
46
46
  rdoc_options: []
47
47
  require_paths: