rack-rscript 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 116ac1c0f9c5fce98eda8c8fb158a8d288aabd2b
4
- data.tar.gz: b5070819669bc043f2b4229d7c67e8c9dfd13e03
3
+ metadata.gz: 884384c1924caca692fde02aa10fc52ece9e7eb9
4
+ data.tar.gz: a3c2bfd008be079505d95acdf8c78ceb2f104eef
5
5
  SHA512:
6
- metadata.gz: a65aa186e3075daed08c0e4cede57b424987ba4845145651b829513a18de93d0cfb4ebc4d9df924cf2d1333187e7d3ccfa056f260264d8560901742f00123c98
7
- data.tar.gz: 88b1ccaa3b82efa91e66285b276ac239c30466b13cd77527b03bb015874a62e9f11b2f06398f86b8226c367a69f8547b984e5dc22fc6fb4e20b0b267a301909c
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(logfile: '', logrotate: 'daily', pkg_src: '', cache: 5,
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 logfile: logfile, logrotate: logrotate, \
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 = false
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 "_: " + env.keys.inspect
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(e)
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
- log(err_label)
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.1
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
- 8ixkARkWAmV1MB4XDTE2MTAzMDExMjYyMVoXDTE3MTAzMDExMjYyMVowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE3MTExMzE3MjAyMloXDTE4MTExMzE3MjAyMlowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBANpcemozULm931aHIuW4O6k6BWMDqQVhj2Bn5lkbwkQr0sVf8RtngnahNiR9
19
- IN2avQXmMZ9ierJ/zozZh1db+p6uyDmy8iqF5c3vNjmMmXX9+lRR2+q+ddI7pQYE
20
- ifjllr0wwTMDAEZyhiWZeQjp8PFQ1l4KGb7UMMZ09HlC0euT69n1Y6uFuEsgFcKY
21
- M74nX/78mjT1UAaWr6Xy/OKhG5cGPmO4QiSkYCLJ7uAJnoA/8dBwQto24SzJfRdG
22
- baT3kdG1z7e6c4yuNvxBUZMKWl0sg9rqwLyd8LK3yvmftHCPQQfOsqFvnV5u6GuE
23
- 9r+xbv3YrqnJX/dt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Y1A8bBhJqZGdpMbwv+Jtn/gpmMjE
32
- EHV4ZelB040ghg==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAhwRT//DM
27
+ wqQ6vSiJBgcQsrzcO9qHONkyb4HwVgWFzI5qD+v9G26OlsvD8+fp0MtiESTsHDI1
28
+ d5aCmH4CYhmrENuovvfEd86HXlGbvF7kPtYODRUWiN01/xoFh7IS9RlKEeakcT+8
29
+ CTiEe4+ZRKUc3toENPvtd2FlQx5bCw12JTX7tARJncjOcDJ1lOAvsuRH/+Tcvzqe
30
+ o8kNj/pFj11m1nFOawQt/05p6394ivLMtGvsFpTpnYRkw5q28bs5Y/UFHFVDM7//
31
+ vvLi4Y0qQy/Uz/kHVXzfeLcG657aNIu8ogA1I3Xnlz0sqlNoDhk5sSBd2BsfkVFS
32
+ sTo/69YTrLx1zw==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-05-04 00:00:00.000000000 Z
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.3'
82
+ version: '0.4'
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.3.4
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.3'
92
+ version: '0.4'
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 0.3.4
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.7
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.7
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.8
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
- ͙a�����c�vڥ�t�)�K��c� �{��Gl� ��]�`�9��WO�`ʈf`�ҁe|�u�ʷ�Z����.�)�\��d6ƨp6���b; ��.bf6{U}�tc�@`��� �n�kKM�(v�� �x��wm�
1
+ p�#�v{5��8ނ���z�#o�IF�#����M\��q3���~��^���P��J8�󳛃�Yc�;.��1VJEJ:*$���STh5"
2
+ 78P2��2h?�α�_�$����ؘ����[4l��%�İ@�N��\��5�d���@�����`Wo�.�ED
3
+ ���e�\�{���E�a�9o���Y:�o�( {���ߌ�p�(ڮܜ���h��P���x��,���:��&�Ż��@