alphadecimal 1.1.1 → 1.1.2
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.
- data/VERSION +1 -1
- data/alphadecimal.gemspec +3 -6
- data/lib/alphadecimal.rb +7 -3
- metadata +5 -16
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/alphadecimal.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{alphadecimal}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mike Mondragon", "Jack Danger Canty"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-21}
|
13
13
|
s.default_executable = %q{alphadecimal}
|
14
14
|
s.description = %q{Convert integers to base62 strings (A-Za-z0-9) and back. Ideal for url shorteners like Shawty-server.}
|
15
15
|
s.email = %q{rubygems@6brand.com}
|
@@ -34,11 +34,8 @@ Gem::Specification.new do |s|
|
|
34
34
|
]
|
35
35
|
s.homepage = %q{http://github.com/JackDanger/alphadecimal}
|
36
36
|
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = %q{1.
|
37
|
+
s.rubygems_version = %q{1.6.2}
|
38
38
|
s.summary = %q{Convert integers to base62 strings (A-Za-z0-9) and back. A handy way to shorten long numbers.}
|
39
|
-
s.test_files = [
|
40
|
-
"test/test_alphadecimal.rb"
|
41
|
-
]
|
42
39
|
|
43
40
|
if s.respond_to? :specification_version then
|
44
41
|
s.specification_version = 3
|
data/lib/alphadecimal.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
module Alphadecimal
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
def self.char(str)
|
5
|
+
str.respond_to?(:ord) ? str.ord : str[0]
|
6
|
+
end
|
7
|
+
|
8
|
+
B62_0, B62_9 = char('0'), char('9')
|
9
|
+
B62_A, B62_Z = char('A'), char('Z')
|
10
|
+
B62_a, B62_z = char('a'), char('z')
|
7
11
|
B62_CHRS = [(B62_0..B62_9).map{|i|i}, (B62_A..B62_Z).map{|i|i}, (B62_a..B62_z).map{|i|i}].flatten
|
8
12
|
|
9
13
|
module Number
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphadecimal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 17
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 1.1.1
|
5
|
+
version: 1.1.2
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Mike Mondragon
|
@@ -16,7 +11,7 @@ autorequire:
|
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date: 2011-
|
14
|
+
date: 2011-06-21 00:00:00 -07:00
|
20
15
|
default_executable: alphadecimal
|
21
16
|
dependencies: []
|
22
17
|
|
@@ -56,25 +51,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
51
|
requirements:
|
57
52
|
- - ">="
|
58
53
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 3
|
60
|
-
segments:
|
61
|
-
- 0
|
62
54
|
version: "0"
|
63
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
56
|
none: false
|
65
57
|
requirements:
|
66
58
|
- - ">="
|
67
59
|
- !ruby/object:Gem::Version
|
68
|
-
hash: 3
|
69
|
-
segments:
|
70
|
-
- 0
|
71
60
|
version: "0"
|
72
61
|
requirements: []
|
73
62
|
|
74
63
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.6.2
|
76
65
|
signing_key:
|
77
66
|
specification_version: 3
|
78
67
|
summary: Convert integers to base62 strings (A-Za-z0-9) and back. A handy way to shorten long numbers.
|
79
|
-
test_files:
|
80
|
-
|
68
|
+
test_files: []
|
69
|
+
|