open-ship 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.1.4. made 0 on company prefix not required.
1
2
  v0.1.3. fixed bug in the sscc check digit
2
3
  v0.1.2. added classes for sorting shipments
3
4
  v0.1.1. changed base filenames for less painful requires
@@ -3,16 +3,13 @@ module OpenShip
3
3
  class Sscc
4
4
 
5
5
  @company_prefix
6
- @extension_digit = "1"
6
+ @extension_digit = "0"
7
7
 
8
8
  def self.company_prefix
9
9
  @company_prefix
10
10
  end
11
11
 
12
12
  def self.company_prefix=(prefix)
13
- if !prefix.start_with? "0"
14
- raise "Company prefix should have a leading zero."
15
- end
16
13
  @company_prefix=prefix
17
14
  end
18
15
 
data/open-ship.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{open-ship}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Nathan Smith"]
@@ -112,9 +112,9 @@ require 'spec_helper'
112
112
  population = []
113
113
  boxes_to_stores = {}
114
114
  i = 0
115
- 4.times {
115
+ 2.times {
116
116
  boxes_to_stores[i.to_s] = []
117
- 20.times {
117
+ 10.times {
118
118
  box = OpenShip::Box.new
119
119
  box.length = ((rand * 9) + 1).to_i
120
120
  box.width = ((rand * 19) + 1).to_i
@@ -125,7 +125,7 @@ require 'spec_helper'
125
125
  }
126
126
  ship = OpenShip::Shipment.new(:logger => log)
127
127
  ship.boxes_to_stores = boxes_to_stores
128
- best_fit = ship.run_ga(5, 10)
128
+ best_fit = ship.run_ga(3, 3)
129
129
 
130
130
  best_fit.cartons_to_stores.each { |k, v|
131
131
  puts "Test"
@@ -3,8 +3,8 @@ require 'spec_helper'
3
3
  describe OpenShip::Sscc do
4
4
 
5
5
  it "Should persist a company prefix on the model" do
6
- OpenShip::Sscc.company_prefix = "0801234"
7
- OpenShip::Sscc.company_prefix.should == "0801234"
6
+ OpenShip::Sscc.company_prefix = "8012345"
7
+ OpenShip::Sscc.company_prefix.should == "8012345"
8
8
  end
9
9
 
10
10
  it "should generate a valid check digit for a given sscc id" do
@@ -23,7 +23,7 @@ describe OpenShip::Sscc do
23
23
  serial_reference = "192837465"
24
24
  OpenShip::Sscc.company_prefix = company_prefix
25
25
  sscc = OpenShip::Sscc.generate_sscc_id(serial_reference)
26
- sscc.should == "106141411928374657"
26
+ sscc.should == "006141411928374650"
27
27
  end
28
28
 
29
29
  it "should fill in leading zeros in serial_reference if serial_reference + company_prefix + extension_digit adds up to less than 17" do
@@ -1,8 +1,8 @@
1
1
  %PDF-1.3
2
2
  %����
3
3
  1 0 obj
4
- << /Producer <feff0050007200610077006e>
5
- /Creator <feff0050007200610077006e>
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
6
  >>
7
7
  endobj
8
8
  2 0 obj
@@ -12,8 +12,8 @@ endobj
12
12
  endobj
13
13
  3 0 obj
14
14
  << /Count 1
15
- /Type /Pages
16
15
  /Kids [5 0 R]
16
+ /Type /Pages
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
@@ -353,29 +353,29 @@ Q
353
353
  endstream
354
354
  endobj
355
355
  5 0 obj
356
- << /MediaBox [0 0 311.811023622047 189.92125984252]
357
- /Type /Page
358
- /Resources << /Font << /F1.0 6 0 R
356
+ << /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
357
+ /Font << /F1.0 6 0 R
359
358
  /F2.0 7 0 R
360
359
  >>
361
- /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
362
360
  >>
363
361
  /Parent 3 0 R
364
362
  /Contents 4 0 R
363
+ /MediaBox [0 0 311.811023622047 189.92125984252]
364
+ /Type /Page
365
365
  >>
366
366
  endobj
367
367
  6 0 obj
368
368
  << /Encoding /WinAnsiEncoding
369
369
  /Subtype /Type1
370
- /Type /Font
371
370
  /BaseFont /Helvetica
371
+ /Type /Font
372
372
  >>
373
373
  endobj
374
374
  7 0 obj
375
375
  << /Encoding /WinAnsiEncoding
376
376
  /Subtype /Type1
377
- /Type /Font
378
377
  /BaseFont /Courier
378
+ /Type /Font
379
379
  >>
380
380
  endobj
381
381
  xref
@@ -1,8 +1,8 @@
1
1
  %PDF-1.3
2
2
  %����
3
3
  1 0 obj
4
- << /Producer <feff0050007200610077006e>
5
- /Creator <feff0050007200610077006e>
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
6
  >>
7
7
  endobj
8
8
  2 0 obj
@@ -12,8 +12,8 @@ endobj
12
12
  endobj
13
13
  3 0 obj
14
14
  << /Count 1
15
- /Type /Pages
16
15
  /Kids [5 0 R]
16
+ /Type /Pages
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
@@ -103,21 +103,21 @@ Q
103
103
  endstream
104
104
  endobj
105
105
  5 0 obj
106
- << /MediaBox [0 0 566.929133858268 425.196850393701]
107
- /Type /Page
108
- /Resources << /Font << /F1.0 6 0 R
106
+ << /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
107
+ /Font << /F1.0 6 0 R
109
108
  >>
110
- /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
111
109
  >>
112
110
  /Parent 3 0 R
113
111
  /Contents 4 0 R
112
+ /MediaBox [0 0 566.929133858268 425.196850393701]
113
+ /Type /Page
114
114
  >>
115
115
  endobj
116
116
  6 0 obj
117
117
  << /Encoding /WinAnsiEncoding
118
118
  /Subtype /Type1
119
- /Type /Font
120
119
  /BaseFont /Helvetica
120
+ /Type /Font
121
121
  >>
122
122
  endobj
123
123
  xref
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nathan Smith
metadata.gz.sig CHANGED
Binary file