Permalink
Browse files

Fixed some relations and json problem

  • Loading branch information...
1 parent 2bf5248 commit fa787d141e1cb2a267853b056e38b5fabb9cdd1b @gazay committed Jan 11, 2012
Showing with 25 additions and 51 deletions.
  1. +20 −48 Gemfile.lock
  2. +4 −2 lib/gon/sinatra/helpers.rb
  3. +1 −1 lib/gon/sinatra/version.rb
View
@@ -1,70 +1,42 @@
PATH
remote: .
specs:
- gon (2.0.4)
- actionpack (>= 2.3.0)
- jbuilder
+ gon-sinatra (0.0.5)
json
rabl
+ sinatra
GEM
remote: http://rubygems.org/
specs:
- actionpack (3.1.1)
- activemodel (= 3.1.1)
- activesupport (= 3.1.1)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.2)
- rack-cache (~> 1.1)
- rack-mount (~> 0.8.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.0.2)
- activemodel (3.1.1)
- activesupport (= 3.1.1)
- builder (~> 3.0.0)
- i18n (~> 0.6)
- activesupport (3.1.1)
+ activesupport (3.1.3)
multi_json (~> 1.0)
- blankslate (2.1.2.4)
- builder (3.0.0)
diff-lcs (1.1.3)
- erubis (2.7.0)
- hike (1.2.1)
- i18n (0.6.0)
- jbuilder (0.3)
- activesupport (>= 3.0.0)
- blankslate (>= 2.1.2.4)
- json (1.6.1)
+ json (1.6.4)
multi_json (1.0.4)
- rabl (0.5.1)
+ rabl (0.5.3)
activesupport (>= 2.3.14)
multi_json (~> 1.0.3)
- rack (1.3.5)
- rack-cache (1.1)
- rack (>= 0.4)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
- rack-test (0.6.1)
- rack (>= 1.0)
- rspec (2.7.0)
- rspec-core (~> 2.7.0)
- rspec-expectations (~> 2.7.0)
- rspec-mocks (~> 2.7.0)
- rspec-core (2.7.1)
- rspec-expectations (2.7.0)
+ rack (1.4.0)
+ rack-protection (1.2.0)
+ rack
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.7.0)
- sprockets (2.0.3)
- hike (~> 1.2)
- rack (~> 1.0)
- tilt (!= 1.3.0, ~> 1.1)
+ rspec-mocks (2.8.0)
+ sinatra (1.3.2)
+ rack (>= 1.3.6, ~> 1.3)
+ rack-protection (~> 1.2)
+ tilt (>= 1.3.3, ~> 1.3)
tilt (1.3.3)
PLATFORMS
ruby
DEPENDENCIES
- gon!
+ gon-sinatra!
rspec
@@ -1,3 +1,5 @@
+require 'json'
+
module Gon
module Sinatra
module Helpers
@@ -13,11 +15,11 @@ def include_gon(options = {})
script = "<script>window." + namespace + " = {};"
unless options[:camel_case]
data.each do |key, val|
- script += namespace + "." + key.to_s + '=' + val.to_s + ";"
+ script += namespace + "." + key.to_s + '=' + val.to_json + ";"
end
else
data.each do |key, val|
- script += namespace + "." + key.to_s.camelize(:lower) + '=' + val.to_s + ";"
+ script += namespace + "." + key.to_s.camelize(:lower) + '=' + val.to_json + ";"
end
end
script += "</script>"
@@ -1,5 +1,5 @@
module Gon
module Sinatra
- VERSION = '0.0.5'
+ VERSION = '0.0.6'
end
end

0 comments on commit fa787d1

Please sign in to comment.