rxfhelper 0.4.3 → 0.5.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rxfhelper.rb +30 -0
- metadata +23 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b9ea74eba565e4fdb40137c15d852b213d14afc
|
4
|
+
data.tar.gz: 95dadb87e008726f89f7c6dd45b9a390ef6df404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71c267a3cfc62f077a124b47b5d62f13be47fbd4f4dce23aaac31ea7aef3f5a0f9b2ef4a9b683d87230378478fabc63c9ccfdd79490e39eb78473b3477f7c4d1
|
7
|
+
data.tar.gz: 140de327a5bbdf6555ec69b14c9a7503254f278705defdc49b64b9ed003c1f35211bc38de4d3046f14e4ef481bea78ada0b01e08111c3193ac602a63455135f5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rxfhelper.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
# file: rxfhelper.rb
|
4
4
|
|
5
5
|
require 'gpd-request'
|
6
|
+
require 'drb_fileclient'
|
6
7
|
|
7
8
|
class URL
|
8
9
|
|
@@ -45,7 +46,18 @@ class RXFHelper
|
|
45
46
|
end
|
46
47
|
|
47
48
|
[r.body, :url]
|
49
|
+
|
50
|
+
elsif x[/^dfs:\/\//] then
|
51
|
+
|
52
|
+
host = x[/(?<=^dfs:\/\/)[^\/:]+/]
|
53
|
+
port = x[/(?<=^dfs:\/\/)[^:]+:(\d+)/,1] || '61010'
|
54
|
+
filename = x[/(?<=^dfs:\/\/)[^\/]+\/(.*)/,1]
|
48
55
|
|
56
|
+
# read the file using the drb_fileclient
|
57
|
+
file = DRbFileClient.new host: host, port: port
|
58
|
+
|
59
|
+
[file.read(filename), :dfs]
|
60
|
+
|
49
61
|
elsif x[/^file:\/\//] or File.exists?(x) then
|
50
62
|
[File.read(File.expand_path(x.sub(%r{^file://}, ''))), :file]
|
51
63
|
elsif x =~ /\s/
|
@@ -59,6 +71,24 @@ class RXFHelper
|
|
59
71
|
[x, :unknown]
|
60
72
|
end
|
61
73
|
end
|
74
|
+
|
75
|
+
def self.write(uri, s)
|
76
|
+
|
77
|
+
case uri
|
78
|
+
when /^dfs:\/\//
|
79
|
+
|
80
|
+
host = uri[/(?<=^dfs:\/\/)[^\/:]+/]
|
81
|
+
port = uri[/(?<=^dfs:\/\/)[^:]+:(\d+)/,1] || '61010'
|
82
|
+
filename = uri[/(?<=^dfs:\/\/)[^\/]+\/(.*)/,1]
|
83
|
+
|
84
|
+
# write the file using the drb_fileclient
|
85
|
+
file = DRbFileClient.new host: host, port: port
|
86
|
+
file.write filename, s
|
87
|
+
|
88
|
+
else
|
89
|
+
File.write(uri, s)
|
90
|
+
end
|
91
|
+
end
|
62
92
|
|
63
93
|
def self.absolute_url(page_url, item_location)
|
64
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxfhelper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
8rLqizynNftXvmwVftEH2yQKlc6bsltIk+l2sNVht38tWANd/Zs0H6abD5zkVp2e
|
32
32
|
h6ZEatzAI88gwQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2018-01-24 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: gpd-request
|
@@ -53,6 +53,26 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 0.3.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: drb_fileclient
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.1'
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.1.0
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.1'
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.0
|
56
76
|
description:
|
57
77
|
email: james@jamesrobertson.eu
|
58
78
|
executables: []
|
@@ -84,5 +104,5 @@ rubygems_version: 2.6.13
|
|
84
104
|
signing_key:
|
85
105
|
specification_version: 4
|
86
106
|
summary: Helpful library for primarily reading the contents of a file either from
|
87
|
-
an HTTP address or
|
107
|
+
an HTTP address, local file, or DRb file system.
|
88
108
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|