jbuilder 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2'
4
4
  s.author = 'David Heinemeier Hansson'
5
5
  s.email = 'david@37signals.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -18,6 +18,21 @@ class JbuilderTemplate < Jbuilder
18
18
  end
19
19
  end
20
20
 
21
- ActionView::Template.register_template_handler :jbuilder, Proc.new { |template|
22
- "if defined?(json); #{template.source}; else; JbuilderTemplate.encode(self) do |json|;#{template.source};end; end;"
23
- }
21
+ class JbuilderHandler
22
+ cattr_accessor :default_format
23
+ self.default_format = Mime::JSON
24
+
25
+ def self.call(template)
26
+ %{
27
+ if defined?(json)
28
+ #{template.source}
29
+ else
30
+ JbuilderTemplate.encode(self) do |json|
31
+ #{template.source}
32
+ end
33
+ end
34
+ }
35
+ end
36
+ end
37
+
38
+ ActionView::Template.register_template_handler :jbuilder, JbuilderHandler
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70354468053200 !ruby/object:Gem::Requirement
16
+ requirement: &70205624198380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70354468053200
24
+ version_requirements: *70205624198380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: blankslate
27
- requirement: &70354468052720 !ruby/object:Gem::Requirement
27
+ requirement: &70205624197900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.1.2.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70354468052720
35
+ version_requirements: *70205624197900
36
36
  description:
37
37
  email: david@37signals.com
38
38
  executables: []
@@ -41,6 +41,7 @@ extra_rdoc_files: []
41
41
  files:
42
42
  - ./Gemfile
43
43
  - ./Gemfile.lock
44
+ - ./jbuilder-0.3.1.gem
44
45
  - ./jbuilder-0.3.gem
45
46
  - ./jbuilder.gemspec
46
47
  - ./lib/jbuilder.rb