geocaching 0.4.1 → 0.5.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.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@
3
3
  task :default => :test
4
4
 
5
5
  task :test do
6
- sh "spec -c -f specdoc spec"
6
+ sh "rspec -c spec"
7
7
  end
8
8
 
9
9
  task :console do
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.has_rdoc = false
19
19
  s.add_dependency "nokogiri", ">= 1.4.2"
20
- s.add_development_dependency "rspec"
20
+ s.add_development_dependency "rspec", ">= 2.0.0"
21
21
  end
@@ -358,6 +358,17 @@ module Geocaching
358
358
  end
359
359
  end
360
360
 
361
+ # Return whether the cache is unpublished or not.
362
+ #
363
+ # @return [Boolean] Is cache unpublished?
364
+ # @raise [Geocaching::NotFetchedError] Need to call {#fetch} first
365
+ def unpublished?
366
+ @is_unpublished ||= begin
367
+ raise NotFetchedError unless fetched?
368
+ !!(@data =~ /<h2>Cache is Unpublished<\/h2>/)
369
+ end
370
+ end
371
+
361
372
  # Return whether the cache has been archived or not.
362
373
  #
363
374
  # @return [Boolean] Has cache been archived?
@@ -69,7 +69,7 @@ module Geocaching
69
69
  #
70
70
  # @return [String] The converted string
71
71
  def unescape(str)
72
- str = str.force_encoding("UTF-8")
72
+ str = str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
73
73
  str = str.gsub(/&#(\d{3});/) { [$1.to_i].pack("U") }
74
74
  CGI.unescapeHTML(str)
75
75
  end
@@ -1,3 +1,3 @@
1
1
  module Geocaching
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,16 +1,16 @@
1
1
  # encoding: utf-8
2
2
 
3
- describe "Geocaching::Log for 1758e5da-b49f-4a0a-b435-d12cd8d66e86 (Disable Listing)" do
3
+ describe "Geocaching::Log for 83a3f4f4-7faf-414a-8145-8f334622d20f (Disable Listing)" do
4
4
  before :all do
5
- @log = Geocaching::Log.fetch(:guid => "1758e5da-b49f-4a0a-b435-d12cd8d66e86")
5
+ @log = Geocaching::Log.fetch(:guid => "83a3f4f4-7faf-414a-8145-8f334622d20f")
6
6
  end
7
7
 
8
8
  it "should return the correct username" do
9
- @log.username.should == "Cermak"
9
+ @log.username.should == "CacheHasen"
10
10
  end
11
11
 
12
12
  it "should return the correct cache GUID" do
13
- @log.cache.guid.should == "66274935-40d5-43d8-8cc3-c819e38f9dcc"
13
+ @log.cache.guid.should == "65f58a1c-916b-4b32-a656-e80964b6819b"
14
14
  end
15
15
 
16
16
  it "should return the correct type" do
@@ -18,7 +18,7 @@ describe "Geocaching::Log for 1758e5da-b49f-4a0a-b435-d12cd8d66e86 (Disable List
18
18
  end
19
19
 
20
20
  it "should return the correct date" do
21
- @log.date.should == Time.mktime(2010, 2, 27)
21
+ @log.date.should == Time.mktime(2010, 3, 13)
22
22
  end
23
23
 
24
24
  it "should return the correct message" do
@@ -1,3 +1,5 @@
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.
1
+ Es schaut so als ob die Dose nicht lange sicher war in ihrem Versteck. Bis wir das überprüft und gegebenenfalls ein neues Versteck gefunden habe, deaktiviere ich mal den Cache.
2
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.
3
+ PS: Jeder der uns die errechneten (richtigen) Koordinaten schickt, darf trotzdem loggen.
4
+
5
+ [This entry was edited by pevo117 on Tuesday, March 16, 2010 at 4:09:34 AM.]
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
8
- - 1
9
- version: 0.4.1
7
+ - 5
8
+ - 0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Thomas Cyron
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-31 00:00:00 +02:00
17
+ date: 2010-10-16 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -41,8 +41,10 @@ dependencies:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  segments:
44
+ - 2
45
+ - 0
44
46
  - 0
45
- version: "0"
47
+ version: 2.0.0
46
48
  type: :development
47
49
  version_requirements: *id002
48
50
  description: A Ruby library that provides an API for geocaching.com