rxfreadwrite 0.1.0 → 0.1.1

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: 53a75685faa1391e4fd2e915771c703195daf2df69f044757334ea4fc3ea5628
4
- data.tar.gz: 2bd5b05e5d21dfb9543fa45186e82b7d632bd656a86d21979e954b5152077b59
3
+ metadata.gz: be9aed29d79ff21b058ffcc6509a8dbc0fcb157c1c2dd733475e26e0fb9fc6c7
4
+ data.tar.gz: e2831bde3a2272fdee7fe727410100104504b8668f5b8aa4a172778bf8a9c5a2
5
5
  SHA512:
6
- metadata.gz: 6cea2847602126677e8c8b1b7cd0655c04876d4393de6e5cc4857c95ddc80f73a945748e5df2e530e3f465894b91f870f22edf43c8c6535b4bf16555c4397e84
7
- data.tar.gz: afd2f74b8b8ee1028ef92e9b58fbd27de8f7b1d4fa08a8083e7db275fcc3a7723445e165c52a657b715c1dfd33e5be3d16ebcb3b7a4a143ed1003a4d55cfa5b6
6
+ metadata.gz: e228cf408ad01f8dcd3feb1512a498467a56b0df57f070569d80877e87c01602ad660098593e6015b51a9d21564a47a97f8d7bfc122f967427546a90bd64fbd3
7
+ data.tar.gz: 8c82a289ff13468c05c5a5afc2b763e787efa5913fa820dcabbb4c7a914b9e2f12418eac6ad3f87d96edb0f38260dd01e9f24ff626b2976179b0427065ed818c
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rxfreadwrite.rb CHANGED
@@ -8,6 +8,55 @@ require 'rxfreader'
8
8
  module RXFReadWriteModule
9
9
  include RXFRead
10
10
 
11
+
12
+ class DirX
13
+
14
+ def self.glob(s) RXFileReadWrite.glob(s) end
15
+
16
+ end
17
+
18
+ def FileX.exists?(filename)
19
+
20
+ type = FileX.filetype(filename)
21
+
22
+ filex = case type
23
+ when :file
24
+ File
25
+ when :dfs
26
+ DfsFile
27
+ else
28
+ nil
29
+ end
30
+
31
+ return nil unless filex
32
+
33
+ filex.exists? filename
34
+
35
+ end
36
+
37
+
38
+ def FileX.filetype(x)
39
+
40
+ return :string if x.lines.length > 1
41
+
42
+ case x
43
+ when /^https?:\/\//
44
+ :http
45
+ when /^dfs:\/\//
46
+ :dfs
47
+ when /^file:\/\//
48
+ :file
49
+ else
50
+
51
+ if File.exists?(x) then
52
+ :file
53
+ else
54
+ :text
55
+ end
56
+
57
+ end
58
+ end
59
+
11
60
  def FileX.write(x, s)
12
61
  RXFReadWrite.write(x, s)
13
62
  end
@@ -20,6 +69,15 @@ end
20
69
  class RXFReadWrite < RXFReader
21
70
  using ColouredText
22
71
 
72
+ def self.glob(s)
73
+
74
+ if s[/^dfs:\/\//] then
75
+ DfsFile.glob(s)
76
+ else
77
+ Dir.glob(s)
78
+ end
79
+
80
+ end
23
81
  def self.write(location, s=nil)
24
82
 
25
83
  case location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxfreadwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  gnYmJHVhKvNaFwL4ryulhkA+n8o3Ve6Kzo/AGlO2+Ge6H0bqIUbS8UisqDa7IwlY
36
36
  tvleW582+lzMrpAfWdGb4VFX
37
37
  -----END CERTIFICATE-----
38
- date: 2022-02-19 00:00:00.000000000 Z
38
+ date: 2022-02-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rxfreader
metadata.gz.sig CHANGED
Binary file