posix-fileutils 0.1.8 → 0.1.9

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTIxZTMwZDhhODYwMTk3Y2E4YWViNmY2ZmIxNWVhNDQ2Y2NlZWIyMg==
4
+ NzBjYWRkOGIyMGNjZjU0MTczZjIzNzIyNGVjMzU4NThlYzc3ZjUwMg==
5
5
  data.tar.gz: !binary |-
6
- MGFlNjhjMjZmZDFjMjc4ZmY0ODc3M2I5OWVlODFjMzRiMmU1NjM1Zg==
6
+ ODliZjc0NTQwNjJiMjVjMGIzZDMzNTM3ZmRjZDNlNDA5NmViMmNkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTIxNzZlMzAwNDI1YjQ4OGNkNmNiMDkxNTEzZGZhMjRiOWY1N2RlNjg4M2Uy
10
- ZGE1NDQ1YzkxNzExZWFhZDkxYTE4ZGI2MTc1NGJjY2U4OWM3ZTgwYWM5NmNl
11
- YTc1ZmExN2U1MmFhMjQwOWFlMDQyODEzZWM3YjY5NDRhODdlNDY=
9
+ M2EwYjUwZWUxNzQ0OThmZDU2MTRiYWM1ZDNkM2UyZjg0NDUwZmY2ODZhYjg2
10
+ ZTBmZWYzOTJmNTE5YTBmN2U1NTI4NTQwNjEyNmUwNjc5ZjMwMTYxZjdmNmUw
11
+ M2Y4MDc2NTE3MGU3YmJlM2MyZDU4YTEwMDdkOTkyYzk0NWEyZDQ=
12
12
  data.tar.gz: !binary |-
13
- Y2VjZDU5ZjI2OTBiZTAyM2Y1NGNiODFjM2Q5ZjFkZjVhYmZiNzYyNDVhMjQw
14
- OGM4YTU1OTBiN2Q1N2Y0Mzk0ZWM3MWRhOTkwYzhlMWY0YTQ2OTQ1Njk1ZTkw
15
- MDdiZDM4Zjk0ZjgwZGU4MGRkMDc1NzY1MGJkM2UzYWM4NTZlMGQ=
13
+ ZTdhNjYzYjRmNWM5MjhiNWUwNjc3OGQ3MWMyMDYzNDYyMDIxOWY0ODUzMGY1
14
+ ZDBjNmU4NWMzOGRmYTEzNzFhMGVjNzk3YWJmNmViNDcyNTAzMjIwMzA4NWZm
15
+ NDVkMjk5M2ZmNjVkMDJjYzQ1YTkxMWE0OWJmMjVhYzIxYTBjNmU=
@@ -17,16 +17,24 @@ class Array
17
17
  end
18
18
 
19
19
  module Fs
20
- $fudeopt = [].to_set
20
+ @defopts = [].to_set
21
21
  @popts = {
22
- :cp => [:T,:a,:v,:r].to_set,
23
- :mv => [:T,:a,:v,:r].to_set,
24
- :rm => [:v, :f, :r].to_set,
25
- :touch => [:v].to_set,
26
- :pwd => [].to_set,
27
- :mkdir => [:v, :p].to_set,
28
- :dsync => [:v, ].to_set,
29
- }
22
+ :cp => [:T,:a,:v,:r ],
23
+ :mv => [:T,:a,:v,:r ],
24
+ :rm => [ :v,:r,:f ],
25
+ :touch => [ :v ],
26
+ :pwd => [ ],
27
+ :mkdir => [ :v, :p],
28
+ :dsync => [ :v, ],
29
+ }.inject({}) do |h,(k,v)| h[k]=v.to_set; h end
30
+
31
+ class << self
32
+ attr_accessor :defopts
33
+ end
34
+
35
+ def self.popts
36
+ @popts.clone
37
+ end
30
38
 
31
39
  def self.parse_cp_args src, dst, *opts
32
40
  raise ArgumentError unless !dst.a?
@@ -57,7 +65,7 @@ module Fs
57
65
  opts_s = '-f '
58
66
 
59
67
  [:T, :a, :v, :r].each do |opt|
60
- opts_s << "-#{opt.to_s} " if include?(opt) || $fudeopt.include?(opt)
68
+ opts_s << "-#{opt.to_s} " if include?(opt) || Fs.defopts.include?(opt)
61
69
  end
62
70
 
63
71
  opts_s
@@ -86,7 +94,7 @@ module Fs
86
94
 
87
95
  raise ArgumentError unless src.directory? && dst.directory?
88
96
 
89
- if opts.included? :d
97
+ if opts.include? :d
90
98
  Dir["#{dst.to_s}/**/{*,.*}"].each do |file|
91
99
  file = Pathname.new file
92
100
  next unless file.exist?
@@ -144,7 +152,7 @@ module Fs
144
152
  opts_s = ''
145
153
 
146
154
  @flags.each do |opt|
147
- opts_s << "-#{opt.to_s} " if include?(opt) || $fudeopt.include?(opt)
155
+ opts_s << "-#{opt.to_s} " if include?(opt) || Fs.defopts.include?(opt)
148
156
  end
149
157
 
150
158
  opts_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posix-fileutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - A. Levenkov