san 1.2.0 → 1.3.0

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.
Files changed (3) hide show
  1. data/lib/san.rb +2 -2
  2. data/spec/san_spec.rb +1 -0
  3. metadata +6 -4
data/lib/san.rb CHANGED
@@ -4,7 +4,7 @@ class SAN
4
4
 
5
5
  class Version #:nodoc:
6
6
  Major = 1
7
- Minor = 2
7
+ Minor = 3
8
8
  Tiny = 0
9
9
 
10
10
  String = [Major, Minor, Tiny].join('.')
@@ -26,7 +26,7 @@ class SAN
26
26
  #
27
27
  def to_us_gln
28
28
  return nil unless valid?
29
- "079999#{@number}"
29
+ EAN13.complete("079999#{@number[0,6]}")
30
30
  end
31
31
 
32
32
  # convert this SAN into a UK based Global Location Number.
@@ -29,6 +29,7 @@ describe "The SAN class" do
29
29
  it "should correctly convert to a US based GLN" do
30
30
  # valid
31
31
  SAN.new("9013725").to_us_gln.should eql("0799999013725")
32
+ SAN.new("9029761").to_us_gln.should eql("0799999029764")
32
33
 
33
34
  # invalid
34
35
  SAN.new("9013724").to_us_gln.should be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: san
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Healy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-25 00:00:00 +11:00
12
+ date: 2009-09-16 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -37,6 +37,8 @@ files:
37
37
  - CHANGELOG
38
38
  has_rdoc: true
39
39
  homepage: http://github.com/yob/san/tree/master
40
+ licenses: []
41
+
40
42
  post_install_message:
41
43
  rdoc_options:
42
44
  - --title
@@ -59,9 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
61
  requirements: []
60
62
 
61
63
  rubyforge_project: san
62
- rubygems_version: 1.3.1
64
+ rubygems_version: 1.3.5
63
65
  signing_key:
64
- specification_version: 2
66
+ specification_version: 3
65
67
  summary: a (very) small library for working with Standard Address Numbers.
66
68
  test_files:
67
69
  - spec/san_spec.rb