gogreen 0.3.2 → 0.4.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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/gogreen.rb +37 -37
  4. data.tar.gz.sig +0 -0
  5. metadata +42 -42
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f232737975faf42fa6f9b0db782c011e49e0e8bd2c2adcdc9abc60be508c68a9
4
- data.tar.gz: c19e8f718c02cff2857f9f6746e1a8ec106fd56758cd305118718b27639fb628
3
+ metadata.gz: 5230bbcc1ee3b526f051b90b123817c4c54ceb0532e385eea0b70991090b87fd
4
+ data.tar.gz: df4636b8e98891ef553c111f1217018bcbe665dbb7147501c06d393b2a35ba3c
5
5
  SHA512:
6
- metadata.gz: ab2c250576aa2b6d531a75bbee62548be1b2b8b0d041196850e382233fdfbc98df8550270c363e5fa8363047eb8db822648c2e08d88d8bd724cbae86354a4969
7
- data.tar.gz: 633ce2388e8e6d60bc5db591be3ce436097613cbd3a5c62ce91c2f0178b0edfdb3e2b816778a068bca4409a99d530692372e971a51de7a6b077dd693c0242cb7
6
+ metadata.gz: c793d2e2c1cab00e7aac774abf4d56415340c74192d4ced98512333752219acbf08f49f7965850e53e9f6ef83ac45fb316b7acc36851d17230ad418bd0bd0ee6
7
+ data.tar.gz: 95024af2bf44713b79f9c6c019ce41f3ae440095484d2868a6143286a1f02bd9fd86ce2d34db320f09dd0a5565e00cc16a865c36e55fb7a265469570109aed70
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/gogreen.rb CHANGED
@@ -11,16 +11,16 @@ require 'tempfile'
11
11
 
12
12
 
13
13
  class Gg
14
-
15
- def self.call(argsx)
16
- puts GoGreen.new(argsx.first).execute(argsx[1], argsx[2..-1]).to_s
17
- end
18
-
19
- def self.run(argsx, keepalive: false)
14
+
15
+ def self.call(argsx)
16
+ puts GoGreen.new(argsx.first).execute(argsx[1], argsx[2..-1]).to_s
17
+ end
18
+
19
+ def self.run(argsx, keepalive: false)
20
20
  puts GoGreen.new(argsx.first, keepalive: keepalive)\
21
- .execute(argsx[1], argsx[2..-1]).to_s
22
- end
23
-
21
+ .execute(argsx[1], argsx[2..-1]).to_s
22
+ end
23
+
24
24
  end
25
25
 
26
26
  class GoGreenException < Exception
@@ -28,19 +28,19 @@ end
28
28
 
29
29
  class GoGreen
30
30
 
31
- def initialize(alias_file, site=nil, subdomain=nil, shell_execute: true,
31
+ def initialize(alias_file, site=nil, subdomain=nil, shell_execute: true,
32
32
  rsc: nil, keepalive: false)
33
33
  super()
34
34
 
35
35
  @shell_execute, @rsc, @alias_file = shell_execute, rsc, alias_file
36
36
  @keepalive = keepalive
37
37
 
38
- buffer = RXFHelper.read(alias_file, auto: false).first
39
-
38
+ buffer = RXFReader.read(alias_file).first
39
+
40
40
  name = case buffer
41
41
  when /^<\?dynarex/
42
42
  @records = dxread(buffer)
43
- when /^<\?polyrex/
43
+ when /^<\?polyrex/
44
44
  @records, @conf = pxread(buffer, site, subdomain)
45
45
  else
46
46
  raise GoGreenException, 'alias file ' + alias_file + ' not recognised'
@@ -53,22 +53,22 @@ class GoGreen
53
53
 
54
54
  alias_found = @records[alias_name]
55
55
  return 'job not found' unless alias_found
56
-
56
+
57
57
  cmd = alias_found[:body][:command]
58
58
  cmd += ' ' + @conf if @conf
59
-
59
+
60
60
  if cmd[/^rcscript/] then
61
61
 
62
- a = cmd.sub(/^rcscript /,'').split + job_args.map do |x|
63
- x.sub(/^["'](.*)["']$/,'\1')
62
+ a = cmd.sub(/^rcscript /,'').split + job_args.map do |x|
63
+ x.sub(/^["'](.*)["']$/,'\1')
64
64
  end
65
65
 
66
66
  raw_code, args = RScript.new.read a
67
-
67
+
68
68
  begin
69
69
 
70
70
  if @shell_execute then
71
-
71
+
72
72
  a = raw_code.strip.lines
73
73
  a.unshift 'args = ' + args.inspect + "\n\n"
74
74
  lastline = a.pop
@@ -77,8 +77,8 @@ class GoGreen
77
77
  var = '$alias_file = ' + @alias_file.inspect
78
78
  code2 = "$0 = 'gogreen'\n" + var +"\n" + a.join.gsub('\"','"')\
79
79
  .gsub('\#','#')
80
-
81
- file = Tempfile.new('gogreen')
80
+
81
+ file = Tempfile.new('gogreen')
82
82
  code3 = @keepalive ? apply_handler(code2) : code2
83
83
  file.write(code3)
84
84
  file.close
@@ -87,34 +87,34 @@ class GoGreen
87
87
  r.strip
88
88
  #pipe = IO.popen("ruby", "w")
89
89
  #pipe.write code2
90
- #pipe.close
91
-
90
+ #pipe.close
91
+
92
92
  else
93
93
 
94
94
  code3 = @keepalive ? apply_handler(raw_code) : raw_code
95
95
  result = eval(code3)
96
96
 
97
97
  end
98
-
98
+
99
99
  rescue
100
100
  ($!).to_s[/^[^\n]+/].to_s
101
- end
102
-
101
+ end
102
+
103
103
  elsif cmd[/^rsc/] and @rsc
104
-
104
+
105
105
  package, job, args = cmd.sub(/^rsc/,'').split + job_args
106
106
  @rsc.send(package.to_sym).send(job.to_sym, *args)
107
-
108
- else
107
+
108
+ else
109
109
  `#{cmd} #{job_args.join(' ')}`
110
- end
111
-
110
+ end
111
+
112
112
  end
113
113
 
114
114
  private
115
-
115
+
116
116
  def apply_handler(s)
117
-
117
+
118
118
  "begin
119
119
  #{s}
120
120
  rescue
@@ -131,7 +131,7 @@ class GoGreen
131
131
 
132
132
  dx2 = Dynarex.new.parse dx.summary[:include]
133
133
  dx2.records.merge(dx.records)
134
- else
134
+ else
135
135
  dx.records
136
136
  end
137
137
 
@@ -140,7 +140,7 @@ class GoGreen
140
140
 
141
141
  def pxread(buffer, site, subdomain)
142
142
 
143
- px = Polyrex.new
143
+ px = Polyrex.new
144
144
 
145
145
  px.parse buffer
146
146
 
@@ -154,7 +154,7 @@ class GoGreen
154
154
 
155
155
  r
156
156
  end
157
-
157
+
158
158
  end
159
159
 
160
160
  if $0 == __FILE__ then
@@ -162,6 +162,6 @@ if $0 == __FILE__ then
162
162
  alias_file, alias_name, *job_args = ARV
163
163
 
164
164
  gg = GoGreen.new alias_file
165
- gg.execute alias_name, job_args
165
+ gg.execute alias_name, job_args
166
166
 
167
167
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gogreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,72 +11,72 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjAwODMwMTQ1ODU5WhcN
15
- MjEwODMwMTQ1ODU5WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDDig8N
17
- pOlwCcsYTMv/7IyzV8miLBbqQyRuKW41JSvG+jVUlu9mszUbAQEo56koNugF4ahY
18
- ZKz9wQ5y1qrfRnFFGLcOylIiwsrRIRGnTcBp914cfz2BMkfNT3GCGjRVQosTVFZh
19
- puhM3yg/CYrtCq14dklkEhtCkEbyxKZEB6wPX2xbrkvc9CxWOUYijSKMyeT4WJQh
20
- A3j+0jmLnGn5LIIpooluDoSTkhXcUdIeVRg8tohsgMLLgAwpGaSGCyxwBLFgwPXv
21
- jN29aMtiOXRkhB3LZ7D2KKyN9/tRvrccFDOJmPXAxFCyqvUiU/VPX1hHxCUeMbB+
22
- 4knuHzUJFdcgho6XvhvS4Q7O0J85Zsh01EtoTgFScBbjQLxaIHOXhgjIPxfnVtW4
23
- ET95eo5uej3YKg2WCsjGGSF+nQ0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2RWltvpdYc9gvPq65+YDFdvMg33msgeLY1DjVlACvIEh84xTTO9JcV9D2i6f+
34
+ oKuMLy+D9X6GZK1zbZL1iMkgICaonHX+xku3t/HhWHPgq+PPeQRfPr/l7c+3VkwU
35
+ iPi5mvMSYhjRyrqmi4kccwQog3eCjY5QNxO+ACal7fg271yIbBczwhYusmxVIQk+
36
+ s71DHlLeQafzSqs3B7oOCtAW
37
37
  -----END CERTIFICATE-----
38
- date: 2020-08-30 00:00:00.000000000 Z
38
+ date: 2022-02-22 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rscript
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.8.0
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '0.8'
46
+ version: '0.9'
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.9.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 0.8.0
57
54
  - - "~>"
58
55
  - !ruby/object:Gem::Version
59
- version: '0.8'
56
+ version: '0.9'
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.9.0
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: dynarex
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '1.8'
66
+ version: '1.9'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.8.27
69
+ version: 1.9.5
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '1.8'
76
+ version: '1.9'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 1.8.27
79
+ version: 1.9.5
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: acronym
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -103,20 +103,20 @@ dependencies:
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '1.3'
106
+ version: '1.4'
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 1.3.1
109
+ version: 1.4.0
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '1.3'
116
+ version: '1.4'
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 1.3.1
119
+ version: 1.4.0
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: optparse-simple
122
122
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  - !ruby/object:Gem::Version
139
139
  version: 0.4.5
140
140
  description:
141
- email: james@jamesrobertson.eu
141
+ email: digital.robertson@gmail.com
142
142
  executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.0.3
166
+ rubygems_version: 3.2.22
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Run RSF jobs from the command line using a Dynarex flavoured aliases file.
metadata.gz.sig CHANGED
Binary file