base62 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ == 0.1.3 2010-11-24
2
+
3
+ * Cleaned out the crap that's not needed like hoe and rake tasks and newgem stuff
4
+
5
+ == 0.1.2 2010-11-24
6
+
7
+ * Derrick Camerino added a Gemspec
8
+
1
9
  == 0.1.1 2009-11-4
2
10
 
3
11
  * Ruby 1.9 compatible thx to Saadiq Rodgers-King
@@ -1,7 +1,3 @@
1
- = base62
2
-
3
- * http://geekjacking.com/base62_gem
4
-
5
1
  == DESCRIPTION:
6
2
 
7
3
  Base62 monkeypatches Integer to add an Integer#base62_encode instance method to encode an integer in the character set of 0-9 + A-Z + a-z. It also monkeypatches String to add String#base62_decode to take the string and turn it back into a valid integer.
@@ -10,10 +6,20 @@ Base62 monkeypatches Integer to add an Integer#base62_encode instance method to
10
6
 
11
7
  * sudo gem install base62
12
8
 
9
+ == USAGE:
10
+
11
+ require 'base62'
12
+
13
+ 123.base62_encode
14
+ => "1z"
15
+
16
+ "funky".base62_decode
17
+ => 619367412
18
+
13
19
  == THANKS:
14
20
 
15
21
  * Saadiq Rodgers-King (http://github.com/saadiq) for making it work with Ruby 1.9.
16
- * Derrick Camerino (https://github.com/robustdj) for adding a Gemspec.
22
+ * Derrick Camerino (https://github.com/robustdj) for adding a Gemspec and prompting me to clean stuff up.
17
23
 
18
24
  == LICENSE:
19
25
 
data/README.txt CHANGED
@@ -1,7 +1,3 @@
1
- = base62
2
-
3
- * http://geekjacking.com/base62_gem
4
-
5
1
  == DESCRIPTION:
6
2
 
7
3
  Base62 monkeypatches Integer to add an Integer#base62_encode instance method to encode an integer in the character set of 0-9 + A-Z + a-z. It also monkeypatches String to add String#base62_decode to take the string and turn it back into a valid integer.
@@ -10,10 +6,20 @@ Base62 monkeypatches Integer to add an Integer#base62_encode instance method to
10
6
 
11
7
  * sudo gem install base62
12
8
 
9
+ == USAGE:
10
+
11
+ require 'base62'
12
+
13
+ 123.base62_encode
14
+ => "1z"
15
+
16
+ "funky".base62_decode
17
+ => 619367412
18
+
13
19
  == THANKS:
14
20
 
15
21
  * Saadiq Rodgers-King (http://github.com/saadiq) for making it work with Ruby 1.9.
16
- * Derrick Camerino (https://github.com/robustdj) for adding a Gemspec.
22
+ * Derrick Camerino (https://github.com/robustdj) for adding a Gemspec and prompting me to clean stuff up.
17
23
 
18
24
  == LICENSE:
19
25
 
@@ -83,6 +83,7 @@ class Integer
83
83
  BASE62_PRIMITIVES = (0..9).collect { |i| i.to_s } + ('A'..'Z').to_a + ('a'..'z').to_a
84
84
 
85
85
  def base62_encode
86
+ return "0" if self == 0
86
87
  number = self
87
88
  result = ''
88
89
  while(number != 0)
@@ -1,7 +1,7 @@
1
1
  module Base62
2
2
  MAJOR = 0
3
3
  MINOR = 1
4
- TINY = 1
4
+ TINY = 4
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join('.')
7
7
  end
@@ -8,4 +8,10 @@ class TestBase62 < Test::Unit::TestCase
8
8
  end
9
9
  end
10
10
 
11
+ def test_0
12
+ assert_equal(0, "0".base62_decode)
13
+ assert_equal("0", 0.base62_encode)
14
+ assert_equal(0, "".base62_decode)
15
+ end
16
+
11
17
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base62
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - JT Zemp
@@ -23,11 +23,11 @@ dependencies: []
23
23
 
24
24
  description: |-
25
25
  Base62 monkeypatches Integer to add an Integer#base62_encode
26
- instance method to encode an integer in the character set of
27
- 0-9 + A-Z + a-z. It also monkeypatches String to add
28
- String#base62_decode to take the string and turn it back
29
- into a valid integer.
30
- email: jtzemp's email
26
+ instance method to encode an integer in the character set of
27
+ 0-9 + A-Z + a-z. It also monkeypatches String to add
28
+ String#base62_decode to take the string and turn it back
29
+ into a valid integer.
30
+ email: jtzemp@gmail.com
31
31
  executables: []
32
32
 
33
33
  extensions: []
@@ -36,9 +36,6 @@ extra_rdoc_files: []
36
36
 
37
37
  files:
38
38
  - History.txt
39
- - Manifest.txt
40
- - PostInstall.txt
41
- - Rakefile
42
39
  - README.rdoc
43
40
  - README.txt
44
41
  - lib/base62/version.rb
@@ -46,9 +43,9 @@ files:
46
43
  - test/test_base62.rb
47
44
  - test/test_helper.rb
48
45
  has_rdoc: true
49
- homepage: http://base62.rubyforge.org/
50
- licenses: []
51
-
46
+ homepage: http://github.com/jtzemp/base62
47
+ licenses:
48
+ - MIT
52
49
  post_install_message:
53
50
  rdoc_options: []
54
51
 
@@ -1,25 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- README.txt
6
- Rakefile
7
- config/hoe.rb
8
- config/requirements.rb
9
- lib/base62.rb
10
- lib/base62/version.rb
11
- script/console
12
- script/destroy
13
- script/generate
14
- script/txt2html
15
- setup.rb
16
- tasks/deployment.rake
17
- tasks/environment.rake
18
- tasks/website.rake
19
- test/test_base62.rb
20
- test/test_helper.rb
21
- website/index.html
22
- website/index.txt
23
- website/javascripts/rounded_corners_lite.inc.js
24
- website/stylesheets/screen.css
25
- website/template.html.erb
@@ -1,3 +0,0 @@
1
-
2
- For more information on base62, see http://geekjacking.com/base62_gem or http://base62.rubyforge.org
3
-
data/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
3
-
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }