rtmapi 0.5.1 → 0.5.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.
Files changed (3) hide show
  1. data/lib/rtmapi.rb +1 -1
  2. data/test/test-rtmapi.rb +11 -1
  3. metadata +1 -1
@@ -60,7 +60,7 @@ class RememberTheMilk
60
60
  end
61
61
 
62
62
  def time_to_user_tz( time )
63
- return time unless(use_user_tz && auth_token && defined?(TZInfo::Timezone.get))
63
+ return time unless(@use_user_tz && @auth_token && defined?(TZInfo::Timezone.get))
64
64
  begin
65
65
  unless defined?(@user_settings_cache[auth_token]) && defined?(@user_settings_cache[auth_token][:tz])
66
66
  @user_settings_cache[auth_token] = settings.getList
@@ -31,7 +31,17 @@ class RememberTheMilkTester < RememberTheMilk
31
31
  @test_hash[calling_test] ||= 0
32
32
  @test_hash[calling_test] += 1
33
33
 
34
- filename = "data/#{calling_test}.#{@test_hash[calling_test]}.xml"
34
+ # if we're running as a gem, figure out where the test data might be
35
+ if !defined?(@basedir)
36
+ @basedir = '.'
37
+ new_base = $:.find {|path| path =~ /gems\/rtmapi-[\d\.]+\/lib/ }
38
+ if new_base
39
+ new_base =~ /^(.*)\/lib$/
40
+ @basedir = "#{$1}/test"
41
+ end
42
+ end
43
+
44
+ filename = "#{@basedir}/data/#{calling_test}.#{@test_hash[calling_test]}.xml"
35
45
 
36
46
  if File.exists?(filename)
37
47
  # read from the cache
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.1
3
3
  specification_version: 1
4
4
  name: rtmapi
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.1
6
+ version: 0.5.2
7
7
  date: 2007-02-01 00:00:00 -05:00
8
8
  summary: Simple library for interfacing with rememberthemilk.com.
9
9
  require_paths: