path_expander 1.1.0 → 1.1.2

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: fea80c4cff03e65125325d75b60a64e1e8fdfb2ae959483ea63fb1081decdc96
4
- data.tar.gz: afbbf32a9ba9bffff56d42ecde177ac22411575276b45b70094a6ea026e6e9dc
3
+ metadata.gz: 4f3cb351003b92ebe04cc2ef3c2d126db06787be3fd4d6636b62bcb93092d570
4
+ data.tar.gz: d11f4224c675807e936943aa675c63d939d4e5544199aacfcd23a65a816f10fb
5
5
  SHA512:
6
- metadata.gz: 24a9797858c8a8b50a041d3a7855e30653ff0ce6c3c21086c9224e33bceb9feeb7dd14a4b38ab5789683b19cb17763e96bcdaf9b497d2e1a22ade78d3c7227e7
7
- data.tar.gz: ce87766ab92c89098229bda19275ad41e54636e9d8a5b13605bbc46129c0e66d72793c6cf77421d0cf681806148e1af5cfeceb07d67f5be2044ea87154594a71
6
+ metadata.gz: f0f13dddfee467c6782505c68648746c09e41968b6d2e02978e69a50faa97931afe9cb79908b289a861e01fc23ff1da256c973867ec1b23c16460a6b9692409a
7
+ data.tar.gz: dfaeb077862e1aa9c84d033119c6de5caa4fe54a84094823eb88715f9c6d6fcffbe33c4ef375e52df8cbea24e7063b9dfce044485d8fb09faf9e91858127765f
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,15 @@
1
+ === 1.1.2 / 2024-07-11
2
+
3
+ * 1 bug fix:
4
+
5
+ * Normalize './' off the front of all paths so options like '.' and '-test' work together better
6
+
7
+ === 1.1.1 / 2022-07-03
8
+
9
+ * 1 bug fix:
10
+
11
+ * Process plain '-' as a file, not an option.
12
+
1
13
  === 1.1.0 / 2019-09-22
2
14
 
3
15
  * 1 minor enhancement:
@@ -39,4 +51,3 @@
39
51
  * 1 major enhancement
40
52
 
41
53
  * Birthday!
42
-
data/lib/path_expander.rb CHANGED
@@ -13,7 +13,7 @@
13
13
  # PathExpander.
14
14
 
15
15
  class PathExpander
16
- VERSION = "1.1.0" # :nodoc:
16
+ VERSION = "1.1.2" # :nodoc:
17
17
 
18
18
  ##
19
19
  # The args array to process.
@@ -45,6 +45,8 @@ class PathExpander
45
45
  # Takes an array of paths and returns an array of paths where all
46
46
  # directories are expanded to all files found via the glob provided
47
47
  # to PathExpander.
48
+ #
49
+ # Paths are normalized to not have a leading "./".
48
50
 
49
51
  def expand_dirs_to_files *dirs
50
52
  dirs.flatten.map { |p|
@@ -53,7 +55,7 @@ class PathExpander
53
55
  else
54
56
  p
55
57
  end
56
- }.flatten.sort
58
+ }.flatten.sort.map { |s| s.delete_prefix "./" }
57
59
  end
58
60
 
59
61
  ##
@@ -74,6 +76,7 @@ class PathExpander
74
76
  # -not_a_path :: Add to flags to be processed.
75
77
  # dir_path :: Expand and add to files to be processed.
76
78
  # file_path :: Add to files to be processed.
79
+ # - :: Add "-" (stdin) to files to be processed.
77
80
  #
78
81
  # See expand_dirs_to_files for details on how expansion occurs.
79
82
  #
@@ -94,6 +97,8 @@ class PathExpander
94
97
  when /^@(.*)/ then # push back on, so they can have dirs/-/@ as well
95
98
  clean = false
96
99
  args.concat process_file $1
100
+ when "-" then
101
+ pos_files << arg
97
102
  when /^-(.*)/ then
98
103
  if File.exist? $1 then
99
104
  clean = false
@@ -34,7 +34,7 @@ class TestPathExpander < Minitest::Test
34
34
  assert_equal %w[Rakefile], expander.expand_dirs_to_files("Rakefile")
35
35
  end
36
36
 
37
- def test_expand_dirs_to_files_sorting
37
+ def test_expand_dirs_to_files__sorting
38
38
  exp = %w[test/test_bad.rb test/test_path_expander.rb]
39
39
  input = %w[test/test_path_expander.rb test/test_bad.rb]
40
40
 
@@ -42,6 +42,12 @@ class TestPathExpander < Minitest::Test
42
42
  assert_equal %w[Rakefile], expander.expand_dirs_to_files("Rakefile")
43
43
  end
44
44
 
45
+ def test_expand_dirs_to_files__leading_dot
46
+ exp = %w[test/test_bad.rb test/test_path_expander.rb]
47
+
48
+ assert_equal exp, expander.expand_dirs_to_files("./test")
49
+ end
50
+
45
51
  def test_filter_files_dir
46
52
  assert_filter_files [], "test/"
47
53
  assert_filter_files_absolute_paths [], "test/"
@@ -165,6 +171,12 @@ class TestPathExpander < Minitest::Test
165
171
  "-v")
166
172
  end
167
173
 
174
+ def test_process_args_dash
175
+ assert_process_args(%w[-],
176
+ %w[-v],
177
+ "-", "-v")
178
+ end
179
+
168
180
  def test_process_flags
169
181
  exp = %w[a b c]
170
182
  act = expander.process_flags %w[a b c]
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- }
1
+ A^�~�������V���/����b
2
+ ����.������D8�2�t�`t�쇪�f���C�$'V��,�+���M#�]3���n���Բ ���\0��H���ju�ð��b ��H�h�r��n �/^����u�I(]͌�^�8��Í��^x}��z��"�
3
+ �D�n�i���1��ݒ�P���N�Z�c5"��f�Uy���pA}z��X^��
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: path_expander
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTE4MTIwNDIxMzAxNFoXDTE5MTIwNDIxMzAxNFowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTI0MDEwMjIxMjE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1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
29
+ S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
30
+ deKfBjgVAq7EYHu1AczzlUly
31
31
  -----END CERTIFICATE-----
32
- date: 2019-09-22 00:00:00.000000000 Z
32
+ date: 2024-07-11 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '3.18'
60
+ version: '4.2'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '3.18'
67
+ version: '4.2'
68
68
  description: |-
69
69
  PathExpander helps pre-process command-line arguments expanding
70
70
  directories into their constituent files. It further helps by
@@ -99,8 +99,9 @@ files:
99
99
  homepage: https://github.com/seattlerb/path_expander
100
100
  licenses:
101
101
  - MIT
102
- metadata: {}
103
- post_install_message:
102
+ metadata:
103
+ homepage_uri: https://github.com/seattlerb/path_expander
104
+ post_install_message:
104
105
  rdoc_options:
105
106
  - "--main"
106
107
  - README.rdoc
@@ -117,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  - !ruby/object:Gem::Version
118
119
  version: '0'
119
120
  requirements: []
120
- rubygems_version: 3.0.6
121
- signing_key:
121
+ rubygems_version: 3.5.14
122
+ signing_key:
122
123
  specification_version: 4
123
124
  summary: PathExpander helps pre-process command-line arguments expanding directories
124
125
  into their constituent files
metadata.gz.sig CHANGED
Binary file