micro_token 0.0.2 → 0.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: 344e232941e019cafdbe2fdb47cd6c0a587b64a1
4
- data.tar.gz: b2bc64c84ecee92c11d48b1f38a896a2992a149a
3
+ metadata.gz: 09c41a2a78efc178460945e450516498f9b0cd60
4
+ data.tar.gz: ad169551a394ba2b1ba30788fe99a7d97416fece
5
5
  SHA512:
6
- metadata.gz: c296227b6658ed366140097cbf72d766fe293a641cd8f42a4688194223aa8d729fa466e8fbb53602154601aa461ddf3cf7ea5faea18428b29314047cc181e103
7
- data.tar.gz: 670fd4f827010631d2764509e4dc0645bb60514022375029147216071b6d2778c07938a3d40d5d40335253b0c342d067e329b03bb8d96d4cb29830131dd9cb4e
6
+ metadata.gz: f34e869b6dc26d951167544d1b8209f6971f2fb7a29763fca2b4c2c2e46d58b844785a3343d9740b0530bc213c5250148667ec7dc74ad09e642084fd297a5ecc
7
+ data.tar.gz: 8a73ae42572bf09023cee5215dd2ce529d93a4cc821f1a114898e190373d4f40e4e0bd4fe8bb1694a9f80ae0f36185bb6ccb321e4835ddc4d011d6b358815a7c
@@ -1,3 +1,3 @@
1
1
  module MicroToken
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_token
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Harton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-05 00:00:00.000000000 Z
11
+ date: 2013-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,6 @@ files:
67
67
  - Rakefile
68
68
  - lib/micro_token.rb
69
69
  - lib/micro_token/version.rb
70
- - lib/token.rb
71
70
  - micro_token.gemspec
72
71
  - spec/lib/micro_token_spec.rb
73
72
  homepage: https://github.com/jamesotron/micro_token
@@ -90,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
89
  version: '0'
91
90
  requirements: []
92
91
  rubyforge_project:
93
- rubygems_version: 2.0.0
92
+ rubygems_version: 2.0.3
94
93
  signing_key:
95
94
  specification_version: 4
96
95
  summary: A tiny random token generator
data/lib/token.rb DELETED
@@ -1,29 +0,0 @@
1
- require 'securerandom'
2
-
3
- class Token
4
- ALPHA_CHARS = ('a'..'z').to_a + ('A'..'Z').to_a
5
-
6
- def self.generate(length=8,format=:alphanumeric)
7
- (1..length).collect { self.send("_generate_#{format}_char") }.join
8
- end
9
-
10
- private
11
-
12
- def self._generate_alphanumeric_char
13
- (i = rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr
14
- end
15
-
16
- def self._generate_numeric_char
17
- rand(9)
18
- end
19
-
20
- def self._generate_alpha_char
21
- ALPHA_CHARS[rand(ALPHA_CHARS.size)]
22
- end
23
-
24
- private
25
-
26
- def rand(n)
27
- SecureRandom.random_number(n)
28
- end
29
- end