base58 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ = 0.0.4
2
+ - Gracefully deals with bad input. Thanks to isnotvalid on Github.
3
+
1
4
  = 0.0.3
2
5
  - Removed accidental dependencies.
3
6
 
@@ -8,8 +8,9 @@ Paypal address: mailto:dougal.s@gmail.com
8
8
 
9
9
  === Install
10
10
 
11
- $ gem sources -a http://gems.github.com (you only have to do this once)
12
- $ sudo gem install dougal-base58
11
+ Base58 is hosted by http://gemcutter.com. Please make sure you have added them to your gem sources.
12
+
13
+ $ sudo gem install base58
13
14
 
14
15
  == Usage
15
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{base58}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Douglas F Shearer"]
12
- s.date = %q{2009-11-05}
12
+ s.date = %q{2009-11-27}
13
13
  s.description = %q{Base58 is a Ruby library for converting ints to and from base58.}
14
14
  s.email = %q{dougal.s@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -19,6 +19,7 @@ class Base58
19
19
 
20
20
  # Converts a base10 integer to a base58 string.
21
21
  def self.int_to_base58(int_val)
22
+ raise ArgumentError, 'Value passed is not an Integer.' unless int_val.is_a?(Integer)
22
23
  base58_val = ''
23
24
  while(int_val >= BASE)
24
25
  mod = int_val % BASE
@@ -515,4 +515,10 @@ EXAMPLES = { "6hKMCS" => 3471391110,
515
515
  assert_equal expected, Base58.base58_to_int(base_58)
516
516
  end
517
517
  end
518
+
519
+ def test_string_instead_of_int
520
+ e = assert_raise(ArgumentError) { Base58.int_to_base58('3470432637') }
521
+ assert_equal 'Value passed is not an Integer.', e.message
522
+ end
523
+
518
524
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base58
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas F Shearer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-05 00:00:00 +00:00
12
+ date: 2009-11-27 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15