uidable 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dee70eb35564fd780f641e2a9115f8e93851d1e2
4
- data.tar.gz: 4c2dc3aa926723131645c95a86909e6bed395184
3
+ metadata.gz: 55c85898f6d9f3b6b321e43eea4ef730ca495db7
4
+ data.tar.gz: b453dbc73825a18c60a66d2e07a2eded6dd1318a
5
5
  SHA512:
6
- metadata.gz: 1f960b5949fc9d7381802785aedc773be9e38964b0d1db29b1ec2064594d8450feb4223eff730ad243bca57c23f3ed32c967f82952c8d3270da79e1077ba38a3
7
- data.tar.gz: 4de55c217b0f8cdd64a813382092df1f585b4a5756b9d12389091a5de643fd82f6127f500d20587f3c98c67bf36ee85301fb6cef08cbbe36f8164e84100310d5
6
+ metadata.gz: b9198359b1bfbe61c16f2a18d86fe0b6f818003f9a05a5aac423e4f4cd3acdc64095a96ea40915966c4749b98742c97272a820d1009e2e84a4543997f8712ac3
7
+ data.tar.gz: 36f8c7a8b82b35694807e5946a4aad5f4745e34165d227a167bc3dbe193a2eb11514b054004e0372a8b46264b96b4a9c49741ac339f1cc0dbb0013492d9282dd
data/.travis.yml CHANGED
@@ -1,3 +1,14 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.2.3
4
+ - 2.2.2
3
5
  - 2.1.6
6
+ - 2.1.4
7
+ - 2.1.3
8
+ before_install:
9
+ - gem install bundler -v '>= 1.9.0'
10
+ script: "ruby ./test/test_all.rb"
11
+ branches:
12
+ only:
13
+ - build
14
+ - cover-check
data/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Uidable
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/uidable.svg)][gem]
4
+ [![Build Status](https://travis-ci.org/sibevin/uidable.svg?branch=build)][travis]
5
+ [![Coverage Status](https://coveralls.io/repos/sibevin/uidable/badge.svg?branch=cover-check&service=github)][coveralls]
6
+
7
+ [gem]: https://rubygems.org/gems/uidable
8
+ [travis]: https://travis-ci.org/sibevin/uidable
9
+ [coveralls]: https://coveralls.io/github/sibevin/uidable?branch=cover-check
10
+
3
11
  Create the uid(unqiue identifier) attribute in your model or class.
4
12
 
5
13
  ## Installation
@@ -85,7 +93,7 @@ The uid is read only by default. You can disabled it with `read_only: false`.
85
93
  ### Uniqueness and Presence Validation
86
94
 
87
95
  The uniqueness and presence validation is enabled by default. You can disable them with `uniqueness: false` and `presence: false`. Note that you should change your migration as well if needed.
88
- 
96
+
89
97
  ### Set to_param
90
98
 
91
99
  If the option `set_to_param: true` is given, the `to_param` is overrided with uid and it means you can use uid in your routes path.
@@ -96,14 +104,14 @@ If the option `scope: true` is given, a scope `with_uid` is created and you can
96
104
 
97
105
  ## Redefine Uid Generation
98
106
 
99
- You override `gen_uid` method in your class/model if you want to generate your own uid. Here is an example:
107
+ You can override `gen_uid` method in your class/model if you want to generate your own uid. Here is an example:
100
108
 
101
109
  require `random_token`
102
110
 
103
111
  class MyModel < ActiveRecord::Base
104
112
  include Uidable
105
113
  uidable
106
- 
114
+
107
115
  private
108
116
 
109
117
  def gen_uid
data/lib/uidable.rb CHANGED
@@ -54,7 +54,7 @@ module Uidable
54
54
  end
55
55
 
56
56
  def gen_uid
57
- Array.new(#{uid_size}){[*'a'..'b', *'0'..'9'].sample}.join
57
+ Array.new(#{uid_size}){[*'a'..'z', *'0'..'9'].sample}.join
58
58
  end
59
59
  RUBY
60
60
  include mod
@@ -1,3 +1,3 @@
1
1
  module Uidable
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uidable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sibevin Wang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.4.2
82
+ rubygems_version: 2.4.6
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Create the uid attribute in your model or class.