mongoid_extended 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +97 -0
- data/Rakefile +10 -0
- data/bin/console +10 -0
- data/bin/setup +7 -0
- data/lib/concern.rb +146 -0
- data/lib/mongoid_extended/epoch_time.rb +51 -0
- data/lib/mongoid_extended/object_id.rb +36 -0
- data/lib/mongoid_extended/serializer.rb +23 -0
- data/lib/mongoid_extended/soft_delete.rb +53 -0
- data/lib/mongoid_extended/version.rb +5 -0
- data/lib/mongoid_extended.rb +33 -0
- data/mongoid_extended.gemspec +27 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1f161200559e0992710c083b3d5ccb3e53cfcfa5
|
4
|
+
data.tar.gz: 8262c4f5e071c729ecc5cb69a692cb50fde6478e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 974734865d57e9761f3d7b1651776799caf6116fc14be4636875ce6150b68eb0798024d899b7f0a863029212fa5490d32be1bcc4127fb2a9e9b37c214aa87a02
|
7
|
+
data.tar.gz: 10349d53834bbe2f80370f65e736c6cee5e01b07b1beffe2de046acf38f4d36e5735671211c73857e37c5f826ab55603bee85b9a4eeea34e0c1dc12723a58a32
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Spirit
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# MongoidExtended
|
2
|
+
|
3
|
+
Mongoid extended, Support EpochTime, ObjectId, Serializer, SoftDelete
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'mongoid_extended'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install mongoid_extended
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'mongoid_extended'
|
25
|
+
|
26
|
+
MongoidExtended.configure :EpochTime, :ObjectId, :Serializer, :SoftDelete
|
27
|
+
```
|
28
|
+
|
29
|
+
### EpochTime
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
MongoidExtended.configure :EpochTime
|
33
|
+
|
34
|
+
class User
|
35
|
+
include Mongoid::Document
|
36
|
+
include Mongoid::Timestamps
|
37
|
+
|
38
|
+
field :locked_at, type: DateTime, default: -> { Time.now.utc }
|
39
|
+
end
|
40
|
+
|
41
|
+
user = User.create
|
42
|
+
#<User _id: 5614eb9b908c4f0828000007, created_at: 2015-10-07 09:53:31 UTC, updated_at: 2015-10-07 09:53:31 UTC, locked_at: 2015-10-07 09:53:31 UTC>
|
43
|
+
|
44
|
+
user.created_at # => 1444211611
|
45
|
+
user.updated_at # => 1444211611
|
46
|
+
user.locked_at # => 1444211611
|
47
|
+
```
|
48
|
+
|
49
|
+
### ObjectId
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
MongoidExtended.configure :ObjectId
|
53
|
+
|
54
|
+
User.create.to_json
|
55
|
+
|
56
|
+
{
|
57
|
+
"_id": "5614eb9b908c4f0828000007"
|
58
|
+
}
|
59
|
+
```
|
60
|
+
|
61
|
+
### Serializer
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
# add active_model_serializers support for mongoid
|
65
|
+
MongoidExtended.configure :Serializer
|
66
|
+
```
|
67
|
+
|
68
|
+
### SoftDelete
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
MongoidExtended.configure :SoftDelete
|
72
|
+
|
73
|
+
class User
|
74
|
+
include Mongoid::Document
|
75
|
+
include Mongoid::Timestamps
|
76
|
+
include MongoidExtended::SoftDelete
|
77
|
+
end
|
78
|
+
|
79
|
+
@user = User.create
|
80
|
+
@user.destroy
|
81
|
+
@user.deleted? # => true
|
82
|
+
@user.deleted_at # => 2015-10-07 18:09:19 +0800
|
83
|
+
@user.touch # => RuntimeError, can't modify frozen Hash
|
84
|
+
|
85
|
+
User.count # => 1
|
86
|
+
User.undeleted.count # => 0
|
87
|
+
```
|
88
|
+
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/NaixSpirit/mongoid_extended. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
92
|
+
|
93
|
+
|
94
|
+
## License
|
95
|
+
|
96
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
97
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'mongoid_extended'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
require 'pry'
|
10
|
+
Pry.start
|
data/bin/setup
ADDED
data/lib/concern.rb
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ActiveSupport
|
4
|
+
# A typical module looks like this:
|
5
|
+
#
|
6
|
+
# module M
|
7
|
+
# def self.included(base)
|
8
|
+
# base.extend ClassMethods
|
9
|
+
# base.class_eval do
|
10
|
+
# scope :disabled, -> { where(disabled: true) }
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# module ClassMethods
|
15
|
+
# ...
|
16
|
+
# end
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# By using <tt>ActiveSupport::Concern</tt> the above module could instead be
|
20
|
+
# written as:
|
21
|
+
#
|
22
|
+
# require 'active_support/concern'
|
23
|
+
#
|
24
|
+
# module M
|
25
|
+
# extend ActiveSupport::Concern
|
26
|
+
#
|
27
|
+
# included do
|
28
|
+
# scope :disabled, -> { where(disabled: true) }
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# class_methods do
|
32
|
+
# ...
|
33
|
+
# end
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# Moreover, it gracefully handles module dependencies. Given a +Foo+ module
|
37
|
+
# and a +Bar+ module which depends on the former, we would typically write the
|
38
|
+
# following:
|
39
|
+
#
|
40
|
+
# module Foo
|
41
|
+
# def self.included(base)
|
42
|
+
# base.class_eval do
|
43
|
+
# def self.method_injected_by_foo
|
44
|
+
# ...
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
# module Bar
|
51
|
+
# def self.included(base)
|
52
|
+
# base.method_injected_by_foo
|
53
|
+
# end
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# class Host
|
57
|
+
# include Foo # We need to include this dependency for Bar
|
58
|
+
# include Bar # Bar is the module that Host really needs
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# But why should +Host+ care about +Bar+'s dependencies, namely +Foo+? We
|
62
|
+
# could try to hide these from +Host+ directly including +Foo+ in +Bar+:
|
63
|
+
#
|
64
|
+
# module Bar
|
65
|
+
# include Foo
|
66
|
+
# def self.included(base)
|
67
|
+
# base.method_injected_by_foo
|
68
|
+
# end
|
69
|
+
# end
|
70
|
+
#
|
71
|
+
# class Host
|
72
|
+
# include Bar
|
73
|
+
# end
|
74
|
+
#
|
75
|
+
# Unfortunately this won't work, since when +Foo+ is included, its <tt>base</tt>
|
76
|
+
# is the +Bar+ module, not the +Host+ class. With <tt>ActiveSupport::Concern</tt>,
|
77
|
+
# module dependencies are properly resolved:
|
78
|
+
#
|
79
|
+
# require 'active_support/concern'
|
80
|
+
#
|
81
|
+
# module Foo
|
82
|
+
# extend ActiveSupport::Concern
|
83
|
+
# included do
|
84
|
+
# def self.method_injected_by_foo
|
85
|
+
# ...
|
86
|
+
# end
|
87
|
+
# end
|
88
|
+
# end
|
89
|
+
#
|
90
|
+
# module Bar
|
91
|
+
# extend ActiveSupport::Concern
|
92
|
+
# include Foo
|
93
|
+
#
|
94
|
+
# included do
|
95
|
+
# self.method_injected_by_foo
|
96
|
+
# end
|
97
|
+
# end
|
98
|
+
#
|
99
|
+
# class Host
|
100
|
+
# include Bar # It works, now Bar takes care of its dependencies
|
101
|
+
# end
|
102
|
+
module Concern
|
103
|
+
class MultipleIncludedBlocks < StandardError #:nodoc:
|
104
|
+
def initialize
|
105
|
+
super "Cannot define multiple 'included' blocks for a Concern"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.extended(base) #:nodoc:
|
110
|
+
base.instance_variable_set(:@_dependencies, [])
|
111
|
+
end
|
112
|
+
|
113
|
+
def append_features(base)
|
114
|
+
if base.instance_variable_defined?(:@_dependencies)
|
115
|
+
base.instance_variable_get(:@_dependencies) << self
|
116
|
+
return false
|
117
|
+
else
|
118
|
+
return false if base < self
|
119
|
+
@_dependencies.each { |dep| base.send(:include, dep) }
|
120
|
+
super
|
121
|
+
base.extend const_get(:ClassMethods) if const_defined?(:ClassMethods)
|
122
|
+
base.class_eval(&@_included_block) if instance_variable_defined?(:@_included_block)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def included(base = nil, &block)
|
127
|
+
if base.nil?
|
128
|
+
fail MultipleIncludedBlocks if instance_variable_defined?(:@_included_block)
|
129
|
+
|
130
|
+
@_included_block = block
|
131
|
+
else
|
132
|
+
super
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def class_methods(&class_methods_module_definition)
|
137
|
+
if const_defined?(:ClassMethods, false)
|
138
|
+
mod = const_get(:ClassMethods)
|
139
|
+
else
|
140
|
+
mod = const_set(:ClassMethods, Module.new)
|
141
|
+
end
|
142
|
+
|
143
|
+
mod.module_eval(&class_methods_module_definition)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module MongoidExtended
|
4
|
+
module EpochTime
|
5
|
+
class << self
|
6
|
+
def configured
|
7
|
+
::Time.send(:extend, TimeDemongoize)
|
8
|
+
::DateTime.send(:extend, DateTimeDemongoize)
|
9
|
+
|
10
|
+
@configured = true
|
11
|
+
end
|
12
|
+
|
13
|
+
def configured?
|
14
|
+
!!@configured
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Convert the object from its mongo friendly ruby type to this type.
|
19
|
+
#
|
20
|
+
# @example Demongoize the object.
|
21
|
+
# Time.demongoize(object)
|
22
|
+
#
|
23
|
+
# @param [ Time ] object The time from Mongo.
|
24
|
+
#
|
25
|
+
# @return [ Integer ] The object as a integer.
|
26
|
+
#
|
27
|
+
# @since 3.0.0
|
28
|
+
module TimeDemongoize
|
29
|
+
def demongoize(object)
|
30
|
+
result = super
|
31
|
+
result.nil? ? nil : result.to_i
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Convert the object from its mongo friendly ruby type to this type.
|
36
|
+
#
|
37
|
+
# @example Demongoize the object.
|
38
|
+
# DateTime.demongoize(object)
|
39
|
+
#
|
40
|
+
# @param [ DateTime ] object The time from Mongo.
|
41
|
+
#
|
42
|
+
# @return [ Integer ] The object as a integer.
|
43
|
+
#
|
44
|
+
# @since 3.0.0
|
45
|
+
module DateTimeDemongoize
|
46
|
+
def demongoize(object)
|
47
|
+
::Time.demongoize(object)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module MongoidExtended
|
4
|
+
module ObjectId
|
5
|
+
class << self
|
6
|
+
def configured
|
7
|
+
::BSON::ObjectId.send(:prepend, HashRepresentation)
|
8
|
+
|
9
|
+
@configured = true
|
10
|
+
end
|
11
|
+
|
12
|
+
def configured?
|
13
|
+
!!@configured
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# rewrite methods `BSON::ObjectId#as_json` & `BSON::ObjectId#to_json`
|
18
|
+
# Return the object id as a JSON hash representation.
|
19
|
+
#
|
20
|
+
# @example Get the object id as JSON.
|
21
|
+
# object_id.as_json
|
22
|
+
#
|
23
|
+
# @return [ String ] The object id as a JSON string.
|
24
|
+
#
|
25
|
+
# @since 2.0.0
|
26
|
+
module HashRepresentation
|
27
|
+
def to_json
|
28
|
+
to_s
|
29
|
+
end
|
30
|
+
|
31
|
+
def as_json
|
32
|
+
to_s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module MongoidExtended
|
4
|
+
module Serializer
|
5
|
+
class << self
|
6
|
+
# add active_model_serializers support for mongoid
|
7
|
+
def configured
|
8
|
+
unless defined?(::ActiveModel::SerializerSupport)
|
9
|
+
raise MongoidExtended::GemsLoadError.new(:active_model_serializers)
|
10
|
+
end
|
11
|
+
|
12
|
+
::Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
|
13
|
+
::Mongoid::Criteria.delegate(:active_model_serializer, to: :to_a)
|
14
|
+
|
15
|
+
@configured = true
|
16
|
+
end
|
17
|
+
|
18
|
+
def configured?
|
19
|
+
!!@configured
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module MongoidExtended
|
4
|
+
module SoftDelete
|
5
|
+
class << self
|
6
|
+
def configured
|
7
|
+
add_class_method
|
8
|
+
add_instance_method
|
9
|
+
|
10
|
+
@configured = true
|
11
|
+
end
|
12
|
+
|
13
|
+
def configured?
|
14
|
+
!!@configured
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_class_method
|
18
|
+
instance_eval do
|
19
|
+
extend ActiveSupport::Concern
|
20
|
+
|
21
|
+
included do
|
22
|
+
field :deleted_at, type: DateTime
|
23
|
+
index({ deleted_at: -1 }, { background: true })
|
24
|
+
scope :undeleted, -> { where(deleted_at: nil) }
|
25
|
+
|
26
|
+
alias_method :destroy!, :destroy
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Object.destroy is soft deleted
|
32
|
+
# Object.delete is hard deleted
|
33
|
+
def add_instance_method
|
34
|
+
class_eval do
|
35
|
+
define_method :destroy do
|
36
|
+
run_callbacks(:destroy) do
|
37
|
+
if persisted?
|
38
|
+
set(deleted_at: Time.now.utc)
|
39
|
+
set(updated_at: Time.now.utc) if respond_to?(:updated_at)
|
40
|
+
end
|
41
|
+
@destroyed = true
|
42
|
+
end
|
43
|
+
freeze
|
44
|
+
end
|
45
|
+
|
46
|
+
define_method :deleted? do
|
47
|
+
!deleted_at.blank?
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'mongoid' unless defined?(Mongoid)
|
4
|
+
|
5
|
+
require_relative './concern' unless defined?(ActiveSupport::Concern)
|
6
|
+
require_relative './mongoid_extended/epoch_time'
|
7
|
+
require_relative './mongoid_extended/object_id'
|
8
|
+
require_relative './mongoid_extended/serializer'
|
9
|
+
require_relative './mongoid_extended/soft_delete'
|
10
|
+
|
11
|
+
module MongoidExtended
|
12
|
+
class GemsLoadError < StandardError #:nodoc:
|
13
|
+
def initialize(gem_name)
|
14
|
+
super("`#{gem_name}` gem must be required first")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class << self
|
19
|
+
# configure method is used for select extend modules
|
20
|
+
# @example Use soft delete module and object id module
|
21
|
+
# MongoidExtended.configure(:SoftDelete, :ObjectId)
|
22
|
+
def configure *module_names
|
23
|
+
module_names.each do |module_name|
|
24
|
+
if const_defined?(module_name)
|
25
|
+
klass = ::Object.const_get("MongoidExtended::#{module_name}")
|
26
|
+
klass.configured unless klass.configured?
|
27
|
+
else
|
28
|
+
raise NameError, "uninitialized constant `#{module_name}` in MongoidExtended"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mongoid_extended/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'mongoid_extended'
|
8
|
+
spec.version = MongoidExtended::VERSION
|
9
|
+
spec.authors = ['Spirit']
|
10
|
+
spec.email = ['neverlandxy.naix@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = %q{Mongoid Extended}
|
13
|
+
spec.description = %q{Support EpochTime, ObjectId, Serializer, SoftDelete}
|
14
|
+
spec.homepage = 'https://github.com/NaixSpirit/mongoid_extended'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'pry', '~> 0.10'
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'minitest'
|
25
|
+
spec.add_development_dependency 'mongoid', '~> 4.0'
|
26
|
+
spec.add_development_dependency 'active_model_serializers', '~> 0.9'
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mongoid_extended
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Spirit
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mongoid
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '4.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: active_model_serializers
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
description: Support EpochTime, ObjectId, Serializer, SoftDelete
|
98
|
+
email:
|
99
|
+
- neverlandxy.naix@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
106
|
+
- CODE_OF_CONDUCT.md
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- bin/console
|
112
|
+
- bin/setup
|
113
|
+
- lib/concern.rb
|
114
|
+
- lib/mongoid_extended.rb
|
115
|
+
- lib/mongoid_extended/epoch_time.rb
|
116
|
+
- lib/mongoid_extended/object_id.rb
|
117
|
+
- lib/mongoid_extended/serializer.rb
|
118
|
+
- lib/mongoid_extended/soft_delete.rb
|
119
|
+
- lib/mongoid_extended/version.rb
|
120
|
+
- mongoid_extended.gemspec
|
121
|
+
homepage: https://github.com/NaixSpirit/mongoid_extended
|
122
|
+
licenses:
|
123
|
+
- MIT
|
124
|
+
metadata: {}
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
requirements: []
|
140
|
+
rubyforge_project:
|
141
|
+
rubygems_version: 2.4.7
|
142
|
+
signing_key:
|
143
|
+
specification_version: 4
|
144
|
+
summary: Mongoid Extended
|
145
|
+
test_files: []
|