tracking_number 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +20 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +33 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/tracking_number.rb +172 -0
- data/test/test_helper.rb +18 -0
- data/test/test_tracking_number.rb +61 -0
- data/tracking_number.gemspec +64 -0
- metadata +132 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.2"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
git (1.2.5)
|
5
|
+
jeweler (1.5.2)
|
6
|
+
bundler (~> 1.0.0)
|
7
|
+
git (>= 1.2.5)
|
8
|
+
rake
|
9
|
+
rake (0.8.7)
|
10
|
+
rcov (0.9.9)
|
11
|
+
shoulda (2.11.3)
|
12
|
+
|
13
|
+
PLATFORMS
|
14
|
+
ruby
|
15
|
+
|
16
|
+
DEPENDENCIES
|
17
|
+
bundler (~> 1.0.0)
|
18
|
+
jeweler (~> 1.5.2)
|
19
|
+
rcov
|
20
|
+
shoulda
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Jeff Keen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
= tracking_number
|
2
|
+
|
3
|
+
Identifies valid tracking numbers and the service they're associated with.
|
4
|
+
|
5
|
+
t = TrackingNumber.new("MYSTERY_TRACKING_NUMBER")
|
6
|
+
t.valid? #=> false
|
7
|
+
t.carrier #=> :unknown
|
8
|
+
|
9
|
+
t = TrackingNumber.new("1Z879E930346834440")
|
10
|
+
t.valid? #=> true
|
11
|
+
t.carrier #=> :ups
|
12
|
+
|
13
|
+
Also can take a block of text and find all the valid tracking numbers within it
|
14
|
+
|
15
|
+
TrackingNumber.search("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 1Z879E930346834440 nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute 9611020987654312345672 dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
|
16
|
+
|
17
|
+
#=> [TrackingNumber, TrackingNumber]
|
18
|
+
|
19
|
+
== Contributing to tracking_number
|
20
|
+
|
21
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
22
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
23
|
+
* Fork the project
|
24
|
+
* Start a feature/bugfix branch
|
25
|
+
* Commit and push until you are happy with your contribution
|
26
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
27
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
28
|
+
|
29
|
+
== Copyright
|
30
|
+
|
31
|
+
Copyright (c) 2010 Jeff Keen. See LICENSE.txt for
|
32
|
+
further details.
|
33
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "tracking_number"
|
16
|
+
gem.homepage = "http://github.com/jkeen/tracking_number"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{Identifies valid tracking numbers}
|
19
|
+
gem.description = %Q{Match tracking numbers to a service, and search blocks of text and pull out valid tracking numbers.}
|
20
|
+
gem.email = "jeff@keen.me"
|
21
|
+
gem.authors = ["Jeff Keen"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
Rake::TestTask.new(:test) do |test|
|
31
|
+
test.libs << 'lib' << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
require 'rcov/rcovtask'
|
37
|
+
Rcov::RcovTask.new do |test|
|
38
|
+
test.libs << 'test'
|
39
|
+
test.pattern = 'test/**/test_*.rb'
|
40
|
+
test.verbose = true
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "tracking_number #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,172 @@
|
|
1
|
+
# Identify if tracking numbers are valid, and which service they belong to
|
2
|
+
|
3
|
+
# Information on validating tracking numbers found here:
|
4
|
+
# http://answers.google.com/answers/threadview/id/207899.html
|
5
|
+
|
6
|
+
class TrackingNumber
|
7
|
+
SEARCH_PATTERNS = {
|
8
|
+
:ups => /\b1Z\w{16,16}\b/,
|
9
|
+
:fedex_express => /\b[0-9]{12,12}\b/,
|
10
|
+
:fedex_ground_96 => /\b96[0-9]{20,20}\b/,
|
11
|
+
:fedex_ground_sscc18 => /\b[0-9]{18,18}\b/,
|
12
|
+
:dhl => /\b[0-9]{11,11}\b/,
|
13
|
+
:usps => /\b[0-9]{22,22}\b/
|
14
|
+
}
|
15
|
+
|
16
|
+
VERIFY_PATTERNS = {
|
17
|
+
:ups => /^1Z(\w{15,15})(\w)$/,
|
18
|
+
:fedex_express => /^([0-9]{11,11})([0-9])$/,
|
19
|
+
:fedex_ground_96 => /^96[0-9]{5,5}([0-9]{14,14})([0-9])$/,
|
20
|
+
:fedex_ground_sscc18 => /^[0-9]{2,2}([0-9]{15,15})([0-9])$/,
|
21
|
+
:dhl => /^([0-9]{10,10})([0-9])$/,
|
22
|
+
:usps => /^([0-9]{21,21})([0-9])/
|
23
|
+
}
|
24
|
+
|
25
|
+
def self.search(body)
|
26
|
+
possibles = SEARCH_PATTERNS.values.collect { |pattern|
|
27
|
+
body.scan(pattern)
|
28
|
+
}.uniq.flatten
|
29
|
+
|
30
|
+
possibles.collect { |possible| TrackingNumber.new(possible) }.select { |t| t.valid? }
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(tracking_number)
|
34
|
+
@tracking_number = tracking_number.to_s.upcase.gsub(/\s/,"")
|
35
|
+
end
|
36
|
+
|
37
|
+
def valid?
|
38
|
+
carrier != :unknown
|
39
|
+
end
|
40
|
+
|
41
|
+
def carrier
|
42
|
+
@carrier = if ups?(@tracking_number)
|
43
|
+
:ups
|
44
|
+
elsif fedex_express?(@tracking_number)
|
45
|
+
:fedex
|
46
|
+
elsif fedex_ground_96?(@tracking_number)
|
47
|
+
:fedex
|
48
|
+
elsif fedex_ground_sscc18?(@tracking_number)
|
49
|
+
:fedex
|
50
|
+
elsif usps?(@tracking_number)
|
51
|
+
:usps
|
52
|
+
elsif dhl?(@tracking_number)
|
53
|
+
:dhl
|
54
|
+
else
|
55
|
+
:unknown
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def tracking_number
|
60
|
+
@tracking_number
|
61
|
+
end
|
62
|
+
|
63
|
+
def to_s
|
64
|
+
@tracking_number
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def ups?(tracking_number)
|
70
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:ups])
|
71
|
+
return false if results.nil? || results.empty?
|
72
|
+
|
73
|
+
sequence, check_digit = results.flatten
|
74
|
+
total = 0
|
75
|
+
sequence.chars.each_with_index do |c, i|
|
76
|
+
x = if c[/[0-9]/] # numeric
|
77
|
+
c.to_i
|
78
|
+
else
|
79
|
+
(c[0].ord - 3) % 10
|
80
|
+
end
|
81
|
+
x *= 2 if i.odd?
|
82
|
+
total += x
|
83
|
+
end
|
84
|
+
|
85
|
+
check = (total % 10)
|
86
|
+
check = (10 - check) unless (check.zero?)
|
87
|
+
|
88
|
+
return true if (check.to_i == check_digit.to_i)
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
def fedex_express?(tracking_number)
|
93
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:fedex_express]).flatten
|
94
|
+
return false if results.nil? || results.empty?
|
95
|
+
sequence, check = results
|
96
|
+
|
97
|
+
sequence = sequence.chars.to_a.map(&:to_i)
|
98
|
+
total = 0
|
99
|
+
sequence.zip([3,1,7,3,1,7,3,1,7,3,1]).collect { |pair| pair[0] * pair[1] }.each { |t| total += t.to_i }
|
100
|
+
return true if (total % 11) == check.to_i
|
101
|
+
end
|
102
|
+
|
103
|
+
def fedex_ground_96?(tracking_number)
|
104
|
+
# 22 numbers
|
105
|
+
# http://fedex.com/us/solutions/ppe/FedEx_Ground_Label_Layout_Specification.pdf
|
106
|
+
# 96 - UCC/EAN Application Identifier
|
107
|
+
# [0-9]{2,2} - SCNC
|
108
|
+
# [0-9]{3,3} - Class Of Service
|
109
|
+
|
110
|
+
# [0-9]{7,7} - RPS Shipper ID (used in calculation)
|
111
|
+
# [0-9]{7,7} - Package Number (used in calculation)
|
112
|
+
|
113
|
+
# [0-9] - Check Digit
|
114
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:fedex_ground_96]).flatten
|
115
|
+
return false if results.nil? || results.empty?
|
116
|
+
|
117
|
+
sequence, check_digit = results.flatten
|
118
|
+
total = 0
|
119
|
+
sequence.chars.to_a.reverse.map(&:to_i).each_with_index do |x, i|
|
120
|
+
x *= 3 if i.even?
|
121
|
+
total += x
|
122
|
+
end
|
123
|
+
check = total % 10
|
124
|
+
check = (10 - check) unless (check.zero?)
|
125
|
+
return true if check == check_digit.to_i
|
126
|
+
end
|
127
|
+
|
128
|
+
def fedex_ground_sscc18?(tracking_number)
|
129
|
+
# [0-9]{2,2} - Not used
|
130
|
+
# [0-9]{15, 15} - used for calculation
|
131
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:fedex_ground_sscc18]).flatten
|
132
|
+
return false if results.nil? || results.empty?
|
133
|
+
sequence, check_digit = results
|
134
|
+
total = 0
|
135
|
+
sequence.chars.to_a.map(&:to_i).reverse.each_with_index do |x, i|
|
136
|
+
x *= 3 if i.even?
|
137
|
+
total += x
|
138
|
+
end
|
139
|
+
|
140
|
+
check = total % 10
|
141
|
+
check = (10 - check) unless (check.zero?)
|
142
|
+
return true if check == check_digit.to_i
|
143
|
+
end
|
144
|
+
|
145
|
+
def dhl?(tracking_number)
|
146
|
+
# standard mod 7 check
|
147
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:dhl]).flatten
|
148
|
+
return false if results.nil? || results.empty?
|
149
|
+
|
150
|
+
sequence, check_digit = results
|
151
|
+
return true if sequence.to_i % 7 == check_digit.to_i
|
152
|
+
end
|
153
|
+
|
154
|
+
def usps?(tracking_number)
|
155
|
+
# standard mod 10 check
|
156
|
+
results = tracking_number.scan(VERIFY_PATTERNS[:usps]).flatten
|
157
|
+
return false if results.nil? || results.empty?
|
158
|
+
|
159
|
+
sequence, check_digit = results
|
160
|
+
total = 0
|
161
|
+
sequence.chars.to_a.reverse.each_with_index do |c, i|
|
162
|
+
x = c.to_i
|
163
|
+
x *= 3 if i.even?
|
164
|
+
|
165
|
+
total += x
|
166
|
+
end
|
167
|
+
|
168
|
+
check = total % 10
|
169
|
+
check = 10 - check unless (check.zero?)
|
170
|
+
return true if check == check_digit.to_i
|
171
|
+
end
|
172
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'tracking_number'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TrackingNumberTest < Test::Unit::TestCase
|
4
|
+
should "return ups with valid ups number" do
|
5
|
+
assert_equal :ups, TrackingNumber.new("1Z5R89390357567127").carrier
|
6
|
+
assert_equal :ups, TrackingNumber.new("1Z879E930346834440").carrier
|
7
|
+
assert_equal :ups, TrackingNumber.new("1Z410E7W0392751591").carrier
|
8
|
+
assert_equal :ups, TrackingNumber.new("1Z8V92A70367203024").carrier
|
9
|
+
end
|
10
|
+
|
11
|
+
should "return fedex with valid fedex express number" do
|
12
|
+
t = TrackingNumber.new("986578788855")
|
13
|
+
assert_equal :fedex, t.carrier
|
14
|
+
assert t.valid?
|
15
|
+
|
16
|
+
t = TrackingNumber.new("477179081230")
|
17
|
+
assert_equal :fedex, t.carrier
|
18
|
+
assert t.valid?
|
19
|
+
end
|
20
|
+
|
21
|
+
should "return fedex with valid fedex ground (96) number" do
|
22
|
+
t = TrackingNumber.new("9611020987654312345672")
|
23
|
+
assert_equal :fedex, t.carrier
|
24
|
+
assert t.valid?
|
25
|
+
end
|
26
|
+
|
27
|
+
should "return fedex with valid fedex ground (SSCC18) number" do
|
28
|
+
t = TrackingNumber.new("000123450000000027")
|
29
|
+
assert_equal :fedex, t.carrier
|
30
|
+
assert t.valid?
|
31
|
+
end
|
32
|
+
|
33
|
+
should "return dhl with valid dhl number" do
|
34
|
+
t = TrackingNumber.new("73891051146")
|
35
|
+
assert_equal :dhl, t.carrier
|
36
|
+
assert t.valid?
|
37
|
+
end
|
38
|
+
|
39
|
+
should "return usps with valid usps number" do
|
40
|
+
t = TrackingNumber.new("9101 1234 5678 9000 0000 13")
|
41
|
+
assert_equal :usps, t.carrier
|
42
|
+
assert t.valid?
|
43
|
+
end
|
44
|
+
|
45
|
+
should "return unknown when given invalid number" do
|
46
|
+
t = TrackingNumber.new("101")
|
47
|
+
assert_equal :unknown, t.carrier
|
48
|
+
assert !t.valid?
|
49
|
+
end
|
50
|
+
|
51
|
+
should "upcase and remove spaces from tracking number" do
|
52
|
+
t = TrackingNumber.new("abc 123 def")
|
53
|
+
assert_equal "ABC123DEF", t.tracking_number
|
54
|
+
end
|
55
|
+
|
56
|
+
should "return two tracking numbers when given test search string" do
|
57
|
+
s = TrackingNumber.search("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 1Z879E930346834440 nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute 9611020987654312345672 dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
|
58
|
+
|
59
|
+
assert_equal 2, s.size
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{tracking_number}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Jeff Keen"]
|
12
|
+
s.date = %q{2010-12-30}
|
13
|
+
s.description = %q{Match tracking numbers to a service, and search blocks of text and pull out valid tracking numbers.}
|
14
|
+
s.email = %q{jeff@keen.me}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/tracking_number.rb",
|
28
|
+
"test/test_helper.rb",
|
29
|
+
"test/test_tracking_number.rb",
|
30
|
+
"tracking_number.gemspec"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/jkeen/tracking_number}
|
33
|
+
s.licenses = ["MIT"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.7}
|
36
|
+
s.summary = %q{Identifies valid tracking numbers}
|
37
|
+
s.test_files = [
|
38
|
+
"test/test_helper.rb",
|
39
|
+
"test/test_tracking_number.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
49
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
50
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
55
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
59
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
60
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
61
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tracking_number
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Jeff Keen
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-12-30 00:00:00 -06:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: shoulda
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :development
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 1
|
42
|
+
- 0
|
43
|
+
- 0
|
44
|
+
version: 1.0.0
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: jeweler
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 5
|
58
|
+
- 2
|
59
|
+
version: 1.5.2
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rcov
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
version: "0"
|
73
|
+
type: :development
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: *id004
|
76
|
+
description: Match tracking numbers to a service, and search blocks of text and pull out valid tracking numbers.
|
77
|
+
email: jeff@keen.me
|
78
|
+
executables: []
|
79
|
+
|
80
|
+
extensions: []
|
81
|
+
|
82
|
+
extra_rdoc_files:
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.rdoc
|
85
|
+
files:
|
86
|
+
- .document
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
- LICENSE.txt
|
90
|
+
- README.rdoc
|
91
|
+
- Rakefile
|
92
|
+
- VERSION
|
93
|
+
- lib/tracking_number.rb
|
94
|
+
- test/test_helper.rb
|
95
|
+
- test/test_tracking_number.rb
|
96
|
+
- tracking_number.gemspec
|
97
|
+
has_rdoc: true
|
98
|
+
homepage: http://github.com/jkeen/tracking_number
|
99
|
+
licenses:
|
100
|
+
- MIT
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 2711137712783242213
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
version: "0"
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
requirements: []
|
124
|
+
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 1.3.7
|
127
|
+
signing_key:
|
128
|
+
specification_version: 3
|
129
|
+
summary: Identifies valid tracking numbers
|
130
|
+
test_files:
|
131
|
+
- test/test_helper.rb
|
132
|
+
- test/test_tracking_number.rb
|