rxfreader 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rxfreader.rb +39 -39
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 484b86a38ee6a1eb367c9fbc452df14ea7affbff9463c82b367bf301a50bd53e
|
4
|
+
data.tar.gz: f7b14e2425704f17c87f6193025485cb635ca031fda59867cff2bfb69d864da7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e770d3080daddb18caa3e35388964475d59e0960804cf7f9fb7ed6ed289e0426f2a3dfb82c83af146e32c30b26fa04b37f650da72c49946cce423c45a5b4807
|
7
|
+
data.tar.gz: d86a4361e24c33df96e210d18ce2f6e040aea2b7eb7736cbe0618ec3b9f2a1cfce00257e5c972314304c695751514909e8cee1d9b1c5ab642a15f3c211f524cd
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rxfreader.rb
CHANGED
@@ -15,61 +15,61 @@ module RXFRead
|
|
15
15
|
|
16
16
|
class FileX
|
17
17
|
|
18
|
-
def self.exists?(
|
18
|
+
def self.exists?(s) RXFReader.exists?(s) end
|
19
|
+
def self.filetype(s) RXFReader.filetype(s) end
|
20
|
+
def self.read(s) RXFReader.read(s).first end
|
19
21
|
|
20
|
-
|
22
|
+
end
|
21
23
|
|
22
|
-
|
23
|
-
when :file
|
24
|
-
File
|
25
|
-
when :dfs
|
26
|
-
DfsFile
|
27
|
-
else
|
28
|
-
nil
|
29
|
-
end
|
24
|
+
end
|
30
25
|
|
31
|
-
return nil unless filex
|
32
26
|
|
33
|
-
|
27
|
+
class RXFReaderException < Exception
|
28
|
+
end
|
34
29
|
|
35
|
-
|
30
|
+
class RXFReader
|
31
|
+
using ColouredText
|
36
32
|
|
33
|
+
def self.exists?(filename)
|
37
34
|
|
38
|
-
|
35
|
+
type = self.filetype(filename)
|
39
36
|
|
40
|
-
|
37
|
+
filex = case type
|
38
|
+
when :file
|
39
|
+
File
|
40
|
+
when :dfs
|
41
|
+
DfsFile
|
42
|
+
else
|
43
|
+
nil
|
44
|
+
end
|
41
45
|
|
42
|
-
|
43
|
-
when /^https?:\/\//
|
44
|
-
:http
|
45
|
-
when /^dfs:\/\//
|
46
|
-
:dfs
|
47
|
-
when /^file:\/\//
|
48
|
-
:file
|
49
|
-
else
|
46
|
+
return nil unless filex
|
50
47
|
|
51
|
-
|
52
|
-
:file
|
53
|
-
else
|
54
|
-
:text
|
55
|
-
end
|
48
|
+
filex.exists? filename
|
56
49
|
|
57
|
-
|
58
|
-
end
|
50
|
+
end
|
59
51
|
|
60
|
-
|
61
|
-
RXFReader.read(x).first
|
62
|
-
end
|
52
|
+
def self.filetype(x)
|
63
53
|
|
64
|
-
|
65
|
-
end
|
54
|
+
return :string if x.lines.length > 1
|
66
55
|
|
56
|
+
case x
|
57
|
+
when /^https?:\/\//
|
58
|
+
:http
|
59
|
+
when /^dfs:\/\//
|
60
|
+
:dfs
|
61
|
+
when /^file:\/\//
|
62
|
+
:file
|
63
|
+
else
|
67
64
|
|
68
|
-
|
69
|
-
|
65
|
+
if File.exists?(x) then
|
66
|
+
:file
|
67
|
+
else
|
68
|
+
:text
|
69
|
+
end
|
70
70
|
|
71
|
-
|
72
|
-
|
71
|
+
end
|
72
|
+
end
|
73
73
|
|
74
74
|
def self.read(x, h={})
|
75
75
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxfreader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ZhYGFOGLCyFBzNWg6gwMKjzpzDZB/H0+GTRB2c3+7DVuJWqyC5SbGnVLkT4Q8+B6
|
36
36
|
Ws39Z48SRONdDWtHwAiUtnU+
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: gpd-request
|
metadata.gz.sig
CHANGED
Binary file
|