rack-rscript 1.1.6 → 1.1.7

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: b513cf10fc9f799000b67f9bca747cd132f117a87e771efd9dffd4abccfd836e
4
- data.tar.gz: '089507f8dc242466e97ceeda2ebbd9b6f22e4729bc055a520152c4b41e963369'
3
+ metadata.gz: bdeae576d55f3e549ed4a46a656c181e3b5c244a6c9cd771ff0cf533b7f756ee
4
+ data.tar.gz: 53a09962db6f0e4400d383e8ee8c1ccb8d7d70f916393437a35d9eeead75e084
5
5
  SHA512:
6
- metadata.gz: c9baabf7e1d645efbbf0ea953e5a31abd5452a3b8a2275d2e03c3da27ccd0d8a2269be22819fe0bd3b60c50e9e24d13adc6c5ddb872bda3b776c398e66a3be95
7
- data.tar.gz: 6833909c6c7d7bc3e30f08ab0b4b0b4514f33fdfa9344b6e6b11043435729978927c5434b5b59f55745a901374cd42ce77d03be1f5cfca7d40ec153edd007557
6
+ metadata.gz: a29f4763ddd17c544d189b9c53e61a3361fdb6d08a65691ea46dec1b616a9d9e8395d9f72ab5e75d4239d941b884740c7d6f5287b46e0cdda5e442796354bb27
7
+ data.tar.gz: 23f13c255ead42a11644a8dd74a389920f84423b999e5f9d3a66e726ac56b71f8e4711fd08bdd8b024f7057a7e0b5b572556b5c03050ab3f9b5bf4945852265c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -26,14 +26,16 @@ end
26
26
  class RackRscriptError < Exception
27
27
  end
28
28
 
29
+
30
+
31
+
29
32
  class RackRscript
30
33
  include AppRoutes
31
34
  include RXFHelperModule
32
35
  using ColouredText
33
36
 
34
- def initialize(log: nil, pkg_src: '', cache: 5, rsc_host: 'rse',
35
- rsc_package_src: nil, pxlinks: nil, debug: false,
36
- root: '', static: {})
37
+ def initialize(log: nil, pkg_src: '', cache: 5, rsc_host: nil,
38
+ pxlinks: nil, debug: false, root: '', static: {})
37
39
 
38
40
  @log, @debug, @static = log, debug, static
39
41
 
@@ -44,7 +46,7 @@ class RackRscript
44
46
 
45
47
  @templates = {}
46
48
 
47
- @rrscript = RScript.new log: log, pkg_src: pkg_src, cache: cache
49
+ @rscript = RScriptRW.new log: log, pkg_src: pkg_src, cache: cache, debug: true
48
50
 
49
51
  @url_base = pkg_src # web server serving the RSF files
50
52
  @url_base += '/' unless @url_base[-1] == '/'
@@ -70,7 +72,8 @@ class RackRscript
70
72
  default_routes(@env, @params)
71
73
 
72
74
  @rsc = nil
73
- @rsc = RSC.new rsc_host, rsc_package_src if rsc_package_src
75
+
76
+ @rsc = RSC.new rsc_host if rsc_host
74
77
 
75
78
  @filetype = {xml: 'application/xml', html: 'text/html', png: 'image/png',
76
79
  jpg: 'image/jpeg', txt: 'text/plain', css: 'text/css',
@@ -102,10 +105,10 @@ class RackRscript
102
105
  end
103
106
 
104
107
  def clear_cache()
105
- @rrscript.reset
108
+ @rscript.reset
106
109
  end
107
110
 
108
- def run_job(url, jobs, params={}, *qargs)
111
+ def run_job(url, jobs, params={}, type=:get, *qargs)
109
112
 
110
113
  if @params[:splat] then
111
114
  @params.each do |k,v|
@@ -123,7 +126,8 @@ class RackRscript
123
126
  end
124
127
 
125
128
  @params.merge! @req.params
126
- result, args = @rrscript.read([url, jobs.split(/\s/), \
129
+ @rscript.type = type
130
+ result, args = @rscript.read([url, jobs.split(/\s/), \
127
131
  qargs].flatten)
128
132
 
129
133
  rws = self
@@ -178,24 +182,24 @@ class RackRscript
178
182
  end
179
183
 
180
184
  post '/do/:package/:job' do |package,job|
181
- run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params)
185
+ run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params, :post)
182
186
  end
183
187
 
184
188
  get '/do/:package/:job/*' do |package, job|
185
189
  raw_args = params[:splat]
186
190
  args = raw_args.first[/[^\s\?]+/].to_s.split('/')[1..-1]
187
- run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params, args)
191
+ run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params, :get, args)
188
192
  end
189
193
 
190
194
  post '/do/:package/:job/*' do |package, job|
191
195
  raw_args = params[:splat]
192
196
  args = raw_args.first[/[^\s\?]+/].to_s.split('/')[1..-1]
193
- run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params, args)
197
+ run_job("%s%s.rsf" % [@url_base, package], "//job:" + job, params, :post, args)
194
198
  end
195
199
 
196
200
  get '/source/:package/:job' do |package,job|
197
201
  url = "%s%s.rsf" % [@url_base, package]
198
- [@rrscript.read([url, '//job:' + job]).first, 'text/plain']
202
+ [@rscript.read([url, '//job:' + job]).first, 'text/plain']
199
203
  end
200
204
 
201
205
  get '/source/:package' do |package,job|
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.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  lDqRilVLi+NZf/R9vR/vaL53GOmDC+VoywL5frfWXVSK1Zs1fF7RAMZDJeYF0A8W
36
36
  arbgkVprfDCrZHsF1ZnCIvNO
37
37
  -----END CERTIFICATE-----
38
- date: 2019-02-24 00:00:00.000000000 Z
38
+ date: 2019-03-26 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rack
@@ -83,20 +83,20 @@ dependencies:
83
83
  requirements:
84
84
  - - "~>"
85
85
  - !ruby/object:Gem::Version
86
- version: '0.6'
86
+ version: '0.7'
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.6.2
89
+ version: 0.7.2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.6'
96
+ version: '0.7'
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: 0.6.2
99
+ version: 0.7.2
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: tilt
102
102
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ dependencies:
186
186
  version: '0.4'
187
187
  - - ">="
188
188
  - !ruby/object:Gem::Version
189
- version: 0.4.1
189
+ version: 0.4.3
190
190
  type: :runtime
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
@@ -196,7 +196,7 @@ dependencies:
196
196
  version: '0.4'
197
197
  - - ">="
198
198
  - !ruby/object:Gem::Version
199
- version: 0.4.1
199
+ version: 0.4.3
200
200
  - !ruby/object:Gem::Dependency
201
201
  name: polyrex-links
202
202
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file