drb_fileserver 0.2.2 → 0.2.3

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: e59d6867b62f30773bbcd561e116174751b71e2c946ffd906a2f7dfe9c197b4f
4
- data.tar.gz: af56b9f11f5c9337203419d111d2866bca95e515569b50e871cc53872547b7a0
3
+ metadata.gz: 89b1ae73054385ea9962eab14a5e859d96a9e48b7f5a8789dc56b75f1ab3cda3
4
+ data.tar.gz: 4237e714ef973930b4ee53b3fa164150b4b816cf7f548d10b8d98d3b2fe3ea69
5
5
  SHA512:
6
- metadata.gz: 22132c132ce6bb1eec3d788e87d57dfddfe2f61fbd81df38d91bd0040017ac2d2d318c4c013fe62efcdcca7382d1b15067a33e0f2f99d5855d815517369bfd9a
7
- data.tar.gz: 57c6aad57d17edb78a13c8686ef786e257e016e0e5130172c2f9048cbaa1a491fc5dac499979dc38f732fa445f822a567edc66b08ef516e37496c37b1c50b711
6
+ metadata.gz: 853e1e7b4719a6b79a9da9d8d5b572f648597d5fbcfdda09ca56823e795e600838d1bc3d5def0d54fe9151121d6238ca25aa4a0383afec51e2dda5c84150de4c
7
+ data.tar.gz: 5979926956273ae6757a0cc4dc6bdb0dfd98ae5bab1f41fcf369b776f467d2f708c4ffdd99335666de67b6d24beaa19483413d72d4c5af595b873b64cb62112b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -30,10 +30,26 @@ class DRbFileServer
30
30
  def exists?(filename)
31
31
  File.exists? File.join(@path, filename)
32
32
  end
33
-
34
- def ls(path)
35
- path = File.join(path, '*') if File.exists? File.join(@path, path)
36
- Dir[File.join(@path, path)].map {|x| File.basename(x) }
33
+
34
+ # path can include a wildcard and the switch -ltr
35
+ #
36
+ def ls(rawpath)
37
+
38
+ path, switch = rawpath.split(/\s+/,2)
39
+ wildcard = path.include?('*') ? '' : '*'
40
+ path = File.join(path, wildcard) if File.exists? File.join(@path, path)
41
+
42
+ a = Dir[File.join(@path, path)].map do |x|
43
+
44
+ File.basename(x)
45
+ end
46
+
47
+ if switch == '-ltr' then
48
+ a.sort_by {|x| File.mtime(File.join(@path, File.dirname(path), x)) }
49
+ else
50
+ a
51
+ end
52
+
37
53
  end
38
54
 
39
55
  def mkdir(name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drb_fileserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  CYk9iqpRnQJDnjCVAE3UbYCDhkJPASVjCdwNhKUUKiwlI14QHfOn9xxOTD26YWWx
36
36
  cRdPsJYHMjfHdDDxkkkgPxTk
37
37
  -----END CERTIFICATE-----
38
- date: 2019-02-18 00:00:00.000000000 Z
38
+ date: 2019-08-18 00:00:00.000000000 Z
39
39
  dependencies: []
40
40
  description:
41
41
  email: james@jamesrobertson.eu
metadata.gz.sig CHANGED
Binary file