Permalink
Browse files

merge #96

  • Loading branch information...
2 parents fc1e70d + 34d693f commit 33c19ce47fde81032f68330ca66effc8be25dd43 @zzak zzak committed Aug 16, 2013
Showing with 7 additions and 4 deletions.
  1. +4 −3 lib/sinatra/json.rb
  2. +3 −0 sinatra-contrib.gemspec
  3. +0 −1 spec/json_spec.rb
View
@@ -1,5 +1,5 @@
require 'sinatra/base'
-
+require 'multi_json'
module Sinatra
# = Sinatra::JSON
@@ -32,7 +32,6 @@ module Sinatra
# require "sinatra/json"
#
# class MyApp < Sinatra::Base
- # helpers Sinatra::JSON
#
# # define a route that uses the helper
# get '/' do
@@ -126,5 +125,7 @@ def resolve_encoder_action(object, encoder)
end
Base.set :json_content_type, :json
- helpers JSON
+
+ # Load the JSON helpers in modular style automatically
+ Base.helpers JSON
end
View
@@ -121,11 +121,14 @@ Gem::Specification.new do |s|
s.add_dependency "tilt", "~> 1.3"
s.add_dependency "rack-test"
s.add_dependency "rack-protection"
+ s.add_dependency "eventmachine"
+ s.add_dependency "multi_json"
s.add_development_dependency "eventmachine"
s.add_development_dependency "rspec", "~> 2.3"
s.add_development_dependency "haml"
s.add_development_dependency "erubis"
s.add_development_dependency "slim"
s.add_development_dependency "rake"
+ s.add_development_dependency "yajl-ruby"
end
View
@@ -33,7 +33,6 @@
describe Sinatra::JSON do
def mock_app(&block)
super do
- helpers Sinatra::JSON
class_eval(&block)
end
end

0 comments on commit 33c19ce

Please sign in to comment.