rack-rscript 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/lib/rack-rscript.rb +19 -33
- metadata +22 -42
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b667f493e91891962a5c7faf606bd8c2aedcc5fe
|
4
|
+
data.tar.gz: 9edf50304adf17122603d4faa2d1466a3bd34cd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eef3cc82c16906d5befc5b00f7142af99c24be094a29a95b6eb55a6d87185d0f4ce4774b18f45e3d2570ec831ef89c558546d8bee57615732c702662041f4095
|
7
|
+
data.tar.gz: a82bee559a6e1340fdfcd9752dc024ab05f9fdb305ee1f88106330b50b0811885f97cf68f4c2adde4bb6b38c493448050d8cae735f80089ae394faf2e4459293
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Ơ� cY%�)�O��u!����B������x��w
|
2
|
-
|
2
|
+
l.G��T/�j$�%Ѿ��b>�He�r�[���a�-���#ŝey]��B�?����,@�3��h{B�vb���կ��m��̣��%�M�`�������C�8d����K��R��<R��QR��]A�]���d��h���ᝯ��1́�����9H��3���E[n�hD��lf�qЄ�:�a$�m�o�H�Cd%w���M<��Y� �CB�\$����;��y
|
3
|
+
�˛������!�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rack-rscript.rb
CHANGED
@@ -9,7 +9,7 @@ require 'logger'
|
|
9
9
|
require 'haml'
|
10
10
|
require 'slim'
|
11
11
|
require 'tilt'
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
class Redirect
|
15
15
|
attr_reader :to_url
|
@@ -25,16 +25,15 @@ end
|
|
25
25
|
class RackRscript
|
26
26
|
include AppRoutes
|
27
27
|
|
28
|
-
attr_reader :ws
|
29
28
|
|
30
29
|
def initialize(raw_opts={})
|
30
|
+
|
31
31
|
@params = {}
|
32
32
|
@templates = {}
|
33
33
|
|
34
34
|
@rrscript = RScript.new
|
35
35
|
|
36
|
-
opts = {logfile: '', logrotate: 'daily', pkg_src: ''
|
37
|
-
.merge(raw_opts)
|
36
|
+
opts = {logfile: '', logrotate: 'daily', pkg_src: ''}.merge(raw_opts)
|
38
37
|
@url_base = opts[:pkg_src] # web server serving the RSF files
|
39
38
|
@url_base += '/' unless @url_base[-1] == '/'
|
40
39
|
|
@@ -48,36 +47,10 @@ class RackRscript
|
|
48
47
|
super() # required for app-routes initialize method to exectue
|
49
48
|
default_routes(@env, @params)
|
50
49
|
|
51
|
-
if opts[:sps_address] then
|
52
|
-
|
53
|
-
c = WebSocket::EventMachine::Client
|
54
|
-
|
55
|
-
Thread.new do
|
56
|
-
|
57
|
-
EM.run do
|
58
|
-
|
59
|
-
@ws = c.connect(uri: "ws://%s:%s" % [opts[:sps_address], opts[:sps_port]])
|
60
|
-
|
61
|
-
@ws.onopen do
|
62
|
-
#puts "Client connected"
|
63
|
-
end
|
64
|
-
|
65
|
-
@ws.onclose do
|
66
|
-
#puts "Client disconnected"
|
67
|
-
end
|
68
|
-
|
69
|
-
EventMachine.error_handler{ |e|
|
70
|
-
#puts "Error raised during event loop: #{e.message}"
|
71
|
-
|
72
|
-
}
|
73
|
-
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
end
|
78
50
|
end
|
79
51
|
|
80
|
-
|
52
|
+
def call(env)
|
53
|
+
|
81
54
|
@env = env
|
82
55
|
request = env['REQUEST_URI'][/https?:\/\/[^\/]+(.*)/,1]
|
83
56
|
|
@@ -90,10 +63,12 @@ class RackRscript
|
|
90
63
|
content, content_type, status_code = run_route(request, env['REQUEST_METHOD'])
|
91
64
|
|
92
65
|
if content.is_a? Redirect then
|
66
|
+
|
93
67
|
redirectx = content
|
94
68
|
res = Rack::Response.new
|
95
69
|
res.redirect(redirectx.to_url)
|
96
70
|
res.finish
|
71
|
+
|
97
72
|
else
|
98
73
|
|
99
74
|
e = $!
|
@@ -222,8 +197,19 @@ class RackRscript
|
|
222
197
|
end
|
223
198
|
|
224
199
|
get '/source/:package' do |package,job|
|
200
|
+
|
225
201
|
url = "%s%s.rsf" % [@url_base, package]
|
226
|
-
|
202
|
+
|
203
|
+
begin
|
204
|
+
|
205
|
+
[RXFHelper.read(url).first,'text/plain']
|
206
|
+
|
207
|
+
rescue
|
208
|
+
|
209
|
+
['url: ' + url + '; ' + ($!).inspect + \
|
210
|
+
'couldn\'t find that package', 'text/plain']
|
211
|
+
end
|
212
|
+
|
227
213
|
end
|
228
214
|
|
229
215
|
|
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: 0.
|
4
|
+
version: 0.7.0
|
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
|
+
8ixkARkWAmV1MB4XDTE1MDkxNzA5NDcwM1oXDTE2MDkxNjA5NDcwM1owSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
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244CsVqGhH2zKMpfEJWX9h/FVqy
|
32
|
+
XUT2A0hr22sJdA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2015-09-17 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.2'
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.2.2
|
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.2'
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.2.2
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: haml
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,26 +153,6 @@ dependencies:
|
|
153
153
|
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: 2.0.2
|
156
|
-
- !ruby/object:Gem::Dependency
|
157
|
-
name: websocket-eventmachine-client
|
158
|
-
requirement: !ruby/object:Gem::Requirement
|
159
|
-
requirements:
|
160
|
-
- - "~>"
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: '1.0'
|
163
|
-
- - ">="
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: 1.0.1
|
166
|
-
type: :runtime
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '1.0'
|
173
|
-
- - ">="
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: 1.0.1
|
176
156
|
description:
|
177
157
|
email: james@r0bertson.co.uk
|
178
158
|
executables: []
|
@@ -200,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
180
|
version: '0'
|
201
181
|
requirements: []
|
202
182
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
183
|
+
rubygems_version: 2.4.8
|
204
184
|
signing_key:
|
205
185
|
specification_version: 4
|
206
186
|
summary: Rack-Rscript is a light-weight alternative to Sinatra-Rscript.
|
metadata.gz.sig
CHANGED
Binary file
|