rats 0.3.1 → 0.3.2
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.
- data/README.rdoc +3 -0
- data/VERSION +1 -1
- data/lib/rats/base.rb +10 -0
- data/rats.gemspec +2 -2
- data/spec/rats_spec.rb +19 -0
- metadata +3 -3
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/rats/base.rb
CHANGED
@@ -46,6 +46,8 @@ module Rats
|
|
46
46
|
case format
|
47
47
|
when :short
|
48
48
|
short_location
|
49
|
+
when :padded
|
50
|
+
padded_location
|
49
51
|
when :long
|
50
52
|
long_location
|
51
53
|
else
|
@@ -270,6 +272,14 @@ module Rats
|
|
270
272
|
[@meridian.to_p,@range.to_p,@township.to_p,@section.to_p,@quarter.to_p].compact.join('').strip
|
271
273
|
end
|
272
274
|
|
275
|
+
def padded_location
|
276
|
+
if self.quarter
|
277
|
+
"#{@quarter.to_p} #{[@section.to_p,@township.to_p,@range.to_p].compact.join('-')} #{@meridian.to_s}".strip
|
278
|
+
else
|
279
|
+
"#{[@section.to_p,@township.to_p,@range.to_p].compact.join('-')} #{@meridian.to_s}".strip
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
273
283
|
def long_location
|
274
284
|
quarter_section = []
|
275
285
|
quarter_section << self.q.fullname if (self.q && self.q.fullname.size > 0)
|
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.3.
|
8
|
+
s.version = "0.3.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-09-
|
12
|
+
s.date = %q{2010-09-16}
|
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
@@ -342,6 +342,25 @@ describe "Rats" do
|
|
342
342
|
|
343
343
|
end
|
344
344
|
|
345
|
+
describe ":padded" do
|
346
|
+
|
347
|
+
it "returns NE 01-002-03 W4" do
|
348
|
+
land = Rats.new("NE 1-2-3 W4")
|
349
|
+
land.location(:padded).should == "NE 01-002-03 W4"
|
350
|
+
end
|
351
|
+
|
352
|
+
it "returns 01-002-03 W4" do
|
353
|
+
land = Rats.new("1-2-3 W4")
|
354
|
+
land.location(:padded).should == "01-002-03 W4"
|
355
|
+
end
|
356
|
+
|
357
|
+
it "returns 002-03 W4" do
|
358
|
+
land = Rats.new("2-3 W4")
|
359
|
+
land.location(:padded).should == "002-03 W4"
|
360
|
+
end
|
361
|
+
|
362
|
+
end
|
363
|
+
|
345
364
|
describe ":long" do
|
346
365
|
|
347
366
|
it "returns the long version with Quarter" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 2
|
9
|
+
version: 0.3.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-09-
|
17
|
+
date: 2010-09-16 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|