padrino-multi-json 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -12,12 +12,19 @@ gem 'padrino-multi-json'
12
12
 
13
13
  ##Usage
14
14
  ````Ruby
15
- MySampleApp.controllers do
16
- get :index do
17
- json :foo => 'bar'
15
+ class JsonExample < Padrino::Application
16
+ register Padrino::Rendering
17
+ register Padrino::Mailer
18
+ register Padrino::Helpers
19
+
20
+ enable :sessions
21
+ register Padrino::MultiJson
22
+
23
+ get '/' do
24
+ json :foo => "bar"
18
25
  end
19
26
  end
20
27
 
21
28
  ````
22
29
 
23
- will render the string {"foo":"bar"}
30
+ will render the string {"foo":"bar"} at the / URI
@@ -1,4 +1,2 @@
1
1
  require 'multi_json'
2
- require 'padrino-multi-json/padrino-multi-json'
3
-
4
- Padrino::Application.send(:include, Padrino::Json)
2
+ require 'padrino-multi-json/padrino-multi-json'
@@ -1,7 +1,13 @@
1
1
  module Padrino
2
- module Json
3
- def json(*args)
4
- MultiJson.dump(*args)
5
- end
2
+ module MultiJson
3
+ module Helper
4
+ def json(*args)
5
+ ::MultiJson.dump(*args)
6
+ end
7
+ end
8
+
9
+ def self.registered(app)
10
+ app.helpers Padrino::MultiJson::Helper
11
+ end
6
12
  end #Json
7
13
  end #padrino
@@ -1,3 +1,3 @@
1
1
  module PadrinoJson
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-multi-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -40,9 +40,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
40
40
  - - ! '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
- segments:
44
- - 0
45
- hash: -2971480183370671854
46
43
  required_rubygems_version: !ruby/object:Gem::Requirement
47
44
  none: false
48
45
  requirements:
@@ -51,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
48
  version: '0'
52
49
  requirements: []
53
50
  rubyforge_project: padrino-multi-json
54
- rubygems_version: 1.8.25
51
+ rubygems_version: 1.8.24
55
52
  signing_key:
56
53
  specification_version: 3
57
54
  summary: Simplified way to render json strings in padrino apps