rack-rscript 1.0.1 → 1.0.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rack-rscript.rb +14 -20
- metadata +24 -24
- metadata.gz.sig +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884384c1924caca692fde02aa10fc52ece9e7eb9
|
4
|
+
data.tar.gz: a3c2bfd008be079505d95acdf8c78ceb2f104eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94d6f1d44bb76a2a480c23ad5502f3337448a3a4d509b20aad96c62299fc2153756abf232c671d321161d3f2257934d04bf1e3539beb70ea12fa8377b250397
|
7
|
+
data.tar.gz: 504fdd7e27551d36a34446a28aef3fa0a56776221515f744131c3cd0eb57f53d5d1f33ddbd5b2e3f42f2a91edc7609912adc9c117a6e304e274126db4f73ef30
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rack-rscript.rb
CHANGED
@@ -8,7 +8,6 @@ require 'haml'
|
|
8
8
|
require 'slim'
|
9
9
|
require 'tilt'
|
10
10
|
require 'json'
|
11
|
-
require 'logger'
|
12
11
|
require 'rexslt'
|
13
12
|
require 'rscript'
|
14
13
|
require 'app-routes'
|
@@ -29,24 +28,20 @@ class RackRscript
|
|
29
28
|
include AppRoutes
|
30
29
|
|
31
30
|
|
32
|
-
def initialize(
|
31
|
+
def initialize(log: nil, pkg_src: '', cache: 5,
|
33
32
|
rsc_host: 'rse', rsc_package_src: nil)
|
34
33
|
|
35
34
|
@params = {}
|
36
35
|
@templates = {}
|
37
36
|
|
38
|
-
@rrscript = RScript.new
|
39
|
-
pkg_src: pkg_src, cache: cache
|
37
|
+
@rrscript = RScript.new log: log, pkg_src: pkg_src, cache: cache
|
40
38
|
|
41
39
|
@url_base = pkg_src # web server serving the RSF files
|
42
40
|
@url_base += '/' unless @url_base[-1] == '/'
|
43
41
|
|
44
|
-
@log =
|
42
|
+
@log = log
|
43
|
+
|
45
44
|
|
46
|
-
if logfile.length > 0 then
|
47
|
-
@log = true
|
48
|
-
@logger = Logger.new(logfile, logrotate)
|
49
|
-
end
|
50
45
|
|
51
46
|
super() # required for app-routes initialize method to exectue
|
52
47
|
default_routes(@env, @params)
|
@@ -61,8 +56,7 @@ class RackRscript
|
|
61
56
|
@env = env
|
62
57
|
request = env['REQUEST_URI'][/https?:\/\/[^\/]+(.*)/,1]
|
63
58
|
|
64
|
-
log
|
65
|
-
log Time.now.to_s + "_: " + env.inspect
|
59
|
+
@log.info 'RackRscript/call: ' + env.inspect if @log
|
66
60
|
req = Rack::Request.new(env)
|
67
61
|
|
68
62
|
@req_params = req.params
|
@@ -82,7 +76,7 @@ class RackRscript
|
|
82
76
|
|
83
77
|
if e then
|
84
78
|
content, status_code = e, 500
|
85
|
-
log
|
79
|
+
@log.debug 'RackRscript/call/error: ' + e if @log
|
86
80
|
elsif content.nil? then
|
87
81
|
content, status_code = "404: page not found", 404
|
88
82
|
end
|
@@ -105,10 +99,13 @@ class RackRscript
|
|
105
99
|
'text/plain' => passthru_proc,
|
106
100
|
'text/xml' => passthru_proc,
|
107
101
|
'text/css' => passthru_proc,
|
102
|
+
'text/markdown' => passthru_proc,
|
108
103
|
'application/xml' => passthru_proc,
|
104
|
+
'application/xhtml' => passthru_proc,
|
109
105
|
'application/json' => passthru_proc,
|
110
106
|
'image/png' => passthru_proc,
|
111
|
-
'image/jpeg' => passthru_proc
|
107
|
+
'image/jpeg' => passthru_proc,
|
108
|
+
'image/svg+xml' => passthru_proc
|
112
109
|
}
|
113
110
|
|
114
111
|
content_type ||= 'text/html'
|
@@ -153,19 +150,16 @@ class RackRscript
|
|
153
150
|
return r
|
154
151
|
|
155
152
|
rescue Exception => e
|
153
|
+
|
156
154
|
@params = {}
|
157
155
|
err_label = e.message.to_s + " :: \n" + e.backtrace.join("\n")
|
158
156
|
raise RackRscriptError, err_label
|
159
|
-
|
157
|
+
|
158
|
+
@log.debug 'RackRscript/run_job/error: ' + err_label if @log
|
160
159
|
end
|
161
160
|
|
162
161
|
end
|
163
|
-
|
164
|
-
def log(msg)
|
165
|
-
if @log == true then
|
166
|
-
@logger.debug msg
|
167
|
-
end
|
168
|
-
end
|
162
|
+
|
169
163
|
|
170
164
|
def redirect(url)
|
171
165
|
Redirect.new url
|
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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE3MTExMzE3MjAyMloXDTE4MTExMzE3MjAyMlowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBAJ0lu7yKoB8JHYhpkCTGjdbs42TKOS0ShXkMSydVj+CoY9pdn9V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TIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rack
|
@@ -79,20 +79,20 @@ dependencies:
|
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.4'
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.4.0
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '0.
|
92
|
+
version: '0.4'
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.4.0
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: tilt
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,7 @@ dependencies:
|
|
162
162
|
version: '0.6'
|
163
163
|
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: 0.6.
|
165
|
+
version: 0.6.9
|
166
166
|
type: :runtime
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -172,7 +172,7 @@ dependencies:
|
|
172
172
|
version: '0.6'
|
173
173
|
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: 0.6.
|
175
|
+
version: 0.6.9
|
176
176
|
- !ruby/object:Gem::Dependency
|
177
177
|
name: rsc
|
178
178
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
222
|
rubyforge_project:
|
223
|
-
rubygems_version: 2.6.
|
223
|
+
rubygems_version: 2.6.13
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Rack-Rscript is a light-weight alternative to Sinatra-Rscript.
|
metadata.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
�p�#�v{5��8ނ���z�#o�IF�#����M\��q3���~��^���P��J8��Yc�;.��1�V�JEJ:*$���STh5"�
|
2
|
+
78P2��2h?�α�_�$����ؘ����[4l��%�İ@�N��\��5�d���@�����`Wo�.�ED
|
3
|
+
���e�\�{���E�a�9o���Y:�o�({���ߌ�p�(ڮܜ���h��P���x��,���:��&�Ż��@
|