rats 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/rats/base.rb CHANGED
@@ -205,7 +205,7 @@ module Rats
205
205
  end
206
206
 
207
207
  def short_location
208
- [@quarter.to_p,@section.to_p,@township.to_p,@range.to_p,@meridian.to_p].compact.join('').strip
208
+ [@meridian.to_p,@range.to_p,@township.to_p,@section.to_p,@quarter.to_p].compact.join('').strip
209
209
  end
210
210
 
211
211
  def long_location
@@ -1,6 +1,9 @@
1
1
  module Rats
2
2
  class Base
3
3
 
4
+ # TODO: this data needs to be updated to list the sections where not
5
+ # all quarters are valid, and list whoch ones are.
6
+
4
7
  # this array doesn't define what is valid, but trys to define what
5
8
  # combinations of meridian/range/township/section exist
6
9
  #
@@ -15,6 +18,45 @@ module Rats
15
18
  # # NOTE: for a TOWNSHIP listed here, only a SECTION within
16
19
  # # ARRAY_OF_VALID_SECTIONS is valid
17
20
  # VALID_TOWNSHIP => ARRAY_OF_VALID_SECTIONS
21
+ # },
22
+ # # NOTE: a SECTION not included here means all QUARTERs are valid within
23
+ # # NOTE: for a SECTION listed here, only a QUARTER within
24
+ # # ARRAY_OF_VALID_QUARTERS is valid
25
+ # VALID_SECTION => ARRAY_OF_VALID_QUARTERS
26
+ # }
27
+ # }
28
+
29
+ # proposed format (allows for quarters to be listed)
30
+ #
31
+ # TOWNSHIPS_BY_RANGE_AND_MERIDIAN = {
32
+ # # only valid meridian listed here
33
+ # 4 => {
34
+ # # only valid ranges listed here
35
+ # 1 => {
36
+ # # only valid township range listed here
37
+ # :townships => 1..126
38
+ # # no specifics past this, means all sections and quarters are valid
39
+ # },
40
+ # # another valid range
41
+ # 21 => {
42
+ # # only valid townships listed here
43
+ # :townships => 1..126,
44
+ # # list exceptions specific to certain townships
45
+ # :township => {
46
+ # # township listed here has exceptions, otherwise treat as normal
47
+ # 3 => {
48
+ # # only valid sections listed here
49
+ # :sections => [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,22,23,24,25,26,27,28,31,32,33,34,35,36],
50
+ # # list exceptions specific to certain sections
51
+ # :section => {
52
+ # # section listed here has exceptions, otherwise treat as normal
53
+ # 36 => {
54
+ # # only valid quarters listed here
55
+ # :quarters => [:ne, :se]
56
+ # }
57
+ # }
58
+ # }
59
+ # }
18
60
  # }
19
61
  # }
20
62
  # }
data/rats.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rats}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark G"]
12
- s.date = %q{2010-04-13}
12
+ s.date = %q{2010-04-14}
13
13
  s.description = %q{A ruby class to help with using the Alberta Township System}
14
14
  s.email = %q{rats@attackcorp.com}
15
15
  s.extra_rdoc_files = [
data/spec/rats_spec.rb CHANGED
@@ -55,6 +55,24 @@ describe "Rats" do
55
55
  land.meridian.should == 4
56
56
  end
57
57
 
58
+ it "understands NE-1-2-3-W4" do
59
+ land = Rats.new("NE-1-2-3-W4")
60
+ land.quarter.should == "NE"
61
+ land.section.should == 1
62
+ land.township.should == 2
63
+ land.range.should == 3
64
+ land.meridian.should == 4
65
+ end
66
+
67
+ it "understands NE-1-2-3-4" do
68
+ land = Rats.new("NE-1-2-3-4")
69
+ land.quarter.should == "NE"
70
+ land.section.should == 1
71
+ land.township.should == 2
72
+ land.range.should == 3
73
+ land.meridian.should == 4
74
+ end
75
+
58
76
  it "understands NE 1-1-1-4" do
59
77
  land = Rats.new("NE 1-2-3-4")
60
78
  land.quarter.should == "NE"
@@ -267,17 +285,17 @@ describe "Rats" do
267
285
 
268
286
  it "returns NE01002034" do
269
287
  land = Rats.new("NE 1-2-3 W4")
270
- land.location(:short).should == "NE01002034"
288
+ land.location(:short).should == "40300201NE"
271
289
  end
272
290
 
273
291
  it "returns 01001014" do
274
292
  land = Rats.new("1-2-3 W4")
275
- land.location(:short).should == "01002034"
293
+ land.location(:short).should == "40300201"
276
294
  end
277
295
 
278
296
  it "returns 001014" do
279
297
  land = Rats.new("2-3 W4")
280
- land.location(:short).should == "002034"
298
+ land.location(:short).should == "403002"
281
299
  end
282
300
 
283
301
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark G
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-13 00:00:00 -04:00
17
+ date: 2010-04-14 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20