rufus-sixjo 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rufus/sixjo.rb +12 -8
  2. metadata +3 -3
@@ -1,6 +1,6 @@
1
1
  #
2
2
  #--
3
- # Copyright (c) 2008, John Mettraux, jmettraux@gmail.com
3
+ # Copyright (c) 2008-2009, John Mettraux, jmettraux@gmail.com
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -65,7 +65,7 @@ module Rufus
65
65
 
66
66
  module Sixjo
67
67
 
68
- VERSION = '0.1.4'
68
+ VERSION = '0.1.5'
69
69
 
70
70
  class << self
71
71
  # View path (defaults to +views+, in the current working directory)
@@ -122,7 +122,7 @@ module Rufus
122
122
  rescue => e
123
123
  #puts e
124
124
  #puts e.backtrace
125
- return [ 400, {}, e.to_s ]
125
+ return [ 400, {}, [ e.to_s ] ]
126
126
  end
127
127
 
128
128
  if block
@@ -219,7 +219,7 @@ module Rufus
219
219
 
220
220
  def erb (template, options = {})
221
221
 
222
- content = File.read( Sixjo.view_path + "/#{template}.erb")
222
+ content = File.read(Sixjo.view_path + "/#{template}.erb")
223
223
  #
224
224
  # TODO : make views/ configurable
225
225
 
@@ -267,21 +267,24 @@ module Rufus
267
267
  begin
268
268
 
269
269
  caught = catch :done do
270
- r.response.body = r.call || []
270
+ #r.response.body = r.call || []
271
+ r.response.write(r.call || '')
271
272
  nil
272
273
  end
273
274
 
274
275
  if caught
275
276
  caught = Array(caught)
276
277
  r.response.status = caught[0]
277
- r.response.body = caught[1]
278
+ #r.response.body = caught[1]
279
+ r.response.write(caught[1])
278
280
  end
279
281
 
280
282
  rescue Exception => e
281
283
 
282
284
  r.response.status = 500
283
285
  r.response.content_type = 'text/plain'
284
- r.response.body = e.to_s + "\n" + e.backtrace.join("\n")
286
+ #r.response.body = e.to_s + "\n" + e.backtrace.join("\n")
287
+ r.response.write(e.to_s + "\n" + e.backtrace.join("\n"))
285
288
  end
286
289
 
287
290
  r.response.body = [] if env['REQUEST_METHOD'] == 'HEAD'
@@ -302,7 +305,8 @@ module Rufus
302
305
  def redirect (path, status=303, body=nil)
303
306
  @response.status = status
304
307
  @response.location = path
305
- @response.body = body || "#{status} redirecting to #{path}"
308
+ #@response.body = body || "#{status} redirecting to #{path}"
309
+ @response.write(body || "#{status} redirecting to #{path}")
306
310
  throw :done
307
311
  end
308
312
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-sixjo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-22 00:00:00 +09:00
12
+ date: 2009-01-07 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version:
68
68
  requirements:
69
69
  - rack
70
- rubyforge_project:
70
+ rubyforge_project: rufus
71
71
  rubygems_version: 1.3.1
72
72
  signing_key:
73
73
  specification_version: 2