mongoid-ids 0.1.7 → 0.1.8
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.
- checksums.yaml +4 -4
- data/Gemfile +4 -5
- data/README.md +14 -8
- data/benchmarks/benchmark.rb +0 -3
- data/lib/mongoid/ids/version.rb +1 -1
- data/mongoid-ids.gemspec +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac42f7033c60036a717aa13d3076285c4d2f4ecb
|
4
|
+
data.tar.gz: bf66711631977614ef00f8176d4afaa2173fe0e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e05723462b39494112a9af07fc95a6a0daf9e57d0e5480fd599a9ece1c9d123b4e8436b218f22b48dd4867da22c1b2de3d5a0d4d8590e3f5924fc4fd8bb6be99
|
7
|
+
data.tar.gz: 9ba40c3708070e09d143c3f89f28f2baf1e5b273269f9eb57cc9059be6e81c48fc4015d0bec797811326edcc5064e4aef4f453ce246719052a3c013d7e597e6b
|
data/Gemfile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :test do
|
6
|
-
gem 'rspec', '
|
7
|
-
gem
|
8
|
-
gem '
|
9
|
-
gem 'mongoid-rspec', '~> 2.0.0'
|
6
|
+
gem 'rspec', '>= 3.2.0'
|
7
|
+
gem 'codeclimate-test-reporter', require: nil
|
8
|
+
gem 'mongoid-rspec', '>= 2.0.0'
|
10
9
|
end
|
data/README.md
CHANGED
@@ -1,16 +1,20 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Mongoid::Ids
|
2
|
+
============
|
3
|
+
|
4
|
+
[](http://badge.fury.io/rb/mongoid-ids)
|
3
5
|
[](https://gemnasium.com/nofxx/mongoid-ids)
|
4
6
|
[](http://travis-ci.org/nofxx/mongoid-ids)
|
7
|
+
[](https://codeclimate.com/github/nofxx/mongoid-ids)
|
8
|
+
[](https://coveralls.io/r/nofxx/mongoid-ids)
|
5
9
|
|
6
10
|
## Mongoid::Token || Mongoid::Ids
|
7
11
|
|
8
|
-
This gem is a fork that changes the
|
9
|
-
|
10
|
-
|
12
|
+
This gem is a fork that changes the original behaviour of Mongoid::Token:
|
13
|
+
Instead of a custom field it changes the `_id` field by default.
|
14
|
+
And you may still use tokens on custom fields.
|
11
15
|
|
12
16
|
|
13
|
-
## Short snappy
|
17
|
+
## Short snappy token ids for Mongoid documents
|
14
18
|
|
15
19
|
This library is a quick and simple way to generate unique, random ids
|
16
20
|
for your mongoid documents, in the cases where you can't, or don't want
|
@@ -50,6 +54,9 @@ And that's it! There's lots of configuration options too - which are all
|
|
50
54
|
listed [below](#configuration). By default, the `token` method will
|
51
55
|
create tokens 4 characters long, containing random alphanumeric characters.
|
52
56
|
|
57
|
+
**Notice: Every Mongoid overriding has been removed (#find and #to_param).**
|
58
|
+
|
59
|
+
|
53
60
|
## Custom/Extra fields
|
54
61
|
|
55
62
|
|
@@ -214,8 +221,7 @@ token retry_count: 0
|
|
214
221
|
|
215
222
|
# Notes
|
216
223
|
|
217
|
-
This gem just changes the Mongoid::Token behaviour,
|
218
|
-
need to change ids:
|
224
|
+
This gem just changes the Mongoid::Token behaviour, which is found at:
|
219
225
|
|
220
226
|
http://github.com/thetron/mongoid_token
|
221
227
|
|
data/benchmarks/benchmark.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
$: << File.expand_path("../../lib", __FILE__)
|
2
2
|
|
3
|
-
require 'database_cleaner'
|
4
3
|
require 'mongoid'
|
5
4
|
require 'mongoid/ids'
|
6
5
|
require 'benchmark'
|
@@ -9,8 +8,6 @@ Mongoid.configure do |config|
|
|
9
8
|
config.connect_to("mongoid_ids_benchmark2")
|
10
9
|
end
|
11
10
|
|
12
|
-
DatabaseCleaner.strategy = :truncation
|
13
|
-
|
14
11
|
# start benchmarks
|
15
12
|
|
16
13
|
TOKEN_LENGTH = 5
|
data/lib/mongoid/ids/version.rb
CHANGED
data/mongoid-ids.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = %q(Mongoid token is a gem for creating random, unique tokens for mongoid documents. Highly configurable and great for making URLs a little more compact.)
|
14
14
|
|
15
15
|
s.rubyforge_project = 'mongoid-ids'
|
16
|
-
s.add_dependency 'mongoid', '
|
16
|
+
s.add_dependency 'mongoid', '> 4.0.0'
|
17
17
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-ids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Bruning
|
@@ -9,20 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 4.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 4.0.0
|
28
28
|
description: Mongoid token is a gem for creating random, unique tokens for mongoid
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project: mongoid-ids
|
81
|
-
rubygems_version: 2.4.
|
81
|
+
rubygems_version: 2.4.7
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A little random, unique token generator for Mongoid documents.
|
@@ -90,4 +90,3 @@ test_files:
|
|
90
90
|
- spec/mongoid/ids/options_spec.rb
|
91
91
|
- spec/mongoid/token_spec.rb
|
92
92
|
- spec/spec_helper.rb
|
93
|
-
has_rdoc:
|