Skip to content

Commit

Permalink
ruby 1.9 is required
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Oct 14, 2012
1 parent 366f096 commit b748c48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 3 additions & 9 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ path = ::File.expand_path(::File.dirname(__FILE__))
$: << ::File.join(path, 'lib')
Dir[::File.join(path, 'deps', '*', 'lib')].each {|x| $: << x }

# Require newest rack
raise 'Rack 1.2.0 or newer required' if Rack.release < '1.2'

# We want to read all text data as UTF-8
Encoding.default_external = Encoding::UTF_8 if ''.respond_to? :encoding
Encoding.default_external = Encoding::UTF_8

require 'fileutils'
require 'rack/olelo_patches'
Expand All @@ -17,6 +14,7 @@ require 'rack/static_cache'
require 'olelo'
require 'olelo/middleware/degrade_mime_type'
require 'olelo/middleware/flash'
require 'olelo/middleware/force_encoding'
require 'securerandom'

Olelo::Config.instance['app_path'] = path
Expand Down Expand Up @@ -66,11 +64,7 @@ if !Olelo::Config['rack.blacklist'].empty?
use Olelo::Middleware::Blacklist, :blacklist => Olelo::Config['rack.blacklist']
end

if ''.respond_to? :encoding
require 'olelo/middleware/force_encoding'
use Olelo::Middleware::ForceEncoding
end

use Olelo::Middleware::ForceEncoding
use Olelo::Middleware::Flash, :set_accessors => %w(error warn info)
use Rack::RelativeRedirect

Expand Down
6 changes: 2 additions & 4 deletions test/request_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'helper'
require 'olelo/middleware/flash'
require 'olelo/middleware/force_encoding'
require 'rack/session/pool'

Rack::MockRequest::DEFAULT_ENV['REMOTE_ADDR'] = 'localhorst'
Expand Down Expand Up @@ -68,10 +69,7 @@ class Bacon::Context
logger = Logger.new(File.join(@app_path, 'test.log'))

@app = Rack::Builder.new do
if ''.respond_to? :encoding
require 'olelo/middleware/force_encoding'
use Olelo::Middleware::ForceEncoding
end
use Olelo::Middleware::ForceEncoding
use Rack::Session::Pool
use Olelo::Middleware::Flash, :set_accessors => %w(error warn info)
Olelo::Initializer.initialize(logger)
Expand Down

0 comments on commit b748c48

Please sign in to comment.