padrino-multi-json 0.0.2

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/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source :rubygems
2
+
3
+ gem 'multi_json'
4
+ gem 'padrino-core'
5
+
6
+ group :test do
7
+ gem 'rspec'
8
+ end
9
+
10
+ group :development do
11
+ gem 'rake'
12
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (3.2.12)
5
+ i18n (~> 0.6)
6
+ multi_json (~> 1.0)
7
+ diff-lcs (1.1.3)
8
+ http_router (0.10.2)
9
+ rack (>= 1.0.0)
10
+ url_mount (~> 0.2.1)
11
+ i18n (0.6.1)
12
+ multi_json (1.5.1)
13
+ padrino-core (0.10.7)
14
+ activesupport (~> 3.2.0)
15
+ http_router (~> 0.10.2)
16
+ sinatra (~> 1.3.1)
17
+ thor (~> 0.15.2)
18
+ tilt (~> 1.3.0)
19
+ rack (1.5.2)
20
+ rack-protection (1.3.2)
21
+ rack
22
+ rake (10.0.3)
23
+ rspec (2.12.0)
24
+ rspec-core (~> 2.12.0)
25
+ rspec-expectations (~> 2.12.0)
26
+ rspec-mocks (~> 2.12.0)
27
+ rspec-core (2.12.2)
28
+ rspec-expectations (2.12.1)
29
+ diff-lcs (~> 1.1.3)
30
+ rspec-mocks (2.12.1)
31
+ sinatra (1.3.4)
32
+ rack (~> 1.4)
33
+ rack-protection (~> 1.3)
34
+ tilt (~> 1.3, >= 1.3.3)
35
+ thor (0.15.4)
36
+ tilt (1.3.3)
37
+ url_mount (0.2.1)
38
+ rack
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ multi_json
45
+ padrino-core
46
+ rake
47
+ rspec
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ padrino-json
2
+ ============
3
+
4
+ Padrino-json
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'rubygems' unless defined?(Gem)
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ %w(install release).each do |task|
6
+ Rake::Task[task].enhance do
7
+ sh "rm -rf pkg"
8
+ end
9
+ end
10
+
11
+ desc "Bump version on github"
12
+ task :bump do
13
+ if `git status -s`.chomp != ""
14
+ version = Bundler.load_gemspec(Dir[File.expand_path('../*.gemspec', __FILE__)].first).version
15
+ sh "git add .; git commit -a -m \"Bump to version #{version}\""
16
+ else
17
+ puts "\e[31mNothing to commit (working directory clean)\e[0m"
18
+ end
19
+ end
20
+
21
+ task :release => :bump
22
+
23
+ desc "Run complete application spec suite"
24
+ RSpec::Core::RakeTask.new(:spec)
25
+
26
+ task :default => :spec
@@ -0,0 +1,15 @@
1
+ module Padrino
2
+ module Json
3
+ class << self
4
+ def included(base)
5
+ base.send(:include, InstanceMethods)
6
+ end
7
+ end #class
8
+
9
+ module InstanceMethods
10
+ def json(*args)
11
+ MultiJson.dump(*args)
12
+ end
13
+ end
14
+ end #Json
15
+ end #padrino
@@ -0,0 +1,3 @@
1
+ module PadrinoJson
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,4 @@
1
+ require 'multi_json'
2
+ require 'padrino-multi-json/padrino-multi-json'
3
+
4
+ Padrino::Application.send(:include, Padrino::Json)
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "padrino-multi-json/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'padrino-multi-json'
7
+ s.version = PadrinoJson::VERSION
8
+ s.date = '2013-02-11'
9
+ s.summary = "Simplified way to render json strings in padrino apps"
10
+ s.description = "Simplified way to render json strings in padrino apps"
11
+ s.authors = ["Sumeet Singh"]
12
+ s.email = 'ortuna@gmail.com'
13
+ s.homepage = 'http://rubygems.org/gems/padrino-multi-json'
14
+
15
+ s.rubyforge_project = "padrino-contrib"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
Binary file
data/spec/json_spec.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe Padrino::Json do
4
+ it 'Should render some JSON' do
5
+ klass = JsonTestClass.new
6
+ string = klass.json(:foo => 'bar')
7
+ string.should == "{\"foo\":\"bar\"}"
8
+ end
9
+
10
+ end
@@ -0,0 +1,9 @@
1
+ require 'rubygems' unless defined?(Gem)
2
+ require 'rspec' unless defined?(RSpec)
3
+
4
+ require 'padrino-core'
5
+ require 'padrino-multi-json'
6
+
7
+ class JsonTestClass
8
+ include Padrino::Json
9
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: padrino-multi-json
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sumeet Singh
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Simplified way to render json strings in padrino apps
15
+ email: ortuna@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Gemfile
21
+ - Gemfile.lock
22
+ - README.md
23
+ - Rakefile
24
+ - lib/padrino-multi-json.rb
25
+ - lib/padrino-multi-json/padrino-multi-json.rb
26
+ - lib/padrino-multi-json/version.rb
27
+ - padrino-multi-json.gemspec
28
+ - pkg/padrino-multi-json-0.0.2.gem
29
+ - spec/json_spec.rb
30
+ - spec/spec_helper.rb
31
+ homepage: http://rubygems.org/gems/padrino-multi-json
32
+ licenses: []
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ segments:
44
+ - 0
45
+ hash: 3709537927680582137
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project: padrino-contrib
54
+ rubygems_version: 1.8.25
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: Simplified way to render json strings in padrino apps
58
+ test_files:
59
+ - spec/json_spec.rb
60
+ - spec/spec_helper.rb