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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 875cbf1083ade035659604b1213379e3805e3aa0
4
- data.tar.gz: cc138f396e38d7d4a516d3e7354594a41467646d
3
+ metadata.gz: b667f493e91891962a5c7faf606bd8c2aedcc5fe
4
+ data.tar.gz: 9edf50304adf17122603d4faa2d1466a3bd34cd8
5
5
  SHA512:
6
- metadata.gz: 32b39e8bf085b27df48f84e90dcb6717640de45fd125e4fe0c8c04bfe1d93008f2017fef41cb5f0179cdc274c8a5fa6a996db93bfb2925f00d017c632f0f40ad
7
- data.tar.gz: cc844b85081fdced5c58be772b76fd3e699f6a5109be4888bd2211806f395ec5817757f9b25c20b1f10e3d2cf638fc758a92cc3ea007a2313d2274d863d6e9d7
6
+ metadata.gz: eef3cc82c16906d5befc5b00f7142af99c24be094a29a95b6eb55a6d87185d0f4ce4774b18f45e3d2570ec831ef89c558546d8bee57615732c702662041f4095
7
+ data.tar.gz: a82bee559a6e1340fdfcd9752dc024ab05f9fdb305ee1f88106330b50b0811885f97cf68f4c2adde4bb6b38c493448050d8cae735f80089ae394faf2e4459293
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- Dh*"����<�Z����ā�Ł,�^�����L��爋��r<&��ư��l�0�$�\�2I~ӛ��ћZ�"o��|Se�8�hQ2�)��W�j�
1
+ Ơ� cY%�)O��u!����B������x��w
2
- +H/45Fr��v�*8#~�]�?�����P ��Rx���1x/Z0������T��ҫ��Θ�H�
2
+ l.G��T/�j$�%Ѿ��b>� He�r�[���a�-���#ŝ׹ey]��B�?��� �,@�3��h{Bvb���կ��m��̣��%�M�`�������C�8d����K��R��<R��QR��]A�]���d��h���ᝯ��1́�����9H��3�� E[nhD��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
- require 'websocket-eventmachine-client'
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: '', sps_port: 59000}\
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
- def call(env)
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
- [open(url,'User-Agent' => 'Rack-Rscript'){|x| x.read },'text/plain']
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.6.1
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
- 8ixkARkWAmV1MB4XDTE0MDIxMTE4NDI0M1oXDTE1MDIxMTE4NDI0M1owSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE1MDkxNzA5NDcwM1oXDTE2MDkxNjA5NDcwM1owSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAKrmZWUHCJqXvmbZM19hQCrprAw5qj4gDIQC1cr18BMcn95FSPqWvF5kjVkf
19
- hPXJJx6SACMZOxCClzmZiCHRBYkPqc1S0lyqaeheu8L0Iwym/q1X9NFpBVdvaC+B
20
- rmWp7mXWz0N7PW5LYOqtI68KClbw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Hbqw/wYHI2YVxEGwZsP3HjgZn4gxjWEhhSALJD8PLlf6Zzvyv+XVQyd1jD2sOEu
30
- 8/kNM9qjSYVjJKgXJzkLVi24Qqerj9Gqd33waxTIddWE6LjJ7TRqE9LvBoduUTcZ
31
- oGNzP1rxjANUGW/2lTKop1erzGf0J+T5D99GqIMDOgY0isR8aE/vL7wcicJB/4tg
32
- 3HU/e1wiHvcI6A==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAOSi6uxfQ
27
+ nTkXo+jMmRZQLOiXwK2sfsZtGDU8AqWblBYaMRfzUlQkJcAdmgOMORv0eeTCtxrg
28
+ lu3+8OgcSv3xMBZFgvhGNKlkeWFkXBXHqFIQOddKG42q0gpYk7NPRYp2v0rVGDgO
29
+ EO0cEsMO6WXyfjitRBTKtNGbeHlFFab754ei13JKTGOD+/43sPY0FT1Olpgg9qzA
30
+ 0eklCyS4jdItOETxkH2f5Fg8RwJVgbAQMj9jrs7rabd5wV5BHVVxQDPGjhAANyni
31
+ SPldGmxByaKACzPfwVD1OWtnfTgqGsJzquNqO244CsVqGhH2zKMpfEJWX9h/FVqy
32
+ XUT2A0hr22sJdA==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-12-14 00:00:00.000000000 Z
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.1'
82
+ version: '0.2'
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.1.25
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.1'
92
+ version: '0.2'
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 0.1.25
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.2.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