rack-rscript 1.1.7 → 1.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdeae576d55f3e549ed4a46a656c181e3b5c244a6c9cd771ff0cf533b7f756ee
4
- data.tar.gz: 53a09962db6f0e4400d383e8ee8c1ccb8d7d70f916393437a35d9eeead75e084
3
+ metadata.gz: 2a89919a5c0bc41ed1f8e836aa0476baae386a1b5f4a1dd34fd69b2328584a5b
4
+ data.tar.gz: bbbbdfaff50bfa3ddc1635f5cdc7d823077105e36357ea4cf78cade5a9d20084
5
5
  SHA512:
6
- metadata.gz: a29f4763ddd17c544d189b9c53e61a3361fdb6d08a65691ea46dec1b616a9d9e8395d9f72ab5e75d4239d941b884740c7d6f5287b46e0cdda5e442796354bb27
7
- data.tar.gz: 23f13c255ead42a11644a8dd74a389920f84423b999e5f9d3a66e726ac56b71f8e4711fd08bdd8b024f7057a7e0b5b572556b5c03050ab3f9b5bf4945852265c
6
+ metadata.gz: de01da7bd5651a20115cce9f2309018f789bf9bf8754f94b080474bf2722ac7b30fdbf04c9e78e4be54addfa81356f9c3bd7e3b3137a538f3b12d9aeabc12258
7
+ data.tar.gz: 6d36a96685f10f3518171a0f5f1bc37e2fe42d2c622e0258877a61c8a1042890e7d92a6ca3f2ac5104f5c6a7c86693d1df729b757851f8db3ccb7ee3386c12b7
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -34,11 +34,12 @@ class RackRscript
34
34
  include RXFHelperModule
35
35
  using ColouredText
36
36
 
37
+
37
38
  def initialize(log: nil, pkg_src: '', cache: 5, rsc_host: nil,
38
39
  pxlinks: nil, debug: false, root: '', static: {})
39
40
 
40
41
  @log, @debug, @static = log, debug, static
41
-
42
+ #=begin
42
43
  puts '@app_root: ' + @app_root.inspect if @debug
43
44
  puts 'root: ' + root.inspect if @debug
44
45
 
@@ -47,6 +48,7 @@ class RackRscript
47
48
  @templates = {}
48
49
 
49
50
  @rscript = RScriptRW.new log: log, pkg_src: pkg_src, cache: cache, debug: true
51
+ @render = NThrut.new(self)
50
52
 
51
53
  @url_base = pkg_src # web server serving the RSF files
52
54
  @url_base += '/' unless @url_base[-1] == '/'
@@ -73,20 +75,23 @@ class RackRscript
73
75
 
74
76
  @rsc = nil
75
77
 
76
- @rsc = RSC.new rsc_host if rsc_host
78
+ @rsc = RSC.new rsc_host if rsc_host and rsc_host.length > 0
77
79
 
78
80
  @filetype = {xml: 'application/xml', html: 'text/html', png: 'image/png',
79
81
  jpg: 'image/jpeg', txt: 'text/plain', css: 'text/css',
80
82
  xsl: 'application/xml', svg: 'image/svg+xml'}
81
83
 
82
84
  @root, @static = root, static
83
-
85
+ @initialized = {}
86
+ #=end
84
87
  end
85
88
 
86
89
  def call(env)
87
-
90
+
91
+
88
92
  @env = env
89
- raw_request = env['REQUEST_URI'][/https?:\/\/[^\/]+(.*)/,1]
93
+ raw_request = env['REQUEST_URI'][/\/\/[^\/]+(.*)/,1]
94
+ #raw_request = env['REQUEST_PATH']
90
95
 
91
96
  @log.info 'RackRscript/call: ' + env.inspect if @log
92
97
  @req = Rack::Request.new(env)
@@ -101,7 +106,11 @@ class RackRscript
101
106
  raw_request
102
107
  end
103
108
 
109
+ @log.info 'RackRscript/call/request: ' + request.inspect if @log
110
+ #=begin
104
111
  run_request(request)
112
+ #=end
113
+ # [200, {"Content-Type" => "text/plain"}, [env.inspect]]
105
114
  end
106
115
 
107
116
  def clear_cache()
@@ -110,6 +119,9 @@ class RackRscript
110
119
 
111
120
  def run_job(url, jobs, params={}, type=:get, *qargs)
112
121
 
122
+ @log.debug 'RackRscript/run_job/params: ' + params.inspect if @log
123
+ @log.debug 'RackRscript/run_job/qargs: ' + qargs.inspect if @log
124
+
113
125
  if @params[:splat] then
114
126
  @params.each do |k,v|
115
127
  @params.delete k unless k == :splat or k == :package \
@@ -135,6 +147,13 @@ class RackRscript
135
147
  req = @req if @req
136
148
 
137
149
  begin
150
+
151
+ if @rscript.jobs(url).include? :initialize and
152
+ !@initialized[url] and jobs != 'initialize' then
153
+ @rscript.run([url, '//job:initialize'])
154
+ @initialized[url] = true
155
+ end
156
+
138
157
  r = eval result
139
158
  return r
140
159
 
@@ -159,20 +178,22 @@ class RackRscript
159
178
  Rexslt.new(xsl, xml).to_s
160
179
  end
161
180
 
162
- def haml(name,options={})
163
- render name, :haml, options
181
+ def haml(name,options={})
182
+ @render.haml name, options
164
183
  end
165
184
 
166
185
  def slim(name,options={})
167
- render name, :slim, options
186
+ @render.slim name, options
168
187
  end
169
188
 
170
189
  protected
171
190
 
172
191
  def default_routes(env, params)
173
192
 
174
-
193
+ @log.info 'RackRscript/default_routes: ' + params.inspect if @log
194
+
175
195
  get '/do/:package/:job' do |package,job|
196
+ @log.info 'RackRscript/route/do/package/job: ' + [package, job].inspect if @log
176
197
  run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params)
177
198
  end
178
199
 
@@ -289,6 +310,8 @@ class RackRscript
289
310
  #@log.debug 'inside run_request @env: ' + @env.inspect if @log
290
311
  method_type = @env ? @env['REQUEST_METHOD'] : 'GET'
291
312
  content, content_type, status_code = run_route(request, method_type)
313
+ @log.info 'RackRscript/run_request/content: ' + content.inspect if @log
314
+
292
315
  #@log.debug 'inside run_request' if @log
293
316
  if content.is_a? Redirect then
294
317
 
@@ -348,7 +371,7 @@ class RackRscript
348
371
 
349
372
  private
350
373
 
351
- def render(name, type, opt={})
374
+ def render99(name, type, opt={})
352
375
 
353
376
  options = {locals: {}}.merge!(opt)
354
377
  locals = options.delete :locals
@@ -368,11 +391,15 @@ class RackRscript
368
391
  end
369
392
 
370
393
  def template(name, type=nil, &blk)
394
+ @render.template name, type, &blk
395
+ end
396
+
397
+ def template99(name, type=nil, &blk)
371
398
  @templates.merge!({name => {content: blk.call, type: type}})
372
399
  @templates[name]
373
400
  end
374
401
 
375
- def tilt(name, options={})
402
+ def tilt99(name, options={})
376
403
 
377
404
  options = {locals: {}}.merge!(opt)
378
405
  locals = options.delete :locals
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-rscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,31 +11,31 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMjE2MTc1OTI3WhcN
15
- MjAwMjE2MTc1OTI3WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0YIta
17
- YodiB6EG0KVDDwfPCN3Hwh/FGtn/BbMQNfCyFBVhO5iMyrwdWeFL9zHnvypbiiT6
18
- Ex80D8s9j4iXHKj/RSKPQ0NDZ1Gms2CtrcRqUiA/Lze0mM6igwn9hgo7PZbU5SAO
19
- dRZf9g2Xdr5vZasnOO6zn2QyT/KtuU8TamgVzOtoELbNQ5+hwN+rt+gwLenh8vVH
20
- reB+hc1Ma8g89OwJCGYp0o9T6adq6tgdtJj5Cu6hJPBABtuzGAeleqsZ8GVkL/sj
21
- q7Lxjc9/Mp0l43msIGHJfOuzXVmQwq8KxWj4QCS6c+js2JSWswFho12dNKYb9rjX
22
- 14Dnx2qdMApKUGP7Y8XQk3dDUDHgGurAbq4EpkgpLuQw1eq2o5XkE0tIG5f0ATEi
23
- pSYyMLvFB/V1kNgPsYmVaOhVxT53cl7LrKVwuRBZShUg7PYt30PZ7lwMZx+LrdQ0
24
- ksyvqMcObi/caRVBHy200p1xQPfotdSbuRF3L3re1urMuHE7xLQ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6qcx5MZVkhjTlWVchzBAusC2pb37Ut8jXn+q92nqCw9
35
+ tilHf4Ok7vnZYPnxQk5PY3q28lYoflnB47YIc0pdkJHI1M3YXL/HxrcZCEIHAU3W
36
+ aTCBK3Pk2/LQtqaW3yaSg73t
37
37
  -----END CERTIFICATE-----
38
- date: 2019-03-26 00:00:00.000000000 Z
38
+ date: 2020-06-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rack
@@ -43,20 +43,20 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '2.0'
46
+ version: '2.2'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 2.0.6
49
+ version: 2.2.3
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '2.0'
56
+ version: '2.2'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 2.0.6
59
+ version: 2.2.3
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: app-routes
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -81,22 +81,22 @@ dependencies:
81
81
  name: rscript
82
82
  requirement: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: '0.7'
87
84
  - - ">="
88
85
  - !ruby/object:Gem::Version
89
- version: 0.7.2
86
+ version: 0.8.0
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.8'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.7'
97
94
  - - ">="
98
95
  - !ruby/object:Gem::Version
99
- version: 0.7.2
96
+ version: 0.8.0
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '0.8'
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: tilt
102
102
  requirement: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  version: '2.0'
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 2.0.9
109
+ version: 2.0.10
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -116,67 +116,47 @@ dependencies:
116
116
  version: '2.0'
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 2.0.9
119
+ version: 2.0.10
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: slim
122
122
  requirement: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - "~>"
125
- - !ruby/object:Gem::Version
126
- version: '4.0'
127
124
  - - ">="
128
125
  - !ruby/object:Gem::Version
129
- version: 4.0.1
130
- type: :runtime
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
126
+ version: 4.1.0
134
127
  - - "~>"
135
128
  - !ruby/object:Gem::Version
136
- version: '4.0'
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: 4.0.1
140
- - !ruby/object:Gem::Dependency
141
- name: json
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 2.2.0
147
- - - "~>"
148
- - !ruby/object:Gem::Version
149
- version: '2.2'
129
+ version: '4.1'
150
130
  type: :runtime
151
131
  prerelease: false
152
132
  version_requirements: !ruby/object:Gem::Requirement
153
133
  requirements:
154
134
  - - ">="
155
135
  - !ruby/object:Gem::Version
156
- version: 2.2.0
136
+ version: 4.1.0
157
137
  - - "~>"
158
138
  - !ruby/object:Gem::Version
159
- version: '2.2'
139
+ version: '4.1'
160
140
  - !ruby/object:Gem::Dependency
161
141
  name: rexslt
162
142
  requirement: !ruby/object:Gem::Requirement
163
143
  requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '0.6'
167
144
  - - ">="
168
145
  - !ruby/object:Gem::Version
169
- version: 0.6.13
146
+ version: 0.7.0
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '0.7'
170
150
  type: :runtime
171
151
  prerelease: false
172
152
  version_requirements: !ruby/object:Gem::Requirement
173
153
  requirements:
174
- - - "~>"
175
- - !ruby/object:Gem::Version
176
- version: '0.6'
177
154
  - - ">="
178
155
  - !ruby/object:Gem::Version
179
- version: 0.6.13
156
+ version: 0.7.0
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.7'
180
160
  - !ruby/object:Gem::Dependency
181
161
  name: rsc
182
162
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +166,7 @@ dependencies:
186
166
  version: '0.4'
187
167
  - - ">="
188
168
  - !ruby/object:Gem::Version
189
- version: 0.4.3
169
+ version: 0.4.4
190
170
  type: :runtime
191
171
  prerelease: false
192
172
  version_requirements: !ruby/object:Gem::Requirement
@@ -196,7 +176,7 @@ dependencies:
196
176
  version: '0.4'
197
177
  - - ">="
198
178
  - !ruby/object:Gem::Version
199
- version: 0.4.3
179
+ version: 0.4.4
200
180
  - !ruby/object:Gem::Dependency
201
181
  name: polyrex-links
202
182
  requirement: !ruby/object:Gem::Requirement
@@ -243,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
223
  - !ruby/object:Gem::Version
244
224
  version: '0'
245
225
  requirements: []
246
- rubygems_version: 3.0.1
226
+ rubygems_version: 3.0.3
247
227
  signing_key:
248
228
  specification_version: 4
249
229
  summary: Rack-Rscript is a light-weight alternative to Sinatra-Rscript.
metadata.gz.sig CHANGED
Binary file