eaal 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 0.1.2 2009-01-26
2
+
3
+ * 1 workarround:
4
+ * the EVE API does not give the right cache timers for WalletJournal, so eaal now adds one hour when needed (dirty hack)
5
+
1
6
  == 0.1.1 2008-12-10
2
7
 
3
8
  * 1 bugfix:
@@ -28,7 +28,7 @@ module EAAL
28
28
 
29
29
  mattr_reader :version_string, :version
30
30
 
31
- @@version = "0.1.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
@@ -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
- (doc/"/eveapi/cachedUntil").inner_html.to_time > Time.now
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
File without changes
@@ -81,7 +81,7 @@ module EAAL
81
81
  end
82
82
  end
83
83
 
84
-
84
+ # create a new result derived from ResultBase
85
85
  def self.new(prefix, xml)
86
86
  classname = prefix + 'Result'
87
87
  members = []
@@ -120,4 +120,4 @@ module EAAL
120
120
  result
121
121
  end
122
122
  end
123
- end
123
+ end
@@ -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
@@ -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.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: 2008-12-10 00:00:00 +01:00
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.1.0
43
+ version: 1.2.3
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: hoe