prettyid 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/LICENSE +21 -0
- data/README.md +11 -1
- data/lib/pretty_id.rb +4 -0
- data/lib/pretty_id/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0621c31030006467b9af257e9c679723d3375a6c6b21ca6b366174ec1ded4045
|
4
|
+
data.tar.gz: aac1f8629e0a906bde5b57a8c2c36a6f4132bc4b6ab5e7152449110e254b6dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd710ffb92b1d23cb243e2a7b059ba7bdb30503b7beb47fc66e65faec649399950706bba1a09c4d19683ce53870c59bc8b7cbc5d85444abe7215e27236fc46f
|
7
|
+
data.tar.gz: 343367e6e582c809ed7ee31ef6ad166057a1eb99034266f65dd61d0e98063175ff7a93773657baca860454555e5caf13e31e5df95eb1757486fa5a903b311e11
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Pavel Gabriel
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/alovak/pretty_id.svg?branch=master)](https://travis-ci.org/alovak/pretty_id)
|
2
|
+
|
1
3
|
# PrettyId
|
2
4
|
|
3
5
|
How does Stripe generate object ids?
|
@@ -7,7 +9,13 @@ How does Stripe generate object ids?
|
|
7
9
|
|
8
10
|
[source](https://www.quora.com/How-does-Stripe-generate-object-ids)
|
9
11
|
|
10
|
-
With PrettyId you can generate Stripe-like IDs for your ActiveRecord models
|
12
|
+
With PrettyId you can generate Stripe-like IDs for your ActiveRecord models:
|
13
|
+
|
14
|
+
```
|
15
|
+
charge.id #=> ch_xxx
|
16
|
+
user.id #=> usr_xxx
|
17
|
+
transaction.id #=> txn_xxx
|
18
|
+
```
|
11
19
|
|
12
20
|
## Usage
|
13
21
|
|
@@ -65,6 +73,8 @@ account.id #=> acc_test_....
|
|
65
73
|
|
66
74
|
## Installation
|
67
75
|
|
76
|
+
**Note** There is another gem called 'pretty_id' so I had to rename mine into prettyid. So, be careful when you install gem and require it. It's a kind'a trick you do with 'activerecord' as well ;)
|
77
|
+
|
68
78
|
Add this line to your application's Gemfile:
|
69
79
|
|
70
80
|
```ruby
|
data/lib/pretty_id.rb
CHANGED
data/lib/pretty_id/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prettyid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Gabriel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- ".travis.yml"
|
107
107
|
- Gemfile
|
108
108
|
- Gemfile.lock
|
109
|
+
- LICENSE
|
109
110
|
- README.md
|
110
111
|
- Rakefile
|
111
112
|
- bin/console
|