rxfhelper 1.4.0 → 1.5.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: ebb8a8524b0128715988cb60a6cbf51349bc00accaed990a9bd6b9b149762d27
4
- data.tar.gz: 90b21fc2c3b3f13fed66d03a0092e5142502bf474fce7aea4a6b7d35275fa440
3
+ metadata.gz: 74dc7c23637dbf7b6f6a2ee5c237020d95e1c48f29de1fd8a17affe8afcb6b99
4
+ data.tar.gz: 191f21a4497789777a0de9bac9d5c18159437690d50ff9ace21022c437d54f3c
5
5
  SHA512:
6
- metadata.gz: c83ff90aea8d4c98f27e8c7f4c8f33a9492d0421d1c932f858a6b39b1016c886b47cc60570e253ede91c4a9b7632e2c14b637e2072a02bb3e40803662e29e761
7
- data.tar.gz: 347421d92512c46f4313489b36fd76e30befcefbdf541759592f5f65d4e4840f3da627baec4640eefcd7eeba361fe303df73a6dd6d9859b1886164dbf0a2364e
6
+ metadata.gz: 55c5d3f111b30502f4c2f9a805897912f6c10c6cae8180d61f59872c662fd5043031d377ae7963a07688f2ff54175045f0007de159ca2962795ab6906e992067
7
+ data.tar.gz: 4719bb2bce0e5d3c3b22340ba2ce7f177f34be561d144649d01140648bb76f7146bb0a39012290d7b73dab4b97dd58e51833a0bfbb645391fc7d6c5d651780d0
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rxfhelper.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # file: rxfhelper.rb
4
4
 
5
5
  require 'rsc'
6
+ require 'sps-pub'
6
7
  require 'drb_reg_client'
7
8
  require 'remote_dwsregistry'
8
9
  require 'rxfileio'
@@ -15,10 +16,56 @@ require 'rxfileio'
15
16
  module RXFHelperModule
16
17
  include RXFileIOModule
17
18
 
19
+ def FileX.exists?(s) RXFHelper.exists?(s) end
20
+ def FileX.filetype(x) RXFHelper.filetype(s) end
18
21
 
19
- def FileX.exists?(filename)
22
+ end
23
+
24
+ =begin
25
+ # 20th February 2022 # JR
26
+ # the following code has been commented out because it appears to be redundant
27
+ class URL
28
+
29
+ def self.join(*a)
30
+ a.map {|x| x.sub(/(?:^\/|\/$)/,'') }.join '/'
31
+ end
32
+ end
33
+ =end
34
+
35
+ class RXFHelperException < Exception
36
+ end
37
+
38
+ # Read XML File Helper
39
+ #
40
+ class RXFHelper < RXFileIO
41
+ using ColouredText
20
42
 
21
- type = FileX.filetype(filename)
43
+
44
+ def self.call(s, val=nil)
45
+
46
+ if val then
47
+
48
+ name = s =~ /^sps:/ ? :pub : :set
49
+ self.method(name).call(s, val)
50
+
51
+ elsif s =~ /=/
52
+
53
+ uri, val = s.split(/=/)
54
+ self.set uri, val
55
+
56
+ els
57
+
58
+ else
59
+
60
+ self.get s
61
+
62
+ end
63
+
64
+ end
65
+
66
+ def self.exists?(filename)
67
+
68
+ type = self.filetype(filename)
22
69
 
23
70
  filex = case type
24
71
  when :file
@@ -38,8 +85,7 @@ module RXFHelperModule
38
85
 
39
86
  end
40
87
 
41
-
42
- def FileX.filetype(x)
88
+ def self.filetype(x)
43
89
 
44
90
  return :string if x.lines.length > 1
45
91
 
@@ -65,43 +111,6 @@ module RXFHelperModule
65
111
  end
66
112
  end
67
113
 
68
- end
69
-
70
- =begin
71
- # 20th February 2022 # JR
72
- # the following code has been commented out because it appears to be redundant
73
- class URL
74
-
75
- def self.join(*a)
76
- a.map {|x| x.sub(/(?:^\/|\/$)/,'') }.join '/'
77
- end
78
- end
79
- =end
80
-
81
- class RXFHelperException < Exception
82
- end
83
-
84
- # Read XML File Helper
85
- #
86
- class RXFHelper < RXFileIO
87
- using ColouredText
88
-
89
-
90
- def self.call(s)
91
-
92
- if s =~ /=/ then
93
-
94
- uri, val = s.split(/=/)
95
- self.set uri, val
96
-
97
- else
98
-
99
- self.get s
100
-
101
- end
102
-
103
- end
104
-
105
114
 
106
115
  def self.get(x)
107
116
 
@@ -139,6 +148,13 @@ class RXFHelper < RXFileIO
139
148
  obj
140
149
  end
141
150
 
151
+ def self.pub(s, value)
152
+
153
+ r = s.match(/(?<=sps:\/\/)(?<host>[^\/:]+):?(?<port>\d+)?\/(?<topic>.*)/)
154
+ SPSPub.notice "%s: %s" % [r[:topic], value], host: r[:host],
155
+ port: r[:port] || '59000'
156
+
157
+ end
142
158
 
143
159
  def self.read(x, h={})
144
160
 
data.tar.gz.sig CHANGED
Binary file
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: 1.4.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  MrrH8cS6bqJRPQqEL1FsPmXfQpp86RvPSr0WqNSRnYEUCmqL0l2pYrXdPAyBLcji
36
36
  X1jPyhH0sl/QdPdaUnsigze+
37
37
  -----END CERTIFICATE-----
38
- date: 2022-02-22 00:00:00.000000000 Z
38
+ date: 2022-03-06 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rsc
@@ -106,7 +106,7 @@ dependencies:
106
106
  version: '0.2'
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 0.2.0
109
+ version: 0.2.2
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -116,7 +116,27 @@ dependencies:
116
116
  version: '0.2'
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 0.2.0
119
+ version: 0.2.2
120
+ - !ruby/object:Gem::Dependency
121
+ name: sps-pub
122
+ requirement: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - "~>"
125
+ - !ruby/object:Gem::Version
126
+ version: '0.5'
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: 0.5.5
130
+ type: :runtime
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '0.5'
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: 0.5.5
120
140
  description:
121
141
  email: digital.robertson@gmail.com
122
142
  executables: []
metadata.gz.sig CHANGED
Binary file