rxfreader 0.1.2 → 0.1.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: 04367755d439896ef0dd32410c15f170ae0852cef0a327991c81757a80da7399
4
- data.tar.gz: '094fb8b5b2979fb27ae9fc22640977adbba98e39d6d7949d1b3a1fd490ea7d57'
3
+ metadata.gz: 6032d4395fd3638e1c5fc4eb89917169aa541d3e570537dd6d736a84704a8824
4
+ data.tar.gz: 7f4abbc32007c3d5e5916da0cd9c2bc075f2a36c651714243e308eed7b31d731
5
5
  SHA512:
6
- metadata.gz: 4903fd300fe48b0abf9bb5a1981912fed4e867917d1eb155b8d22aeb8fbf591c212df038416640ce8f6268054e6b29722c9ce12e85884a1b01fd20ff932165f5
7
- data.tar.gz: d0aa4a24452b520d46ff25278df87c861bcf488ce7e5576eeee98bde3e16dbde8bb3a0455a68ae1480e08e547cefbbf00abf7e2a5fae1eaad91aa4e266ce8586
6
+ metadata.gz: c020c2ce0df10bcfc3c47da57598cf921daffed4a70f6d1b9edae82704b69c68b77b11dc2be7f31a0ad34a783c2fec8e85ca5497f3b945d13377563a6c03bbc0
7
+ data.tar.gz: 9df5ee378a200444d96b2dffb044eb65703b05c71c214d8e4c811346f779f0a11d3fb5debf938f5c1c6515c23bc77dec1d822ce0d88e817ce8bf4f637da23d97
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rxfreader.rb CHANGED
@@ -15,6 +15,48 @@ module RXFRead
15
15
 
16
16
  class FileX
17
17
 
18
+ def self.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 self.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
+
18
60
  def self.read(x)
19
61
  RXFReader.read(x).first
20
62
  end
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.1.2
4
+ version: 0.1.3
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-19 00:00:00.000000000 Z
38
+ date: 2022-02-21 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