msgpack_rails 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e573e9ead86a6c6edc4e4ef6dc435d021695165
4
- data.tar.gz: b718ccf23b3a33571a7e7212d1bb7ee7e5a07342
3
+ metadata.gz: b078762cbf3e227bbe359f99ded73b89a6e95714
4
+ data.tar.gz: c4dece2e60cccddd342f3e53c9679e95bceee535
5
5
  SHA512:
6
- metadata.gz: aac10592d912856d86ab31d9e7a9367054b27ff4533d0af16800e34eb747d76d21d7430bb03922850b8e302ddf519ba4d3b061210b6a691bd960092ed3598caf
7
- data.tar.gz: 286ba642e3fbf050682e18fab75a416b1522b8bb90c2c02f47e095c47838f108c9a05f09b61b294e1c9212ebb9d69478f6018dbf85ec1dc7a66d506f29ecb0e4
6
+ metadata.gz: b4d74c030797947bc5f6f9c9527c93012e5107d883ec8055be6a7f51e2003f53332827b05c2d6f49bf2aaf7fcb61b677c2d1a4937263e8488ee811e5da691310
7
+ data.tar.gz: ea3a4dd1dc26da2366ad28e87d407ab4765a200b8372e5ac92063a18cef55f6f6fbe59990594a4bdd5b3a6992803a76bdfbddb92d1f194b72ac24ea360692144
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - rbx-19mode
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem "rake"
7
+ gem "railties"
8
+ gem "activemodel"
@@ -1,3 +1,4 @@
1
+ require "active_model"
1
2
  require "msgpack_rails/activesupport/message_pack"
2
3
 
3
4
  module ActiveModel
@@ -1,3 +1,3 @@
1
1
  module MsgpackRails
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/msgpack_rails.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require "active_support"
2
- require "active_model"
3
2
  require "msgpack_rails/version"
4
3
  require "msgpack_rails/activesupport/message_pack"
5
- require "msgpack_rails/activemodel/serializers/message_pack"
6
4
 
7
5
  module ActiveSupport
8
6
  eager_autoload do
@@ -10,10 +8,24 @@ module ActiveSupport
10
8
  end
11
9
  end
12
10
 
13
- module ActiveModel
14
- module Serializers
15
- eager_autoload do
16
- autoload :MessagePack
11
+ if defined?(ActiveModel)
12
+ require "msgpack_rails/activemodel/serializers/message_pack"
13
+
14
+ module ActiveModel
15
+ module Serializers
16
+ eager_autoload do
17
+ autoload :MessagePack
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ if defined?(::Rails)
24
+ module MsgpackRails
25
+ class Rails < ::Rails::Engine
26
+ initializer "msgpack_rails" do
27
+ ::ActiveRecord::Base.send(:include, ActiveModel::Serializers::MessagePack)
28
+ end
17
29
  end
18
30
  end
19
31
  end
@@ -19,6 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "activesupport", ">= 3.0"
22
- spec.add_runtime_dependency "activemodel", ">= 3.0"
23
- spec.add_runtime_dependency "msgpack"
22
+ if RUBY_ENGINE == "jruby"
23
+ spec.add_runtime_dependency "msgpack-jruby"
24
+ else
25
+ spec.add_runtime_dependency "msgpack"
26
+ end
24
27
  end
@@ -1,4 +1,5 @@
1
1
  require_relative "../test_helper"
2
+ require "msgpack_rails/activemodel/serializers/message_pack"
2
3
  require_relative "models/contact"
3
4
 
4
5
  class Contact
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jingwen Owen Ou
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
- - !ruby/object:Gem::Dependency
28
- name: activemodel
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: msgpack
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +46,7 @@ extensions: []
60
46
  extra_rdoc_files: []
61
47
  files:
62
48
  - .gitignore
49
+ - .travis.yml
63
50
  - Gemfile
64
51
  - LICENSE.txt
65
52
  - README.md