rxfhelper 0.5.1 → 0.6.0

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
  SHA1:
3
- metadata.gz: e624b70b870ec8bf32d48e91e759d89b987273ef
4
- data.tar.gz: e74b5f153d2d5033e040d6b7d6b872f6528127ac
3
+ metadata.gz: db9a8b48c9fa31e12c4fbf434069e7fa7a5b68f9
4
+ data.tar.gz: 4ef3be0100a8eeed7d0b9a42e29613e6c2d9696f
5
5
  SHA512:
6
- metadata.gz: b6a4cb780b6834c0acb1e187ec4643214886b553b62b9218467d63d61ab58efc54ed79ce5dac036c32b6779e60076bd5d1bb8513c6424f703c443aa6aa06f47e
7
- data.tar.gz: 3e5d13f8b4a613131aae22c088435082a1ebc0c250a382e5358c1097e722cba10cc810573de4709d22d2e1e6ac8aa35a3e4eaaf65cd39eb067810ca08645128b
6
+ metadata.gz: e7c969fddd1a184e0402122c42b98c32dac34762246a955ee4363472bdd6bcd5e94cd7587a3fdfa13453559e46fb2b6e3fc276bc1442add2c48db6e870c716a1
7
+ data.tar.gz: db99907a5992c4c47701fc4f0807f40009dc9d85949a8a469522b688548cb1e4c0feaa2da2d4a3f6f343e463acbd2b61df2c07bfd0fb1cbf9330d379b651627f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,6 +2,7 @@
2
2
 
3
3
  # file: rxfhelper.rb
4
4
 
5
+ require 'rsc'
5
6
  require 'gpd-request'
6
7
  require 'drb_fileclient'
7
8
 
@@ -19,6 +20,18 @@ end
19
20
  # Read XML File Helper
20
21
  #
21
22
  class RXFHelper
23
+
24
+ def self.get(x)
25
+
26
+ raise RXFHelperException, 'nil found, expected a string' if x.nil?
27
+
28
+ if x[/^rse:\/\//] then
29
+ RSC.new.get x
30
+ else
31
+ [x, :unknown]
32
+ end
33
+
34
+ end
22
35
 
23
36
  def self.read(x, opt={})
24
37
 
@@ -58,6 +71,8 @@ class RXFHelper
58
71
 
59
72
  [file.read(filename), :dfs]
60
73
 
74
+ elsif x[/^rse:\/\//] then
75
+ [RSC.new.get(x), :rse]
61
76
  elsif x[/^file:\/\//] or File.exists?(x) then
62
77
  [File.read(File.expand_path(x.sub(%r{^file://}, ''))), :file]
63
78
  elsif x =~ /\s/
@@ -72,7 +87,7 @@ class RXFHelper
72
87
  end
73
88
  end
74
89
 
75
- def self.write(uri, s)
90
+ def self.write(uri, s=nil)
76
91
 
77
92
  case uri
78
93
  when /^dfs:\/\//
@@ -84,7 +99,9 @@ class RXFHelper
84
99
  # write the file using the drb_fileclient
85
100
  file = DRbFileClient.new host: host, port: port
86
101
  file.write filename, s
87
-
102
+
103
+ when /^rse:\/\//
104
+ RSC.new.post(uri)
88
105
  else
89
106
  File.write(uri, s)
90
107
  end
@@ -121,4 +138,16 @@ class RXFHelper
121
138
  File.join page_url[/.*\//], item_location
122
139
  end
123
140
  end
141
+
142
+ def self.post(x)
143
+
144
+ raise RXFHelperException, 'nil found, expected a string' if x.nil?
145
+
146
+ if x[/^rse:\/\//] then
147
+ RSC.new.post x
148
+ else
149
+ [x, :unknown]
150
+ end
151
+
152
+ end
124
153
  end
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.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,8 +31,28 @@ cert_chain:
31
31
  8rLqizynNftXvmwVftEH2yQKlc6bsltIk+l2sNVht38tWANd/Zs0H6abD5zkVp2e
32
32
  h6ZEatzAI88gwQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2018-03-17 00:00:00.000000000 Z
34
+ date: 2018-03-22 00:00:00.000000000 Z
35
35
  dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: rsc
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.3'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.3.1
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.3'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.3.1
36
56
  - !ruby/object:Gem::Dependency
37
57
  name: gpd-request
38
58
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file