mongoid_snappy 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzMyYzY5OTUyMTkyZTgwYmM3ZjI0N2UxZTYzMjYxNzk1ZGZjYTlhNg==
5
- data.tar.gz: !binary |-
6
- YTk3YTM5N2ZjOWY4NTdkYzA3MmFjYzdlZmJiOGE1MzJjYzcyYzYwOA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MjExMGEwYmRlOWQ3MzQ1ODEyNzE1OTk4ZGUzMWYzZTQzY2RiZWZiNjE5NDQ3
10
- MWQxMjQ3NTAzNzg3NTllODdiMjY5MWFmNmE1ZTZlOGZmNjA2ZTNmZDYyYjBm
11
- YjU3NjQ4NGVlNGU1YWI0ZWE0MjhhNDQ1NTgzMjY1ZjM5NmY3ZmQ=
12
- data.tar.gz: !binary |-
13
- NmQzZWUwY2M1M2JlOTJlM2I2ZmQ3NWM3OTExMTc4YTUwZGZmMGRlZDA5ZjI0
14
- OGY5ZmE2ODFkM2ExY2NjMTg1Y2U5YWExYzY2YTkzZGUxZGRmMjc4OTVmZWU3
15
- MDZlMDA1MDZmZmVkMTVhMGQyYzA5MGFjOGY5YzlmNjgzMmEyNmU=
2
+ SHA1:
3
+ metadata.gz: 35002b66a23a55abdc49b9e75dd665d276acd600
4
+ data.tar.gz: 0c80f280f7c73457f9845d2c5d18a09ab5edc4c3
5
+ SHA512:
6
+ metadata.gz: 7b28fb05a3ee3b906e8b5eed8de5b39e171128a73bd0da14885c0545ac294588c4b96c94d41999c0072c58e36178bb30568189b05d7aa26a98afa2fb37ab9479
7
+ data.tar.gz: 0082b0a343e328c92832865bc3be500874fb818b22725c0525368fa0be65af1dc1f941d8ed27f9ca8087710ef416e4fa3b5c30124134fca3ba6d4616881861d3
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-1.9.3-p392
1
+ 2.1.1
data/.travis.yml CHANGED
@@ -4,12 +4,14 @@ notifications:
4
4
  email: false
5
5
 
6
6
  language: ruby
7
+
7
8
  rvm:
8
9
  - 1.9.3
9
10
  - 2.0.0
10
-
11
+ - 2.1.1
12
+
11
13
  gemfile:
12
14
  - Gemfile
13
- - gemfiles/mongoid-3.0.gemfile
14
15
  - gemfiles/mongoid-3.1.gemfile
15
16
  - gemfiles/mongoid-4.0.gemfile
17
+
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  [![Build Status](https://travis-ci.org/rs-pro/mongoid_snappy.png?branch=master)](https://travis-ci.org/rs-pro/mongoid_snappy)
2
+ [![Gem Version](https://badge.fury.io/rb/mongoid_snappy.png)](http://badge.fury.io/rb/mongoid_snappy)
3
+
2
4
 
3
5
  # MongoidSnappy
4
6
 
@@ -1,5 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem "mongoid", github: "mongoid/mongoid", branch: "3.1.0-stable"
3
+ gem 'mongoid', github: 'mongoid/mongoid', branch: '3.1.0-stable'
4
+
5
+ gemspec path: '../'
4
6
 
5
- gemspec path: "../"
@@ -1,5 +1,5 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem "mongoid", github: "mongoid/mongoid", branch: "master"
3
+ gem 'mongoid', github: 'mongoid/mongoid', branch: 'master'
4
4
 
5
- gemspec path: "../"
5
+ gemspec path: '../'
@@ -87,48 +87,5 @@ module Mongoid
87
87
  end
88
88
 
89
89
  if Object.const_defined?("RailsAdmin")
90
- require 'rails_admin/adapters/mongoid'
91
- require 'rails_admin/config/fields/types/text'
92
- module RailsAdmin
93
- module Adapters
94
- module Mongoid
95
- alias_method :type_lookup_without_mongoid_snappy, :type_lookup
96
- def type_lookup(name, field)
97
- if field.type.to_s == 'Mongoid::Snappy'
98
- { :type => :mongoid_snappy }
99
- else
100
- type_lookup_without_mongoid_snappy(name, field)
101
- end
102
- end
103
- end
104
- end
105
-
106
- module Config
107
- module Fields
108
- module Types
109
- class MongoidSnappy < RailsAdmin::Config::Fields::Types::Text
110
- # Register field type for the type loader
111
- RailsAdmin::Config::Fields::Types::register(self)
112
-
113
- register_instance_option :pretty_value do
114
- if value.respond_to?(:data)
115
- ::Snappy.inflate(value.data).force_encoding('UTF-8')
116
- else
117
- value
118
- end
119
- end
120
-
121
- register_instance_option :formatted_value do
122
- if value.respond_to?(:data)
123
- ::Snappy.inflate(value.data).force_encoding('UTF-8')
124
- else
125
- value
126
- end
127
- end
128
- end
129
- end
130
- end
131
- end
132
- end
133
-
90
+ require "mongoid_snappy/rails_admin"
134
91
  end
@@ -0,0 +1,51 @@
1
+ require 'rails_admin/adapters/mongoid'
2
+ begin
3
+ require 'rails_admin/adapters/mongoid/property'
4
+ rescue Exception => e
5
+ end
6
+
7
+ module RailsAdmin
8
+ module Adapters
9
+ module Mongoid
10
+ class Property
11
+ alias_method :type_without_mongoid_snappy, :type
12
+ def type(name, field)
13
+ if field.type.to_s == 'Mongoid::Snappy'
14
+ { :type => :mongoid_snappy }
15
+ else
16
+ type_without_mongoid_snappy(name, field)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ module RailsAdmin
25
+ module Config
26
+ module Fields
27
+ module Types
28
+ class MongoidSnappy < RailsAdmin::Config::Fields::Types::Text
29
+ # Register field type for the type loader
30
+ RailsAdmin::Config::Fields::Types::register(self)
31
+
32
+ register_instance_option :pretty_value do
33
+ if value.respond_to?(:data)
34
+ ::Snappy.inflate(value.data).force_encoding('UTF-8')
35
+ else
36
+ value
37
+ end
38
+ end
39
+
40
+ register_instance_option :formatted_value do
41
+ if value.respond_to?(:data)
42
+ ::Snappy.inflate(value.data).force_encoding('UTF-8')
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -1,3 +1,4 @@
1
1
  module MongoidSnappy
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
4
+
@@ -18,15 +18,16 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'snappy', '~> 0.0.8'
21
+ spec.add_runtime_dependency 'snappy', '~> 0.0.10'
22
22
  spec.add_runtime_dependency 'mongoid', '>= 3.0'
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.3"
25
- spec.add_development_dependency "rake"
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'rake'
26
26
 
27
- spec.add_development_dependency "rspec", "~> 2.13.0"
28
- spec.add_development_dependency "simplecov", "~> 0.7.1"
29
- spec.add_development_dependency "database_cleaner", "~> 0.9.1"
30
- spec.add_development_dependency "mongoid-rspec", "~> 1.7.0"
31
- spec.add_development_dependency "faker", "~> 1.1.2"
27
+ spec.add_development_dependency 'rspec'
28
+ spec.add_development_dependency 'simplecov'
29
+ spec.add_development_dependency 'database_cleaner'
30
+ spec.add_development_dependency 'glebtv-mongoid-rspec'
31
+ spec.add_development_dependency 'faker'
32
32
  end
33
+
@@ -4,5 +4,3 @@ test:
4
4
  database: mongoid_snappy
5
5
  hosts:
6
6
  - localhost:27017
7
- options:
8
- consistency: :strong
metadata CHANGED
@@ -1,141 +1,141 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_snappy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GlebTV
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: snappy
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.8
19
+ version: 0.0.10
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.8
26
+ version: 0.0.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mongoid
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.13.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.13.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.7.1
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.7.1
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: database_cleaner
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.9.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.9.1
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: mongoid-rspec
112
+ name: glebtv-mongoid-rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.7.0
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.7.0
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: faker
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 1.1.2
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 1.1.2
138
+ version: '0'
139
139
  description: Mongoid Snappy
140
140
  email:
141
141
  - glebtv@gmail.com
@@ -143,19 +143,19 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - .gitignore
147
- - .rspec
148
- - .ruby-gemset
149
- - .ruby-version
150
- - .travis.yml
146
+ - ".gitignore"
147
+ - ".rspec"
148
+ - ".ruby-gemset"
149
+ - ".ruby-version"
150
+ - ".travis.yml"
151
151
  - Gemfile
152
152
  - LICENSE.txt
153
153
  - README.md
154
154
  - Rakefile
155
- - gemfiles/mongoid-3.0.gemfile
156
155
  - gemfiles/mongoid-3.1.gemfile
157
156
  - gemfiles/mongoid-4.0.gemfile
158
157
  - lib/mongoid_snappy.rb
158
+ - lib/mongoid_snappy/rails_admin.rb
159
159
  - lib/mongoid_snappy/version.rb
160
160
  - mongoid_snappy.gemspec
161
161
  - spec/mongoid_snappy_spec.rb
@@ -172,17 +172,17 @@ require_paths:
172
172
  - lib
173
173
  required_ruby_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - ! '>='
175
+ - - ">="
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ! '>='
180
+ - - ">="
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.0.6
185
+ rubygems_version: 2.2.2
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Allow string attributes in Mongoid to be compressed with Snappy
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "mongoid", github: "mongoid/mongoid", branch: "3.0.0-stable"
4
-
5
- gemspec path: "../"