Permalink
Browse files

fixed two ruby 1.8.7 incompatibilities, added ext and ext_spec

  • Loading branch information...
1 parent 5f663d2 commit 17b21cd262717f9cdfff48fabdd34a1a5d699baa @paulasmuth committed May 4, 2012
Showing with 22 additions and 4 deletions.
  1. +1 −0 lib/fnordmetric.rb
  2. +3 −3 lib/fnordmetric/app.rb
  3. +3 −0 lib/fnordmetric/ext.rb
  4. +1 −1 lib/fnordmetric/inbound_stream.rb
  5. +14 −0 spec/ext_spec.rb
View
@@ -7,6 +7,7 @@
require 'haml'
require 'rack/server'
+require "fnordmetric/ext"
require "fnordmetric/version"
module FnordMetric
View
@@ -10,9 +10,9 @@ class FnordMetric::App < Sinatra::Base
"vendor/highcharts.js" => "application/x-javascript"
}
- Encoding.default_external = Encoding::UTF_8
-
- #use Rack::Reloader, 0
+ if RUBY_VERSION =~ /1.9.\d/
+ Encoding.default_external = Encoding::UTF_8
+ end
enable :session
View
@@ -0,0 +1,3 @@
+class Symbol
+ alias :intern :to_sym
+end
@@ -3,7 +3,7 @@ class FnordMetric::InboundStream < EventMachine::Connection
def self.start(opts)
@@opts = opts
- EM.start_server(*opts[:inbound_stream], self)
+ EM.start_server(*(opts[:inbound_stream] << self))
end
def self.options(opts)
View
@@ -0,0 +1,14 @@
+require ::File.expand_path('../spec_helper.rb', __FILE__)
+
+describe "core extensions" do
+
+ include FnordMetric
+
+ describe Symbol do
+ it "should return self when intern was called" do
+ sym = :fnord
+ sym.intern.should == sym
+ end
+ end
+
+end

0 comments on commit 17b21cd

Please sign in to comment.