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.
- data/lib/rtmapi.rb +1 -1
- data/test/test-rtmapi.rb +11 -1
- metadata +1 -1
data/lib/rtmapi.rb
CHANGED
@@ -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
|
data/test/test-rtmapi.rb
CHANGED
@@ -31,7 +31,17 @@ class RememberTheMilkTester < RememberTheMilk
|
|
31
31
|
@test_hash[calling_test] ||= 0
|
32
32
|
@test_hash[calling_test] += 1
|
33
33
|
|
34
|
-
|
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