eaal 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/eaal/eaal.rb +2 -2
- data/lib/eaal/eaal_cache.rb +8 -4
- data/lib/eaal/eaal_exception.rb +0 -0
- data/lib/eaal/eaal_result.rb +2 -2
- data/lib/eaal/eaal_rowset.rb +10 -4
- data/test/test_eaal.rb +1 -0
- metadata +3 -3
data/History.txt
CHANGED
data/lib/eaal/eaal.rb
CHANGED
@@ -28,7 +28,7 @@ module EAAL
|
|
28
28
|
|
29
29
|
mattr_reader :version_string, :version
|
30
30
|
|
31
|
-
@@version = "0.1.
|
31
|
+
@@version = "0.1.2"
|
32
32
|
@@version_string = "EAAL" + EAAL.version # the version string, used as client name in http requests
|
33
33
|
|
34
34
|
mattr_accessor :api_base, :additional_request_parameters, :cache
|
@@ -111,4 +111,4 @@ module EAAL
|
|
111
111
|
req.chop # We are lazy and append a & to each pair even if it's the last one. FIXME: Don't do this.
|
112
112
|
end
|
113
113
|
end
|
114
|
-
end
|
114
|
+
end
|
data/lib/eaal/eaal_cache.rb
CHANGED
@@ -49,7 +49,7 @@ module EAAL
|
|
49
49
|
ret = false
|
50
50
|
else
|
51
51
|
xml = File.open(filename).read
|
52
|
-
if self.validate_cache(xml)
|
52
|
+
if self.validate_cache(xml, name)
|
53
53
|
ret = xml
|
54
54
|
else
|
55
55
|
ret = false
|
@@ -59,9 +59,13 @@ module EAAL
|
|
59
59
|
end
|
60
60
|
|
61
61
|
# validate cached datas cachedUntil
|
62
|
-
def validate_cache(xml)
|
62
|
+
def validate_cache(xml, name)
|
63
63
|
doc = Hpricot.XML(xml)
|
64
|
-
|
64
|
+
if name == "WalletJournal"
|
65
|
+
Time.at((doc/"/eveapi/cachedUntil").inner_html.to_time.to_i + 3600) > Time.now
|
66
|
+
else
|
67
|
+
(doc/"/eveapi/cachedUntil").inner_html.to_time > Time.now
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
# save xml data to file
|
@@ -83,4 +87,4 @@ module EAAL
|
|
83
87
|
end
|
84
88
|
|
85
89
|
end
|
86
|
-
end
|
90
|
+
end
|
data/lib/eaal/eaal_exception.rb
CHANGED
File without changes
|
data/lib/eaal/eaal_result.rb
CHANGED
data/lib/eaal/eaal_rowset.rb
CHANGED
@@ -6,10 +6,12 @@
|
|
6
6
|
module EAAL
|
7
7
|
|
8
8
|
module Rowset
|
9
|
-
|
9
|
+
|
10
|
+
# RowsetBase class, all RowSets should be derived from this
|
10
11
|
class RowsetBase < Array
|
11
12
|
attr_accessor :name, :columns, :rowclass
|
12
13
|
|
14
|
+
# create a new row in this RowSet
|
13
15
|
def create_row(xml)
|
14
16
|
row = self.rowclass.new
|
15
17
|
self.columns.each { |colname|
|
@@ -24,10 +26,14 @@ module EAAL
|
|
24
26
|
row
|
25
27
|
end
|
26
28
|
end
|
27
|
-
|
29
|
+
|
30
|
+
# BaseClass for Rows, all Rows should be derived from this
|
28
31
|
class RowBase < EAAL::Result::ResultContainer
|
29
32
|
end
|
30
|
-
|
33
|
+
|
34
|
+
# create a new RowSet Object
|
35
|
+
# * prefix string prefix for building the RowSet name
|
36
|
+
# * xml the xml for the RowSet
|
31
37
|
def self.new(prefix, xml)
|
32
38
|
name = xml['name']
|
33
39
|
columns = xml['columns'].split(',')
|
@@ -60,4 +66,4 @@ module EAAL
|
|
60
66
|
rowset
|
61
67
|
end
|
62
68
|
end
|
63
|
-
end
|
69
|
+
end
|
data/test/test_eaal.rb
CHANGED
@@ -34,6 +34,7 @@ class TestEaal < Test::Unit::TestCase
|
|
34
34
|
assert_equal @api.Killlog(:characterID => 12345).kills.first.attackers.first.characterID, "12345"
|
35
35
|
end
|
36
36
|
|
37
|
+
# test to check if bug 23177 is fixed. that bug lead to RowSets beeing encapsulated in ResultElements.
|
37
38
|
def test_bug_23177
|
38
39
|
@api.scope = "eve"
|
39
40
|
assert_kind_of EAAL::Rowset::RowsetBase, @api.AllianceList.alliances.first.memberCorporations
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eaal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Petermann
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-26 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
43
|
+
version: 1.2.3
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: hoe
|