geocaching 0.6.0 → 0.6.1

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 (67) hide show
  1. data/README.markdown +3 -3
  2. data/lib/geocaching.rb +9 -10
  3. data/lib/geocaching/cache.rb +16 -25
  4. data/lib/geocaching/http.rb +12 -4
  5. data/lib/geocaching/log.rb +1 -12
  6. data/lib/geocaching/my_logs.rb +3 -12
  7. data/lib/geocaching/user.rb +2 -13
  8. data/lib/geocaching/version.rb +1 -1
  9. data/lib/geocaching/watchlist.rb +1 -14
  10. metadata +3 -75
  11. data/Rakefile +0 -11
  12. data/geocaching.gemspec +0 -24
  13. data/lib/geocaching/pocket_query.rb +0 -213
  14. data/spec/cache/ape.rb +0 -75
  15. data/spec/cache/cito.rb +0 -75
  16. data/spec/cache/earthcache.rb +0 -75
  17. data/spec/cache/event.rb +0 -75
  18. data/spec/cache/letterbox.rb +0 -75
  19. data/spec/cache/lfevent.rb +0 -75
  20. data/spec/cache/locationless.rb +0 -75
  21. data/spec/cache/megaevent.rb +0 -75
  22. data/spec/cache/multi.rb +0 -75
  23. data/spec/cache/mystery.rb +0 -75
  24. data/spec/cache/traditional.rb +0 -75
  25. data/spec/cache/virtual.rb +0 -75
  26. data/spec/cache/webcam.rb +0 -75
  27. data/spec/cache/wherigo.rb +0 -75
  28. data/spec/cache_spec.rb +0 -20
  29. data/spec/helper.rb +0 -16
  30. data/spec/log/announcement.rb +0 -28
  31. data/spec/log/announcement.txt +0 -14
  32. data/spec/log/archive.rb +0 -28
  33. data/spec/log/archive.txt +0 -5
  34. data/spec/log/attended.rb +0 -28
  35. data/spec/log/attended.txt +0 -1
  36. data/spec/log/coords_update.rb +0 -28
  37. data/spec/log/coords_update.txt +0 -9
  38. data/spec/log/disable.rb +0 -28
  39. data/spec/log/disable.txt +0 -5
  40. data/spec/log/dnf.rb +0 -28
  41. data/spec/log/dnf.txt +0 -5
  42. data/spec/log/enable.rb +0 -28
  43. data/spec/log/enable.txt +0 -1
  44. data/spec/log/found.rb +0 -28
  45. data/spec/log/found.txt +0 -5
  46. data/spec/log/needs_archived.rb +0 -28
  47. data/spec/log/needs_archived.txt +0 -1
  48. data/spec/log/needs_maintenance.rb +0 -28
  49. data/spec/log/needs_maintenance.txt +0 -1
  50. data/spec/log/note.rb +0 -28
  51. data/spec/log/note.txt +0 -1
  52. data/spec/log/owner_maintenance.rb +0 -28
  53. data/spec/log/owner_maintenance.txt +0 -1
  54. data/spec/log/publish.rb +0 -28
  55. data/spec/log/publish.txt +0 -1
  56. data/spec/log/retract.rb +0 -28
  57. data/spec/log/retract.txt +0 -4
  58. data/spec/log/reviewer_note.rb +0 -28
  59. data/spec/log/reviewer_note.txt +0 -3
  60. data/spec/log/unarchive.rb +0 -28
  61. data/spec/log/unarchive.txt +0 -1
  62. data/spec/log/webcam_photo_taken.rb +0 -28
  63. data/spec/log/webcam_photo_taken.txt +0 -1
  64. data/spec/log/will_attend.rb +0 -28
  65. data/spec/log/will_attend.txt +0 -1
  66. data/spec/log_spec.rb +0 -21
  67. data/spec/user_spec.rb +0 -48
@@ -1,75 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Cache for 1d86cace-bada-435a-817a-f841718d7754 (Mystery)" do
4
- before :all do
5
- @cache = Geocaching::Cache.fetch(:guid => "1d86cace-bada-435a-817a-f841718d7754")
6
- end
7
-
8
- it "should return the correct GC code" do
9
- @cache.code.should == "GC21BBB"
10
- end
11
-
12
- it "should return the correct ID" do
13
- @cache.id.should == 1476636
14
- end
15
-
16
- it "should return the correct name" do
17
- @cache.name.should == "Nordstadt-Matrix"
18
- end
19
-
20
- it "should return the correct displayed owner name" do
21
- @cache.owner_display_name.should == "CachingFoX"
22
- end
23
-
24
- it "should return the correct owner GUID" do
25
- @cache.owner.guid == "9c360222-40d7-48be-8dc7-1d4fe5a2d37c"
26
- end
27
-
28
- it "should return the correct cache type" do
29
- @cache.type.to_sym.should == :mystery
30
- end
31
-
32
- it "should return the correct size" do
33
- @cache.size.should == :small
34
- end
35
-
36
- it "should return the correct hidden date" do
37
- @cache.hidden_at.should == Time.mktime(2010, 2, 23)
38
- end
39
-
40
- it "should return the correct difficulty rating" do
41
- @cache.difficulty.should == 3.5
42
- end
43
-
44
- it "should return the correct terrain rating" do
45
- @cache.terrain.should == 2
46
- end
47
-
48
- it "should return the correct latitude" do
49
- @cache.latitude.should == 49.466133
50
- end
51
-
52
- it "should return the correct longitude" do
53
- @cache.longitude.should == 11.07135
54
- end
55
-
56
- it "should return the correct location" do
57
- @cache.location.should == "Bayern, Germany"
58
- end
59
-
60
- it "should return a plausible number of logs" do
61
- @cache.logs.size.should >= 61
62
- end
63
-
64
- it "should return cache has not been archived" do
65
- @cache.archived?.should == false
66
- end
67
-
68
- it "should return cache is not PM-only" do
69
- @cache.pmonly?.should == false
70
- end
71
-
72
- it "should return cache is not in review" do
73
- @cache.in_review?.should == false
74
- end
75
- end
@@ -1,75 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Cache for 66274935-40d5-43d8-8cc3-c819e38f9dcc (Traditional)" do
4
- before :all do
5
- @cache = Geocaching::Cache.fetch(:guid => "66274935-40d5-43d8-8cc3-c819e38f9dcc")
6
- end
7
-
8
- it "should return the correct GC code" do
9
- @cache.code.should == "GCF00"
10
- end
11
-
12
- it "should return the correct ID" do
13
- @cache.id.should == 3840
14
- end
15
-
16
- it "should return the correct name" do
17
- @cache.name.should == "Bridge Over Troubled Waters"
18
- end
19
-
20
- it "should return the correct displayed owner name" do
21
- @cache.owner_display_name.should == "Cermak"
22
- end
23
-
24
- it "should return the correct owner GUID" do
25
- @cache.owner.guid == "07eae57b-a6c2-4a8d-a1c9-667c63dccfca"
26
- end
27
-
28
- it "should return the correct cache type" do
29
- @cache.type.to_sym.should == :traditional
30
- end
31
-
32
- it "should return the correct size" do
33
- @cache.size.should == :regular
34
- end
35
-
36
- it "should return the correct hidden date" do
37
- @cache.hidden_at.should == Time.mktime(2001, 07, 05)
38
- end
39
-
40
- it "should return the correct difficulty rating" do
41
- @cache.difficulty.should == 2.5
42
- end
43
-
44
- it "should return the correct terrain rating" do
45
- @cache.terrain.should == 1.5
46
- end
47
-
48
- it "should return the correct latitude" do
49
- @cache.latitude.should == 32.6684
50
- end
51
-
52
- it "should return the correct longitude" do
53
- @cache.longitude.should == -97.436783
54
- end
55
-
56
- it "should return the correct location" do
57
- @cache.location.should == "Texas, United States"
58
- end
59
-
60
- it "should return a plausible number of logs" do
61
- @cache.logs.size.should >= 230
62
- end
63
-
64
- it "should return cache has not been archived" do
65
- @cache.archived?.should == false
66
- end
67
-
68
- it "should return cache is not PM-only" do
69
- @cache.pmonly?.should == false
70
- end
71
-
72
- it "should return cache is not in review" do
73
- @cache.in_review?.should == false
74
- end
75
- end
@@ -1,75 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Cache for 4e8b79e1-ffb2-4845-9c24-5ef54137a9b9 (Virtual)" do
4
- before :all do
5
- @cache = Geocaching::Cache.fetch(:guid => "4e8b79e1-ffb2-4845-9c24-5ef54137a9b9")
6
- end
7
-
8
- it "should return the correct GC code" do
9
- @cache.code.should == "GCEB74"
10
- end
11
-
12
- it "should return the correct ID" do
13
- @cache.id.should == 60276
14
- end
15
-
16
- it "should return the correct name" do
17
- @cache.name.should == "Buecherturm"
18
- end
19
-
20
- it "should return the correct displayed owner name" do
21
- @cache.owner_display_name.should == "cosmic bob"
22
- end
23
-
24
- it "should return the correct owner GUID" do
25
- @cache.owner.guid == "176be429-73f6-4812-99b0-aec77ee754d8"
26
- end
27
-
28
- it "should return the correct cache type" do
29
- @cache.type.to_sym.should == :virtual
30
- end
31
-
32
- it "should return the correct size" do
33
- @cache.size.should == :virtual
34
- end
35
-
36
- it "should return the correct hidden date" do
37
- @cache.hidden_at.should == Time.mktime(2003, 3, 24)
38
- end
39
-
40
- it "should return the correct difficulty rating" do
41
- @cache.difficulty.should == 3
42
- end
43
-
44
- it "should return the correct terrain rating" do
45
- @cache.terrain.should == 1
46
- end
47
-
48
- it "should return the correct latitude" do
49
- @cache.latitude.should == 53.553067
50
- end
51
-
52
- it "should return the correct longitude" do
53
- @cache.longitude.should == 10.006933
54
- end
55
-
56
- it "should return the correct location" do
57
- @cache.location.should == "Hamburg, Germany"
58
- end
59
-
60
- it "should return a plausible number of logs" do
61
- @cache.logs.size.should >= 856
62
- end
63
-
64
- it "should return cache has not been archived" do
65
- @cache.archived?.should == false
66
- end
67
-
68
- it "should return cache is not PM-only" do
69
- @cache.pmonly?.should == false
70
- end
71
-
72
- it "should return cache is not in review" do
73
- @cache.in_review?.should == false
74
- end
75
- end
@@ -1,75 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Cache for 8cd0976c-42cf-40a2-ae02-ed87ad52d5b1 (Webcam)" do
4
- before :all do
5
- @cache = Geocaching::Cache.fetch(:guid => "8cd0976c-42cf-40a2-ae02-ed87ad52d5b1")
6
- end
7
-
8
- it "should return the correct GC code" do
9
- @cache.code.should == "GCQG38"
10
- end
11
-
12
- it "should return the correct ID" do
13
- @cache.id.should == 289550
14
- end
15
-
16
- it "should return the correct name" do
17
- @cache.name.should == "Versteckte Kamera"
18
- end
19
-
20
- it "should return the correct displayed owner name" do
21
- @cache.owner_display_name.should == "buddler"
22
- end
23
-
24
- it "should return the correct owner GUID" do
25
- @cache.owner.guid == "aa82755c-0ee2-4b7b-8e1c-53217cd5b446"
26
- end
27
-
28
- it "should return the correct cache type" do
29
- @cache.type.to_sym.should == :webcam
30
- end
31
-
32
- it "should return the correct size" do
33
- @cache.size.should == :not_chosen
34
- end
35
-
36
- it "should return the correct hidden date" do
37
- @cache.hidden_at.should == Time.mktime(2005, 9, 9)
38
- end
39
-
40
- it "should return the correct difficulty rating" do
41
- @cache.difficulty.should == 1.5
42
- end
43
-
44
- it "should return the correct terrain rating" do
45
- @cache.terrain.should == 1
46
- end
47
-
48
- it "should return the correct latitude" do
49
- @cache.latitude.should == 49.441
50
- end
51
-
52
- it "should return the correct longitude" do
53
- @cache.longitude.should == 11.1065
54
- end
55
-
56
- it "should return the correct location" do
57
- @cache.location.should == "Bayern, Germany"
58
- end
59
-
60
- it "should return the correct number of logs" do
61
- @cache.logs.size.should >= 86
62
- end
63
-
64
- it "should return cache has been archived" do
65
- @cache.archived?.should == true
66
- end
67
-
68
- it "should return cache is not PM-only" do
69
- @cache.pmonly?.should == false
70
- end
71
-
72
- it "should return cache is not in review" do
73
- @cache.in_review?.should == false
74
- end
75
- end
@@ -1,75 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Cache for 6128b8a1-2ed3-48f0-9e05-a7117c5faffc (Wherigo)" do
4
- before :all do
5
- @cache = Geocaching::Cache.fetch(:guid => "6128b8a1-2ed3-48f0-9e05-a7117c5faffc")
6
- end
7
-
8
- it "should return the correct GC code" do
9
- @cache.code.should == "GC19RVP"
10
- end
11
-
12
- it "should return the correct ID" do
13
- @cache.id.should == 804412
14
- end
15
-
16
- it "should return the correct name" do
17
- @cache.name.should == "Pegnitztal"
18
- end
19
-
20
- it "should return the correct displayed owner name" do
21
- @cache.owner_display_name.should == "OLN"
22
- end
23
-
24
- it "should return the correct owner GUID" do
25
- @cache.owner.guid == "969ca2db-d6ed-4e26-a83f-9cf336ff815a"
26
- end
27
-
28
- it "should return the correct cache type" do
29
- @cache.type.to_sym.should == :wherigo
30
- end
31
-
32
- it "should return the correct size" do
33
- @cache.size.should == :small
34
- end
35
-
36
- it "should return the correct hidden date" do
37
- @cache.hidden_at.should == Time.mktime(2008, 2, 29)
38
- end
39
-
40
- it "should return the correct difficulty rating" do
41
- @cache.difficulty.should == 1.5
42
- end
43
-
44
- it "should return the correct terrain rating" do
45
- @cache.terrain.should == 1.5
46
- end
47
-
48
- it "should return the correct latitude" do
49
- @cache.latitude.should == 49.466333
50
- end
51
-
52
- it "should return the correct longitude" do
53
- @cache.longitude.should == 11.147267
54
- end
55
-
56
- it "should return the correct location" do
57
- @cache.location.should == "Bayern, Germany"
58
- end
59
-
60
- it "should return a plausible number of logs" do
61
- @cache.logs.size.should >= 182
62
- end
63
-
64
- it "should return cache has not been archived" do
65
- @cache.archived?.should == false
66
- end
67
-
68
- it "should return cache is not PM-only" do
69
- @cache.pmonly?.should == false
70
- end
71
-
72
- it "should return cache is not in review" do
73
- @cache.in_review?.should == false
74
- end
75
- end
@@ -1,20 +0,0 @@
1
- # encoding: utf-8
2
-
3
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
- dir = File.dirname(__FILE__)
5
-
6
- require "geocaching"
7
- require "#{dir}/helper"
8
-
9
- if ENV["GC_CACHE_TYPES"]
10
- types = ENV["GC_CACHE_TYPES"].split
11
- else
12
- types = Geocaching::CacheType::TYPES.to_a.map { |a| a[0].to_s }
13
- end
14
-
15
- types.each do |type|
16
- # Locationless caches have completely been disabled on geocaching.com
17
- next if type == "locationless"
18
-
19
- require "#{dir}/cache/#{type}"
20
- end
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
-
3
- unless ENV["GC_USERNAME"] and ENV["GC_PASSWORD"]
4
- $stderr.puts "You need to provide your geocaching.com account credentials"
5
- $stderr.puts "by setting the environment variables GC_USERNAME and GC_PASSWORD."
6
- exit 1
7
- end
8
-
9
- Geocaching::HTTP.timeout = ENV["GC_TIMEOUT"].to_i if ENV["GC_TIMEOUT"]
10
-
11
- begin
12
- Geocaching::HTTP.login(ENV["GC_USERNAME"], ENV["GC_PASSWORD"])
13
- rescue Geocaching::Error => e
14
- $stderr.puts "Failed to log in: #{e.message}"
15
- exit 1
16
- end
@@ -1,28 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Geocaching::Log for 37ef1827-17a6-436c-b8a1-01f1573186f3 (Announcement)" do
4
- before :all do
5
- @log = Geocaching::Log.fetch(:guid => "37ef1827-17a6-436c-b8a1-01f1573186f3")
6
- end
7
-
8
- it "should return the correct username" do
9
- @log.user.name.should == "Frank Frank"
10
- end
11
-
12
- it "should return the correct cache GUID" do
13
- @log.cache.guid.should == "7fb096e6-bd69-4e48-8665-9316852960a0"
14
- end
15
-
16
- it "should return the correct type" do
17
- @log.type.to_sym.should == :announcement
18
- end
19
-
20
- it "should return the correct date" do
21
- @log.date.should == Time.mktime(2010, 8, 7)
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