rats 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -124,7 +124,23 @@ but I do not currently need it.
124
124
 
125
125
  = Usage
126
126
 
127
- TODO: show examples
127
+ # parse a location
128
+ quarter_section = Rats.new("NE 1-2-3 W4")
129
+
130
+ # print the location
131
+ quarter_section.location
132
+
133
+ # read the attributes
134
+ quarter_section.quarter
135
+ quarter_section.section
136
+ quarter_section.township
137
+ quarter_section.range
138
+ quarter_section.meridian
139
+
140
+ # traverse
141
+ new_quarter_section = quarter_section.left
142
+ new_quarter_section = quarter_section.left.down
143
+ new_section = quarter_section.left(:section)
128
144
 
129
145
  = Information
130
146
 
@@ -135,7 +151,8 @@ http://en.wikipedia.org/wiki/Alberta_Township_System
135
151
  == Road Map
136
152
 
137
153
  Future:
138
- - add support for Saskatchewan (no timeline)
154
+ - correct assumption #3 (see below)
155
+ - add support for Saskatchewan (no timeline, need to find data)
139
156
  - address bugs, if any
140
157
 
141
158
  Except for the above, once this gem is finalized, I do not see future
@@ -147,17 +164,29 @@ Currently this point has not been reached and this gem is still in development.
147
164
 
148
165
  == Assumptions
149
166
 
167
+ I make 3 key assumptions.
168
+
150
169
  The only assumptions made are in respects to traversing. I do assume that
151
- traversing within a township, that all sections and quarter sections are
170
+ (#1) traversing within a township, that all sections and quarter sections are
152
171
  perfectly aligned. If this is not correct, it must be pretty close, and
153
172
  is close enough for my purpose.
154
173
 
155
- I also assume that all townships are perfectly aligned from East to West.
174
+ (#2) I also assume that all townships are perfectly aligned from East to West.
175
+
176
+ UPDATE: Based on some GPS data I have access to, the range line (x-axis)
177
+ doesn't seem to run perfectly straight from East-to-West, but actually drops
178
+ a bit South as you go West. I still assume that quarters/sections/townships
179
+ are aligned East-to-West, or rather Right-to-Left, they just follow this pattern
180
+ of dropping a bit South as you go West. What this means is that the functions
181
+ I use to traverse locations are a bit of a lie. The function .east() and .west()
182
+ imply that you are traversing East and West, when they are actually slightly askew,
183
+ and could be called .east_and_ever_so_slightly_south() and
184
+ .west_and_ever_so_slightly_north() ... but I will leave them named as is.
156
185
 
157
- Lastly, I assume that within every valid section, all four quarters are valid.
158
- This may be the false. Even so, I do not have a list of which sections do not
159
- have four quarters (let alone which ones are missing), so I couldn't do anything
160
- about it anyway.
186
+ (#3) Lastly, I assume that within every valid section, all four quarters are valid.
187
+ This has been confirmed to be incorrect. I have recently found a way to get this
188
+ data but it will take some time to collect it. I will remove this assumption in a
189
+ future version.
161
190
 
162
191
  == Environment
163
192
 
@@ -178,4 +207,4 @@ This gem was created using:
178
207
 
179
208
  == Copyright
180
209
 
181
- Copyright (c) 2010 Mark. See LICENSE for details.
210
+ Copyright (c) 2010 Mark sG. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -239,12 +239,11 @@ module Rats
239
239
  end
240
240
 
241
241
  def set_values(values)
242
- #self.quarter = values.shift
243
- self.quarter = values.shift.to_s if values.size > 0
244
- self.section = values.shift.to_i if values.size > 0
245
- self.township = values.shift.to_i if values.size > 0
246
- self.range = values.shift.to_i if values.size > 0
247
242
  self.meridian = values.shift.to_i if values.size > 0
243
+ self.range = values.shift.to_i if values.size > 0
244
+ self.township = values.shift.to_i if values.size > 0
245
+ self.section = values.shift.to_i if values.size > 0
246
+ self.quarter = values.shift.to_s if values.size > 0
248
247
  end
249
248
 
250
249
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rats}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
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-03-31}
12
+ s.date = %q{2010-04-02}
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 = [
@@ -138,7 +138,8 @@ describe "Rats" do
138
138
  end
139
139
 
140
140
  it "understands individual values" do
141
- land = Rats.new("NE", 1, 2, 3, 4)
141
+ #land = Rats.new("NE", 1, 2, 3, 4)
142
+ land = Rats.new(4, 3, 2, 1, "NE")
142
143
  land.quarter.should == "NE"
143
144
  land.section.should == 1
144
145
  land.township.should == 2
@@ -172,7 +173,8 @@ describe "Rats" do
172
173
 
173
174
  it "using location and individual values" do
174
175
  land = Rats.new
175
- land.location = ["NE", 1, 2, 3, 4]
176
+ #land.location = ["NE", 1, 2, 3, 4]
177
+ land.location = [4, 3, 2, 1, "NE"]
176
178
  land.quarter.should == "NE"
177
179
  land.section.should == 1
178
180
  land.township.should == 2
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
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-03-31 00:00:00 -04:00
17
+ date: 2010-04-02 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20