json-rpc-objects-psych 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ gem "json-rpc-objects", ">= 0.4.0"
5
+ gem "psych", ">= 0"
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "bundler", ">= 1.0.0"
11
+ gem "jeweler", ">= 1.5.2"
12
+ end
@@ -0,0 +1,28 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ addressable (2.2.6)
6
+ git (1.2.5)
7
+ hash-utils (0.18.1)
8
+ jeweler (1.6.4)
9
+ bundler (~> 1.0)
10
+ git (>= 1.2.5)
11
+ rake
12
+ json-rpc-objects (0.4.2)
13
+ abstract (>= 1.0.0)
14
+ addressable (>= 2.2.2)
15
+ hash-utils (>= 0.18.0)
16
+ multi_json
17
+ multi_json (1.0.3)
18
+ psych (1.2.1)
19
+ rake (0.9.2)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ bundler (>= 1.0.0)
26
+ jeweler (>= 1.5.2)
27
+ json-rpc-objects (>= 0.4.0)
28
+ psych
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ JSON-RPC Objects YAML Psych Serializer
2
+ ======================================
3
+
4
+ **JSON-RPC Objects** are implementation of by [JSON-RPC][1] defined
5
+ objects with respect to specifications compliance and API backward
6
+ compatibility. It implements all versions of the protocol and support
7
+ for ability to communicate by the same protocol version which the
8
+ other side uses by a transparent way.
9
+
10
+ This is [YAML][11] serializing support using [libyaml][12] via
11
+ [Psych][13] for this library. See [JSON-RPC Objects][2].
12
+
13
+
14
+ Contributing
15
+ ------------
16
+
17
+ 1. Fork it.
18
+ 2. Create a branch (`git checkout -b 20101220-my-change`).
19
+ 3. Commit your changes (`git commit -am "Added something"`).
20
+ 4. Push to the branch (`git push origin 20101220-my-change`).
21
+ 5. Create an [Issue][6] with a link to your branch.
22
+ 6. Enjoy a refreshing Diet Coke and wait.
23
+
24
+
25
+ Copyright
26
+ ---------
27
+
28
+ Copyright © 2011 [Martin Kozák][7]. See `LICENSE.txt` for
29
+ further details.
30
+
31
+ [1]: http://en.wikipedia.org/wiki/JSON-RPC
32
+ [2]: https://github.com/martinkozak/json-rpc-objects
33
+ [6]: http://github.com/martinkozak/json-rpc-objects-psych/issues
34
+ [7]: http://www.martinkozak.net/
35
+
36
+ [11]: http://yaml.org/
37
+ [12]: http://pyyaml.org/wiki/LibYAML
38
+ [13]: http://github.com/tenderlove/psych
@@ -0,0 +1,29 @@
1
+ # encoding: utf-8
2
+ require 'rubygems'
3
+ require 'bundler'
4
+
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+
13
+ require 'rake'
14
+ require 'jeweler'
15
+
16
+ Jeweler::Tasks.new do |gem|
17
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
18
+ gem.name = "json-rpc-objects-psych"
19
+ gem.homepage = "http://github.com/martinkozak/json-rpc-objects-psych"
20
+ gem.license = "MIT"
21
+ gem.summary = 'YAML serializing support using libyaml (via Psych) for JSON-RPC Objects. JSON-RPC Objects is complete implementation of JSON-RPC objects with respect to specifications compliance and API backward compatibility. '
22
+ gem.email = "martinkozak@martinkozak.net"
23
+ gem.authors = ["Martin Kozák"]
24
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
25
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
26
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
27
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
28
+ end
29
+ Jeweler::RubygemsDotOrgTasks.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+ # (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
3
+
4
+ require "json-rpc-objects/serializer"
5
+ require "psych"
6
+
7
+ ##
8
+ # Main JSON-RPC Objects module.
9
+ #
10
+
11
+ module JsonRpcObjects
12
+
13
+ ##
14
+ # Abstract serializer class.
15
+ # @abstract
16
+ #
17
+
18
+ class Serializer
19
+
20
+ ##
21
+ # YAML serializer using internal +libyaml+ (via Psych).
22
+ #
23
+
24
+ class Psych < Serializer
25
+
26
+ ##
27
+ # Serializes data.
28
+ #
29
+ # @param [Object] data some data
30
+ # @return [Object] object in serialized form
31
+ #
32
+
33
+ def serialize(data)
34
+ ::Psych.dump(data)
35
+ end
36
+
37
+ ##
38
+ # Deserializes data.
39
+ #
40
+ # @param [Object] data data in serialized form
41
+ # @return [Object] deserialized data
42
+ #
43
+
44
+ def deserialize(data)
45
+ ::Psych.load(data)
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+
53
+
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: json-rpc-objects-psych
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Martin Kozák
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-08-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json-rpc-objects
16
+ requirement: &13713840 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.4.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *13713840
25
+ - !ruby/object:Gem::Dependency
26
+ name: psych
27
+ requirement: &13713240 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *13713240
36
+ - !ruby/object:Gem::Dependency
37
+ name: bundler
38
+ requirement: &13712620 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 1.0.0
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *13712620
47
+ - !ruby/object:Gem::Dependency
48
+ name: jeweler
49
+ requirement: &13712040 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.5.2
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *13712040
58
+ description:
59
+ email: martinkozak@martinkozak.net
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files:
63
+ - LICENSE.txt
64
+ - README.md
65
+ files:
66
+ - .document
67
+ - Gemfile
68
+ - Gemfile.lock
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - VERSION
73
+ - lib/json-rpc-objects/serializer/psych.rb
74
+ homepage: http://github.com/martinkozak/json-rpc-objects-psych
75
+ licenses:
76
+ - MIT
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ segments:
88
+ - 0
89
+ hash: 3693730729761246031
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 1.8.10
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: YAML serializing support using libyaml (via Psych) for JSON-RPC Objects.
102
+ JSON-RPC Objects is complete implementation of JSON-RPC objects with respect to
103
+ specifications compliance and API backward compatibility.
104
+ test_files: []