model_tokenizer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -0
- data/.gitignore +1 -1
- data/.travis.yml +15 -0
- data/Gemfile +8 -1
- data/Gemfile.lock +65 -0
- data/README.md +16 -21
- data/lib/model_tokenizer/version.rb +1 -1
- data/model_tokenizer.gemspec +1 -5
- data/test/helper.rb +2 -4
- metadata +7 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 672aa86401e879435a240660945075b8306ccf83e990d1447c3dbc787e66ba35
|
4
|
+
data.tar.gz: a887ae6ca318ca47fac726795b5e1fc59467d591206be8db02d0cb66732e7e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 463018c7bd09b525838a60d4c43716f8bcdc647fc84c9ece96ae1a754fa6f2735d633d23a832b6ffa73e6d6573c75632d3c233d3d46358030ca84fac56202e1f
|
7
|
+
data.tar.gz: 18698312332ac15319b2faf7451d82c3fe08c569f671ffef3bf7c5867b176067a4c1a54badf88811f9969fa1b49006d2ead55273c702f07159bf43c014ded700
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -3,4 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in model_tokenizer.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
6
|
+
group :test do
|
7
|
+
gem "bundler", "~> 1.7"
|
8
|
+
gem "rake", ">= 12.3.3"
|
9
|
+
gem "sqlite3", "< 1.4"
|
10
|
+
gem "minitest"
|
11
|
+
gem "coveralls"
|
12
|
+
end
|
13
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
model_tokenizer (1.0.2)
|
5
|
+
activerecord (~> 4.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (4.2.11.3)
|
11
|
+
activesupport (= 4.2.11.3)
|
12
|
+
builder (~> 3.1)
|
13
|
+
activerecord (4.2.11.3)
|
14
|
+
activemodel (= 4.2.11.3)
|
15
|
+
activesupport (= 4.2.11.3)
|
16
|
+
arel (~> 6.0)
|
17
|
+
activesupport (4.2.11.3)
|
18
|
+
i18n (~> 0.7)
|
19
|
+
minitest (~> 5.1)
|
20
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
21
|
+
tzinfo (~> 1.1)
|
22
|
+
arel (6.0.4)
|
23
|
+
builder (3.2.4)
|
24
|
+
concurrent-ruby (1.1.6)
|
25
|
+
coveralls (0.8.23)
|
26
|
+
json (>= 1.8, < 3)
|
27
|
+
simplecov (~> 0.16.1)
|
28
|
+
term-ansicolor (~> 1.3)
|
29
|
+
thor (>= 0.19.4, < 2.0)
|
30
|
+
tins (~> 1.6)
|
31
|
+
docile (1.3.2)
|
32
|
+
i18n (0.9.5)
|
33
|
+
concurrent-ruby (~> 1.0)
|
34
|
+
json (2.3.0)
|
35
|
+
minitest (5.14.1)
|
36
|
+
rake (13.0.1)
|
37
|
+
simplecov (0.16.1)
|
38
|
+
docile (~> 1.1)
|
39
|
+
json (>= 1.8, < 3)
|
40
|
+
simplecov-html (~> 0.10.0)
|
41
|
+
simplecov-html (0.10.2)
|
42
|
+
sqlite3 (1.3.13)
|
43
|
+
sync (0.5.0)
|
44
|
+
term-ansicolor (1.7.1)
|
45
|
+
tins (~> 1.0)
|
46
|
+
thor (1.0.1)
|
47
|
+
thread_safe (0.3.6)
|
48
|
+
tins (1.25.0)
|
49
|
+
sync
|
50
|
+
tzinfo (1.2.7)
|
51
|
+
thread_safe (~> 0.1)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
bundler (~> 1.7)
|
58
|
+
coveralls
|
59
|
+
minitest
|
60
|
+
model_tokenizer!
|
61
|
+
rake (>= 12.3.3)
|
62
|
+
sqlite3 (< 1.4)
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
1.17.2
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# ModelTokenizer
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/adibsaad/model_tokenizer.svg?branch=master)](https://travis-ci.org/adibsaad/model_tokenizer)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/adibsaad/model_tokenizer/badge.svg)](https://coveralls.io/r/adibsaad/model_tokenizer)
|
5
|
+
|
3
6
|
Generates random tokens that models can be accessed by. Instead of
|
4
7
|
|
5
8
|
```
|
@@ -30,33 +33,25 @@ Or install it yourself as:
|
|
30
33
|
|
31
34
|
## Usage
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
$ rails g model_tokenizer MODEL_NAME [field:type field:type ... ]
|
36
|
-
|
37
|
-
to create a new tokenized model. If the model already exists, ModelTokenizer will integrate into it by injecting the following code
|
38
|
-
|
39
|
-
```ruby
|
40
|
-
extend ModelTokenizer
|
41
|
-
has_token
|
42
|
-
```
|
43
|
-
|
44
|
-
The appropriate migration will also be created, which will create the ```token``` field and its associated unique index.
|
45
|
-
|
46
|
-
The default token length is 14, but you can change it (no lower than 8)
|
36
|
+
Run
|
47
37
|
|
48
|
-
|
49
|
-
has_token :length => 16
|
50
|
-
```
|
38
|
+
$ rails g model_tokenizer MODEL_NAME [field:type field:type ... ]
|
51
39
|
|
52
|
-
|
40
|
+
to create a new tokenized model. If the model already exists, ModelTokenizer will integrate into it by injecting the following code
|
53
41
|
|
54
|
-
|
42
|
+
```ruby
|
43
|
+
extend ModelTokenizer
|
44
|
+
has_token
|
55
45
|
self.primary_key = :token
|
56
|
-
|
46
|
+
```
|
47
|
+
|
48
|
+
The appropriate migration will also be created, which will create the ```token``` field and its associated unique index.
|
57
49
|
|
58
|
-
|
50
|
+
The default token length is 14, but you can change it (no lower than 8)
|
59
51
|
|
52
|
+
```ruby
|
53
|
+
has_token :length => 16
|
54
|
+
```
|
60
55
|
|
61
56
|
## Notes
|
62
57
|
|
data/model_tokenizer.gemspec
CHANGED
@@ -20,9 +20,5 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "activerecord", "~> 4.0"
|
26
|
-
spec.add_development_dependency "sqlite3"
|
27
|
-
spec.add_development_dependency "minitest"
|
23
|
+
spec.add_dependency("activerecord", "~> 4.0")
|
28
24
|
end
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_tokenizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adib Saad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.7'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: activerecord
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,41 +17,13 @@ dependencies:
|
|
45
17
|
- - "~>"
|
46
18
|
- !ruby/object:Gem::Version
|
47
19
|
version: '4.0'
|
48
|
-
type: :
|
20
|
+
type: :runtime
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
24
|
- - "~>"
|
53
25
|
- !ruby/object:Gem::Version
|
54
26
|
version: '4.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: sqlite3
|
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: minitest
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
27
|
description: |-
|
84
28
|
ModelTokenizer creates random tokens to be
|
85
29
|
used as primary keys for ActiveRecord objects
|
@@ -89,8 +33,11 @@ executables: []
|
|
89
33
|
extensions: []
|
90
34
|
extra_rdoc_files: []
|
91
35
|
files:
|
36
|
+
- ".coveralls.yml"
|
92
37
|
- ".gitignore"
|
38
|
+
- ".travis.yml"
|
93
39
|
- Gemfile
|
40
|
+
- Gemfile.lock
|
94
41
|
- LICENSE.txt
|
95
42
|
- README.md
|
96
43
|
- Rakefile
|
@@ -124,8 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
71
|
- !ruby/object:Gem::Version
|
125
72
|
version: '0'
|
126
73
|
requirements: []
|
127
|
-
|
128
|
-
rubygems_version: 2.2.2
|
74
|
+
rubygems_version: 3.0.3
|
129
75
|
signing_key:
|
130
76
|
specification_version: 4
|
131
77
|
summary: Random token generator for Rails models
|
@@ -134,4 +80,3 @@ test_files:
|
|
134
80
|
- test/helper.rb
|
135
81
|
- test/schema.rb
|
136
82
|
- test/token_generator_test.rb
|
137
|
-
has_rdoc:
|