geocaching 0.3.0 → 0.4.0

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.
Files changed (65) hide show
  1. data/README.markdown +6 -0
  2. data/geocaching.gemspec +3 -1
  3. data/lib/geocaching.rb +4 -1
  4. data/lib/geocaching/cache.rb +65 -21
  5. data/lib/geocaching/cache_type.rb +57 -13
  6. data/lib/geocaching/log.rb +34 -2
  7. data/lib/geocaching/log_type.rb +57 -19
  8. data/lib/geocaching/my_logs.rb +150 -0
  9. data/lib/geocaching/user.rb +251 -0
  10. data/lib/geocaching/version.rb +3 -0
  11. data/spec/cache/ape.rb +69 -0
  12. data/spec/cache/cito.rb +12 -0
  13. data/spec/cache/earthcache.rb +12 -0
  14. data/spec/cache/event.rb +12 -0
  15. data/spec/cache/letterbox.rb +12 -0
  16. data/spec/cache/lfevent.rb +12 -0
  17. data/spec/cache/locationless.rb +12 -0
  18. data/spec/cache/megaevent.rb +12 -0
  19. data/spec/cache/multi.rb +27 -15
  20. data/spec/cache/mystery.rb +12 -0
  21. data/spec/cache/traditional.rb +12 -0
  22. data/spec/cache/virtual.rb +12 -0
  23. data/spec/cache/webcam.rb +12 -0
  24. data/spec/cache/wherigo.rb +12 -0
  25. data/spec/cache_spec.rb +3 -2
  26. data/spec/log/announcement.rb +28 -0
  27. data/spec/log/announcement.txt +14 -0
  28. data/spec/log/archive.rb +28 -0
  29. data/spec/log/archive.txt +5 -0
  30. data/spec/log/attended.rb +28 -0
  31. data/spec/log/attended.txt +1 -0
  32. data/spec/log/coords_update.rb +28 -0
  33. data/spec/log/coords_update.txt +9 -0
  34. data/spec/log/disable.rb +28 -0
  35. data/spec/log/disable.txt +3 -0
  36. data/spec/log/dnf.rb +28 -0
  37. data/spec/log/dnf.txt +5 -0
  38. data/spec/log/enable.rb +28 -0
  39. data/spec/log/enable.txt +1 -0
  40. data/spec/log/found.rb +28 -0
  41. data/spec/{log_message.txt → log/found.txt} +0 -0
  42. data/spec/log/needs_archived.rb +28 -0
  43. data/spec/log/needs_archived.txt +1 -0
  44. data/spec/log/needs_maintenance.rb +28 -0
  45. data/spec/log/needs_maintenance.txt +1 -0
  46. data/spec/log/note.rb +28 -0
  47. data/spec/log/note.txt +1 -0
  48. data/spec/log/owner_maintenance.rb +28 -0
  49. data/spec/log/owner_maintenance.txt +1 -0
  50. data/spec/log/publish.rb +28 -0
  51. data/spec/log/publish.txt +1 -0
  52. data/spec/log/retract.rb +28 -0
  53. data/spec/log/retract.txt +4 -0
  54. data/spec/log/reviewer_note.rb +28 -0
  55. data/spec/log/reviewer_note.txt +3 -0
  56. data/spec/log/unarchive.rb +28 -0
  57. data/spec/log/unarchive.txt +1 -0
  58. data/spec/log/webcam_photo_taken.rb +28 -0
  59. data/spec/log/webcam_photo_taken.txt +1 -0
  60. data/spec/log/will_attend.rb +28 -0
  61. data/spec/log/will_attend.txt +1 -0
  62. data/spec/log_spec.rb +7 -17
  63. data/spec/user_spec.rb +48 -0
  64. metadata +44 -6
  65. data/lib/geocaching/mylogs.rb +0 -63
@@ -0,0 +1,5 @@
1
+ Tja, jetzt ist es soweit.
2
+ Schweren Herzens wandert der Rohdiamant in die Tonne.
3
+ Aber wer weiss, vielleicht taucht er ja irgendwann woanders mal wieder auf, mal schauen...
4
+
5
+ Jonny
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 9bf458db-6dc9-4e02-b7ea-9cf056c40ade (Attended)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "9bf458db-6dc9-4e02-b7ea-9cf056c40ade")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Snooking Good"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "2f067ddb-1999-403a-8f9f-7509b8a68494"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :attended
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 8, 8)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ Ok for sure I am logging this event as my first....LTF!!!! [:I] [:I] [:P] (Last to Find) "you know how it is" I'm in Hialeah!!! trying to put my son to sleep, and he ended up putting me to sleep. Phone rings and I rushed out the door. Made it to Wall's just in time to join the chaos. I did the ROBOT but not as good as the Bon Jovi crew... Glad to share some fun time with a group of peers I recently found. Definitely looking forward to 9/9 and 10/10.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 6802b623-f02c-4268-8fb3-7194ea60a686 (Update Coordinates)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "6802b623-f02c-4268-8fb3-7194ea60a686")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Rudisucht"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "c72dc03a-cd9d-4ebe-9cd2-6789aaa66ae5"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :coords_update
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2009, 5, 15)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ ** Coordinates Changed From **
2
+ N 52° 26.119 E 013° 11.547
3
+ Distance From Old: 303.6 feet
4
+
5
+
6
+ Kleine Schönheitsoperation:
7
+ Jetzt zeigt das Listing auf Station 1 und nicht mehr auf den Parkplatz!
8
+
9
+
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 1758e5da-b49f-4a0a-b435-d12cd8d66e86 (Disable Listing)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "1758e5da-b49f-4a0a-b435-d12cd8d66e86")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Cermak"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "66274935-40d5-43d8-8cc3-c819e38f9dcc"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :disable
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 2, 27)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ After 2 no finds and finally some decent weather we headed out to the site. I don't think it was washed away because the river would have to rise about 15 feet.
2
+
3
+ We will be replacing this one because it has been in place for such a long time and has been found a lot.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 08dab41e-feaf-4f24-a9b5-b87e864f385f (Didn't find it)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "08dab41e-feaf-4f24-a9b5-b87e864f385f")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "swemil"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "d7524ad9-3c15-451a-9997-6c167f7b406f"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :dnf
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 7, 17)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ Litt irriterende å ikke finne cachen.. Måtte betale 50 kr for å komme in ! men greit det. Løste oppgaven, men jeg fant ingen cache. Dobbelsjekket årtalen igen, telte på nytt, men ingen cache å se på angitte kordinater.
2
+ Men jeg måtte opptrå forsiktigt, siden det var fullt av mugglers fra det lokale distriktet.
3
+ Får prøve neste gang en er i den dalen... surt. [:(!]
4
+
5
+ Ellers en trevlig cache.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 4e588373-768d-43fb-8cf1-45d2a7d21599 (Enable Listing)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "4e588373-768d-43fb-8cf1-45d2a7d21599")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Cermak"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "66274935-40d5-43d8-8cc3-c819e38f9dcc"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :enable
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2009, 1, 1)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ We made it out to the site today. A perfect way to start the new year! Everything is back to the way it should be. We tried to hide it pretty well, so it would not get plundered again. My only concern is the amount of leaves- this may make it a little tougher in the fall/winter months.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for a3237dec-6931-4221-8f00-5d62923b411a (Found it)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "a3237dec-6931-4221-8f00-5d62923b411a")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "CampinCrazy"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "66274935-40d5-43d8-8cc3-c819e38f9dcc"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :found
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2009, 1, 31)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
File without changes
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for d235f46e-cd16-49af-a520-fa52f6c8abf8 (Needs Archived)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "d235f46e-cd16-49af-a520-fa52f6c8abf8")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Kent_Allard"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "b39d3cf0-88ad-4402-ba42-29879ecb5814"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :needs_archived
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2008, 6, 15)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ This cache has been disabled for a long time. Please archive the cache and make any trackable items in inventory 'location unknown'.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for a572c594-8763-408a-9bec-f29b77a1e50f (Needs Maintenance)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "a572c594-8763-408a-9bec-f29b77a1e50f")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "taroh"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "c889a2e8-4d15-4b06-997e-8827896de5e8"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :needs_maintenance
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 7, 27)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ As I wrote in found log, the cache might be returned to the proper place. Also the thing to fix the cache to tha point is degraded.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 1eb67c1f-610d-4d1d-9703-10b3e47416e2 (Write Note)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "1eb67c1f-610d-4d1d-9703-10b3e47416e2")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "cache-strapped"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "879ec54c-3c0b-4378-bc4c-53c191e17816"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :note
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2005, 6, 5)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ Just popped in to check cache. Contents into fresh ziploc tucked back into hiding spot. Forgot the new additions to cache in truck. Will take in another time.
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 6eecdf81-3958-4b93-8d63-24f53107f97a (Owner Maintenance)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "6eecdf81-3958-4b93-8d63-24f53107f97a")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "pöllö"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "006ceb4e-5a45-471c-a74a-2af0a6035565"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :owner_maintenance
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2009, 11, 26)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ huoltokäynti ja nappasin samalla tb:n matkaan
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for d7ae038b-cb26-4b8e-bcca-5effd05870d0 (Publish)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "d7ae038b-cb26-4b8e-bcca-5effd05870d0")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "geoawareCA"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "d4c5b818-1d91-4c01-a305-7c9950ec57f2"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :publish
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 4, 11)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ Published
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 58fa3ddc-6c1a-4ae3-bc19-40009c50a9d5 (Retract Listing)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "58fa3ddc-6c1a-4ae3-bc19-40009c50a9d5")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "WGA3"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "d4249438-50e9-41b8-bafb-3f9e72e25f5a"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :retract
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 7, 29)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1,4 @@
1
+ Listing retracted. I didn't notice that it was in Minnesota! Cheezehead will re-enable so that the proper reviewer can give it the once-over.
2
+
3
+ WGA3 -- Volunteer Reivewer
4
+ wga3-admin@wi-geocaching.com
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ describe "Geocaching::Log for 876d4e85-ebe9-4098-8552-151f34d3b4de (Post Reviewer Note)" do
4
+ before :all do
5
+ @log = Geocaching::Log.fetch(:guid => "876d4e85-ebe9-4098-8552-151f34d3b4de")
6
+ end
7
+
8
+ it "should return the correct username" do
9
+ @log.username.should == "Prime Reviewer"
10
+ end
11
+
12
+ it "should return the correct cache GUID" do
13
+ @log.cache.guid.should == "66274935-40d5-43d8-8cc3-c819e38f9dcc"
14
+ end
15
+
16
+ it "should return the correct type" do
17
+ @log.type.to_sym.should == :reviewer_note
18
+ end
19
+
20
+ it "should return the correct date" do
21
+ @log.date.should == Time.mktime(2010, 7, 8)
22
+ end
23
+
24
+ it "should return the correct message" do
25
+ should_message = File.read(__FILE__.gsub(/rb$/, "txt"))
26
+ @log.message.should == should_message.gsub(/\r\n/, "\n")
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ I noticed that this cache has been temporarily disabled for a period of time well in excess of the period of "a few weeks" as contemplated by the cache guidelines published on Geocaching.com. While I feel that Geocaching.com should hold the location for you and block other caches from entering the area around this cache for a reasonable amount of time, we can't do so forever. Please either repair/replace this cache, or archive it (using the [i]archive listing[/i] link in the upper right) so that someone else can place a cache in the area, and geocachers can once again enjoy visiting this location.
2
+
3
+ If you plan on repairing this cache, please [b]log a note to the cache[/b] (not email) so I don't archive the listing for non-communication.