eaal 0.1.10 → 0.1.11
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/Manifest.txt +9 -4
- data/Rakefile +15 -5
- data/lib/eaal.rb +31 -8
- data/lib/eaal/api.rb +34 -33
- data/lib/eaal/cache/file.rb +6 -3
- data/lib/eaal/cache/memcached.rb +1 -1
- data/lib/eaal/result.rb +2 -1
- data/test/fixtures/test/test/char/CharacterSheet/Request_.xml +6 -0
- data/test/fixtures/test/test/char/CharacterSheet/Request_characterID_12345.xml +65 -0
- data/test/fixtures/test/test/char/Killlog/{Request_characterID:12345.xml → Request_characterID_12345.xml} +0 -0
- data/test/fixtures/test/test/char/SkillInTraining/Request_characterID_12345.xml +14 -0
- data/test/fixtures/test/test/char/SkillQueue/Request_characterID_12345.xml +11 -0
- data/test/fixtures/test/test/char/Standings/Request_.xml +6 -0
- data/test/fixtures/test/test/char/Standings/Request_characterID_12345.xml +33 -0
- data/test/fixtures/test/test/corp/CorporationSheet/Request_corporationID_150212025.xml +50 -0
- data/test/fixtures/test/test/server/ServerStatus/Request_.xml +9 -0
- data/test/test_eaal.rb +13 -4
- metadata +28 -24
- data/.gemtest +0 -0
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
data/Manifest.txt
CHANGED
@@ -11,12 +11,17 @@ lib/eaal/cache/memcached.rb
|
|
11
11
|
lib/eaal/exception.rb
|
12
12
|
lib/eaal/result.rb
|
13
13
|
lib/eaal/rowset.rb
|
14
|
-
script/console
|
15
|
-
script/destroy
|
16
|
-
script/generate
|
17
14
|
test/fixtures/test/test/account/Characters/Request_.xml
|
15
|
+
test/fixtures/test/test/char/CharacterSheet/Request_.xml
|
16
|
+
test/fixtures/test/test/char/CharacterSheet/Request_characterID_12345.xml
|
18
17
|
test/fixtures/test/test/char/Killlog/Request_.xml
|
19
|
-
test/fixtures/test/test/char/Killlog/
|
18
|
+
test/fixtures/test/test/char/Killlog/Request_characterID_12345.xml
|
19
|
+
test/fixtures/test/test/char/SkillInTraining/Request_characterID_12345.xml
|
20
|
+
test/fixtures/test/test/char/SkillQueue/Request_characterID_12345.xml
|
21
|
+
test/fixtures/test/test/char/Standings/Request_.xml
|
22
|
+
test/fixtures/test/test/char/Standings/Request_characterID_12345.xml
|
23
|
+
test/fixtures/test/test/corp/CorporationSheet/Request_corporationID_150212025.xml
|
20
24
|
test/fixtures/test/test/eve/AllianceList/Request_.xml
|
25
|
+
test/fixtures/test/test/server/ServerStatus/Request_.xml
|
21
26
|
test/test_eaal.rb
|
22
27
|
test/test_helper.rb
|
data/Rakefile
CHANGED
@@ -1,25 +1,35 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
Bundler.require
|
3
5
|
|
4
6
|
# Generate all the Rake tasks
|
5
7
|
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
8
|
+
|
9
|
+
# Gives us the gem:spec rake task to generate a gemspec file
|
10
|
+
Hoe.plugin :gemspec
|
11
|
+
|
6
12
|
$hoe = Hoe.spec 'eaal' do |p|
|
7
13
|
p.developer('Peter Petermann', 'ppetermann80@googlemail.com')
|
8
14
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
9
15
|
p.rubyforge_name = p.name
|
10
16
|
p.extra_deps = [
|
11
|
-
['
|
17
|
+
['hpricot', '>= 0.6'],
|
18
|
+
['memcache-client','>= 1.7.1'],
|
19
|
+
['faraday', '>= 0.8.4']
|
12
20
|
]
|
21
|
+
|
13
22
|
p.extra_dev_deps = [
|
14
|
-
['
|
23
|
+
['hoe'],
|
24
|
+
['hoe-gemspec']
|
15
25
|
]
|
26
|
+
|
16
27
|
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
17
28
|
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
18
29
|
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
19
30
|
p.rsync_args = '-av --delete --ignore-errors'
|
20
31
|
end
|
21
32
|
|
22
|
-
require 'newgem/tasks' # load /tasks/*.rake
|
23
33
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
24
34
|
|
25
35
|
# TODO - want other tests/tasks run by default? Add them to the list
|
data/lib/eaal.rb
CHANGED
@@ -21,11 +21,10 @@ $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) ||
|
|
21
21
|
# External libs
|
22
22
|
require 'rubygems'
|
23
23
|
require 'hpricot'
|
24
|
-
require 'active_support'
|
25
|
-
require 'active_support/core_ext'
|
26
|
-
require 'net/http'
|
27
|
-
require 'uri'
|
28
24
|
require 'cgi'
|
25
|
+
require 'faraday'
|
26
|
+
require 'time'
|
27
|
+
|
29
28
|
# And now EAAL stuff
|
30
29
|
require 'eaal/cache/base'
|
31
30
|
require 'eaal/cache/file'
|
@@ -33,14 +32,38 @@ require 'eaal/cache/memcached'
|
|
33
32
|
require 'eaal/exception'
|
34
33
|
require 'eaal/result'
|
35
34
|
require 'eaal/rowset'
|
35
|
+
|
36
36
|
module EAAL
|
37
|
-
|
38
|
-
VERSION = "0.1.10" # fix for Hoe.spec 2.x
|
37
|
+
VERSION = "0.1.11" # fix for Hoe.spec 2.x
|
39
38
|
@@version_string = "EAAL" + VERSION # the version string, used as client name in http requests
|
40
39
|
|
41
|
-
|
42
|
-
@@api_base = "http://api.eve-online.com/" # the url used as basis for all requests, you might want to use gatecamper url or a personal proxy instead
|
40
|
+
@@api_base = "https://api.eveonline.com" # the url used as basis for all requests, you might want to use gatecamper url or a personal proxy instead
|
43
41
|
@@additional_request_parameters = {} # hash, if :key => value pairs are added those will be added to each request
|
44
42
|
@@cache = EAAL::Cache::NoCache.new # caching object, see EAAL::Cache::FileCache for an Example
|
43
|
+
|
44
|
+
def self.version_string
|
45
|
+
@@version_string
|
46
|
+
end
|
47
|
+
def self.version_string=(val)
|
48
|
+
@@version_string = val
|
49
|
+
end
|
50
|
+
def self.api_base
|
51
|
+
@@api_base
|
52
|
+
end
|
53
|
+
def self.api_base=(val)
|
54
|
+
@@api_base = val
|
55
|
+
end
|
56
|
+
def self.additional_request_parameters
|
57
|
+
@@additional_request_parameters
|
58
|
+
end
|
59
|
+
def self.additional_request_parameters=(val)
|
60
|
+
@@additional_request_parameters = val
|
61
|
+
end
|
62
|
+
def self.cache
|
63
|
+
@@cache
|
64
|
+
end
|
65
|
+
def self.cache=(val)
|
66
|
+
@@cache = val
|
67
|
+
end
|
45
68
|
end
|
46
69
|
require 'eaal/api'
|
data/lib/eaal/api.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# EAAL::API class
|
3
2
|
# Usage Example:
|
4
3
|
# api = EAAL::API.new("my keyID", "my API key")
|
@@ -28,8 +27,9 @@ class EAAL::API
|
|
28
27
|
def method_missing(method, *args)
|
29
28
|
scope = self.scope
|
30
29
|
args_hash = args.first
|
30
|
+
cache_only = (args_hash && args_hash.delete(:cache_only)) || false
|
31
31
|
args_hash = {} unless args_hash
|
32
|
-
self.request_xml(scope, method.id2name, args_hash)
|
32
|
+
self.request_xml(scope, method.id2name, args_hash, cache_only)
|
33
33
|
end
|
34
34
|
|
35
35
|
# make a request to the api. will use cache if set.
|
@@ -37,45 +37,46 @@ class EAAL::API
|
|
37
37
|
# * scope (String)
|
38
38
|
# * name (String)
|
39
39
|
# * opts (Hash)
|
40
|
-
def request_xml(scope, name, opts)
|
40
|
+
def request_xml(scope, name, opts, cache_only = false)
|
41
41
|
opts = EAAL.additional_request_parameters.merge(opts)
|
42
42
|
xml = EAAL.cache.load(self.keyid, self.vcode, scope, name,opts)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
43
|
+
|
44
|
+
if (not xml) && (not cache_only)
|
45
|
+
|
46
|
+
conn = Faraday.new(:url => "#{EAAL.api_base}") do |faraday|
|
47
|
+
faraday.request :url_encoded
|
48
|
+
faraday.adapter Faraday.default_adapter
|
49
|
+
end
|
50
|
+
|
51
|
+
response = conn.get(
|
52
|
+
request_path(name),
|
53
|
+
opts.merge({
|
54
|
+
:keyid => self.keyid,
|
55
|
+
:vcode => self.vcode}))
|
56
|
+
|
57
|
+
case response.status
|
58
|
+
when 200
|
59
|
+
# Nothing
|
60
|
+
when 404
|
54
61
|
raise EAAL::Exception::APINotFoundError.new("The requested API (#{scope} / #{name}) could not be found.")
|
55
62
|
else
|
56
|
-
raise EAAL::Exception::HTTPError.new("An HTTP Error occured, body: " +
|
63
|
+
raise EAAL::Exception::HTTPError.new("An HTTP Error occured, body: " + response.body)
|
57
64
|
end
|
58
|
-
EAAL.cache.save(self.keyid, self.vcode, scope,name,opts, res.body)
|
59
|
-
xml = res.body
|
60
|
-
end
|
61
|
-
doc = Hpricot.XML(xml)
|
62
|
-
result = EAAL::Result.new(scope.capitalize + name, doc)
|
63
|
-
end
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
def format_url_request(opts)
|
69
|
-
req = ''
|
70
|
-
|
71
|
-
opts.delete_if {|k,v| v.nil? }
|
72
|
-
return req if opts.empty?
|
66
|
+
EAAL.cache.save(self.keyid, self.vcode, scope,name,opts, response.body)
|
67
|
+
xml = response.body
|
68
|
+
end
|
73
69
|
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
if xml
|
71
|
+
doc = Hpricot.XML(xml)
|
72
|
+
result = EAAL::Result.new(scope.capitalize + name, doc)
|
73
|
+
else
|
74
|
+
result = nil
|
77
75
|
end
|
78
|
-
|
76
|
+
end
|
77
|
+
|
78
|
+
def request_path(name)
|
79
|
+
"/#{scope}/#{name}.xml.aspx"
|
79
80
|
end
|
80
81
|
|
81
82
|
end
|
data/lib/eaal/cache/file.rb
CHANGED
@@ -21,8 +21,11 @@ class EAAL::Cache::FileCache
|
|
21
21
|
def filename(userid, apikey, scope, name, args)
|
22
22
|
ret =""
|
23
23
|
args.delete_if { |k,v| (v || "").to_s.length == 0 }
|
24
|
-
h = args.stringify_keys
|
25
|
-
|
24
|
+
# h = args.stringify_keys
|
25
|
+
args.keys.each do |key|
|
26
|
+
args[key.to_s] = args.delete(key)
|
27
|
+
end
|
28
|
+
ret += args.sort.flatten.collect{ |e| e.to_s }.join('_')
|
26
29
|
hash = ret.gsub(/_$/,'')
|
27
30
|
"#{@basepath}#{userid}/#{apikey}/#{scope}/#{name}/Request_#{hash}.xml"
|
28
31
|
end
|
@@ -46,7 +49,7 @@ class EAAL::Cache::FileCache
|
|
46
49
|
# validate cached datas cachedUntil
|
47
50
|
def validate_cache(xml, name)
|
48
51
|
doc = Hpricot.XML(xml)
|
49
|
-
cached_until = (doc/"/eveapi/cachedUntil").inner_html
|
52
|
+
cached_until = Time.parse((doc/"/eveapi/cachedUntil").inner_html)
|
50
53
|
if name == "WalletJournal"
|
51
54
|
result = Time.at(cached_until.to_i + 3600) > Time.now.utc
|
52
55
|
else
|
data/lib/eaal/cache/memcached.rb
CHANGED
@@ -17,7 +17,7 @@ class EAAL::Cache::MemcachedCache
|
|
17
17
|
# the key when we can go get a new copy.
|
18
18
|
def save(userid, apikey, scope, name, args, xml)
|
19
19
|
k = key(userid, apikey, scope, name, args)
|
20
|
-
cached_until = xml.match(/<cachedUntil>(.+)<\/cachedUntil>/)[1]
|
20
|
+
cached_until = Time.parse(xml.match(/<cachedUntil>(.+)<\/cachedUntil>/)[1])
|
21
21
|
expires_in = (name=='WalletJournal' ? cached_until.to_i+3600 : cached_until.to_i )
|
22
22
|
$cache.delete(k)
|
23
23
|
$cache.add(k,xml,expires_in)
|
data/lib/eaal/result.rb
CHANGED
@@ -78,7 +78,8 @@ module EAAL
|
|
78
78
|
}
|
79
79
|
value = container
|
80
80
|
else
|
81
|
-
|
81
|
+
# Mainly to filter HTML tags within description element in corporationsheet.
|
82
|
+
value = element.inner_html.gsub(/(<|<)(.|\n)*?(>|>)/, "")
|
82
83
|
end
|
83
84
|
re = ResultElement.new(key, value)
|
84
85
|
if element.attributes.to_hash.length > 0
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<eveapi version="2">
|
3
|
+
<currentTime>2007-06-18 22:49:01</currentTime>
|
4
|
+
<result>
|
5
|
+
<characterID>12345</characterID>
|
6
|
+
<name>corpslave</name>
|
7
|
+
<race>Minmatar</race>
|
8
|
+
<bloodLine>Brutor</bloodLine>
|
9
|
+
<gender>Female</gender>
|
10
|
+
<corporationName>corpexport Corp</corporationName>
|
11
|
+
<corporationID>150337746</corporationID>
|
12
|
+
<cloneName>Clone Grade Pi</cloneName>
|
13
|
+
<cloneSkillPoints>54600000</cloneSkillPoints>
|
14
|
+
<balance>190210393.87</balance>
|
15
|
+
<attributeEnhancers>
|
16
|
+
<intelligenceBonus>
|
17
|
+
<augmentatorName>Snake Delta</augmentatorName>
|
18
|
+
<augmentatorValue>3</augmentatorValue>
|
19
|
+
</intelligenceBonus>
|
20
|
+
<memoryBonus>
|
21
|
+
<augmentatorName>Halo Beta</augmentatorName>
|
22
|
+
<augmentatorValue>3</augmentatorValue>
|
23
|
+
</memoryBonus>
|
24
|
+
</attributeEnhancers>
|
25
|
+
<attributes>
|
26
|
+
<intelligence>6</intelligence>
|
27
|
+
<memory>4</memory>
|
28
|
+
<charisma>7</charisma>
|
29
|
+
<perception>12</perception>
|
30
|
+
<willpower>10</willpower>
|
31
|
+
</attributes>
|
32
|
+
<rowset name="skills" key="typeID" columns="typeID,skillpoints,level,unpublished">
|
33
|
+
<row typeID="3431" skillpoints="8000" level="3"/>
|
34
|
+
<row typeID="3413" skillpoints="8000" level="3"/>
|
35
|
+
<row typeID="21059" skillpoints="500" level="1"/>
|
36
|
+
<row typeID="3416" skillpoints="8000" level="3"/>
|
37
|
+
<row typeID="3445" skillpoints="277578" unpublished="1"/>
|
38
|
+
</rowset>
|
39
|
+
<rowset name="certificates" key="certificateID" columns="certificateID">
|
40
|
+
<row certificateID="1"/>
|
41
|
+
<row certificateID="5"/>
|
42
|
+
<row certificateID="19"/>
|
43
|
+
<row certificateID="239"/>
|
44
|
+
<row certificateID="282"/>
|
45
|
+
<row certificateID="32"/>
|
46
|
+
<row certificateID="258"/>
|
47
|
+
</rowset>
|
48
|
+
<rowset name="corporationRoles" key="roleID" columns="roleID,roleName">
|
49
|
+
<row roleID="1" roleName="roleDirector" />
|
50
|
+
</rowset>
|
51
|
+
<rowset name="corporationRolesAtHQ" key="roleID" columns="roleID,roleName">
|
52
|
+
<row roleID="1" roleName="roleDirector" />
|
53
|
+
</rowset>
|
54
|
+
<rowset name="corporationRolesAtBase" key="roleID" columns="roleID,roleName">
|
55
|
+
<row roleID="1" roleName="roleDirector" />
|
56
|
+
</rowset>
|
57
|
+
<rowset name="corporationRolesAtOther" key="roleID" columns="roleID,roleName">
|
58
|
+
<row roleID="1" roleName="roleDirector" />
|
59
|
+
</rowset>
|
60
|
+
<rowset name="corporationTitles" key="titleID" columns="titleID,titleName">
|
61
|
+
<row titleID="1" titleName="Member" />
|
62
|
+
</rowset>
|
63
|
+
</result>
|
64
|
+
<cachedUntil>2207-06-18 23:49:01</cachedUntil>
|
65
|
+
</eveapi>
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<eveapi version="2">
|
2
|
+
<currentTime>2008-08-17 06:43:00</currentTime>
|
3
|
+
<result>
|
4
|
+
<currentTQTime offset="0">2008-08-17 06:43:00</currentTQTime>
|
5
|
+
<trainingEndTime>2008-08-17 15:29:44</trainingEndTime>
|
6
|
+
<trainingStartTime>2008-08-15 04:01:16</trainingStartTime>
|
7
|
+
<trainingTypeID>3305</trainingTypeID>
|
8
|
+
<trainingStartSP>24000</trainingStartSP>
|
9
|
+
<trainingDestinationSP>135765</trainingDestinationSP>
|
10
|
+
<trainingToLevel>4</trainingToLevel>
|
11
|
+
<skillInTraining>1</skillInTraining>
|
12
|
+
</result>
|
13
|
+
<cachedUntil>2108-08-17 06:58:00</cachedUntil>
|
14
|
+
</eveapi>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<eveapi version="2">
|
3
|
+
<currentTime>2009-03-18 13:19:43</currentTime>
|
4
|
+
<result>
|
5
|
+
<rowset name="skillqueue" key="queuePosition" columns="queuePosition,typeID,level,startSP,endSP,startTime,endTime">
|
6
|
+
<row queuePosition="1" typeID="11441" level="3" startSP="7072" endSP="40000" startTime="2009-03-18 02:01:06" endTime="2009-03-18 15:19:21" />
|
7
|
+
<row queuePosition="2" typeID="20533" level="4" startSP="112000" endSP="633542" startTime="2009-03-18 15:19:21" endTime="2009-03-30 03:16:14" />
|
8
|
+
</rowset>
|
9
|
+
</result>
|
10
|
+
<cachedUntil>2109-03-18 13:34:43</cachedUntil>
|
11
|
+
</eveapi>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<eveapi version="2">
|
3
|
+
<currentTime>2008-09-03 12:20:19</currentTime>
|
4
|
+
<result>
|
5
|
+
<standingsTo>
|
6
|
+
<rowset name="characters" key="toID" columns="toID,toName,standing">
|
7
|
+
<row toID="123456" toName="Test Ally" standing="1" />
|
8
|
+
<row toID="234567" toName="Test Friend" standing="0.5" />
|
9
|
+
<row toID="345678" toName="Test Enemy" standing="-0.8" />
|
10
|
+
</rowset>
|
11
|
+
<rowset name="corporations" key="toID" columns="toID,toName,standing">
|
12
|
+
<row toID="456789" toName="Test Bad Guy Corp" standing="-1" />
|
13
|
+
</rowset>
|
14
|
+
</standingsTo>
|
15
|
+
<standingsFrom>
|
16
|
+
<rowset name="agents" key="fromID" columns="fromID,fromName,standing">
|
17
|
+
<row fromID="3009841" fromName="Pausent Ansin" standing="0.1" />
|
18
|
+
<row fromID="3009846" fromName="Charie Octienne" standing="0.19" />
|
19
|
+
</rowset>
|
20
|
+
<rowset name="NPCCorporations" key="fromID" columns="fromID,fromName,standing">
|
21
|
+
<row fromID="1000061" fromName="Freedom Extension" standing="0" />
|
22
|
+
<row fromID="1000064" fromName="Carthum Conglomerate" standing="0.34" />
|
23
|
+
<row fromID="1000094" fromName="TransStellar Shipping" standing="0.02" />
|
24
|
+
</rowset>
|
25
|
+
<rowset name="factions" key="fromID" columns="fromID,fromName,standing">
|
26
|
+
<row fromID="500003" fromName="Amarr Empire" standing="-0.1" />
|
27
|
+
<row fromID="500020" fromName="Serpentis" standing="-1" />
|
28
|
+
</rowset>
|
29
|
+
</standingsFrom>
|
30
|
+
</result>
|
31
|
+
<cachedUntil>2025-09-03 15:20:19</cachedUntil>
|
32
|
+
</eveapi>
|
33
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<eveapi version="2">
|
3
|
+
<currentTime>2007-12-02 19:43:40</currentTime>
|
4
|
+
<result>
|
5
|
+
<corporationID>150212025</corporationID>
|
6
|
+
<corporationName>Banana Republic</corporationName>
|
7
|
+
<ticker>BR</ticker>
|
8
|
+
<ceoID>150208955</ceoID>
|
9
|
+
<ceoName>Mark Roled</ceoName>
|
10
|
+
<stationID>60003469</stationID>
|
11
|
+
<stationName>Jita IV - Caldari Business Tribunal Information Center</stationName>
|
12
|
+
<description>Garth's testing corp of awesome sauce, win sauce as it were. In this
|
13
|
+
corp...<br><br>IT HAPPENS ALL OVER</description>
|
14
|
+
<url>some url</url>
|
15
|
+
<allianceID>150430947</allianceID>
|
16
|
+
<allianceName>The Dead Rabbits</allianceName>
|
17
|
+
<taxRate>93.7</taxRate>
|
18
|
+
<memberCount>3</memberCount>
|
19
|
+
<memberLimit>6300</memberLimit>
|
20
|
+
<shares>1</shares>
|
21
|
+
<rowset name="divisions" key="accountKey" columns="accountKey,description">
|
22
|
+
<row accountKey="1000" description="1ST DIVISION" />
|
23
|
+
<row accountKey="1001" description="2ND DIVISION" />
|
24
|
+
<row accountKey="1002" description="HELLO" />
|
25
|
+
<row accountKey="1003" description="DIVISION" />
|
26
|
+
<row accountKey="1004" description="SWEET" />
|
27
|
+
<row accountKey="1005" description="6TH DIVISION" />
|
28
|
+
<row accountKey="1006" description="7TH DIVISION" />
|
29
|
+
</rowset>
|
30
|
+
<rowset name="walletDivisions" key="accountKey" columns="accountKey,description">
|
31
|
+
<row accountKey="1000" description="Master Wallet" />
|
32
|
+
<row accountKey="1001" description="2nd Wallet Division" />
|
33
|
+
<row accountKey="1002" description="3rd Wallet Division" />
|
34
|
+
<row accountKey="1003" description="AYE WALLET?" />
|
35
|
+
<row accountKey="1004" description="5th Wallet Division" />
|
36
|
+
<row accountKey="1005" description="6th Wallet Division" />
|
37
|
+
<row accountKey="1006" description="7th Wallet Division" />
|
38
|
+
</rowset>
|
39
|
+
<logo>
|
40
|
+
<graphicID>0</graphicID>
|
41
|
+
<shape1>448</shape1>
|
42
|
+
<shape2>0</shape2>
|
43
|
+
<shape3>418</shape3>
|
44
|
+
<color1>681</color1>
|
45
|
+
<color2>676</color2>
|
46
|
+
<color3>0</color3>
|
47
|
+
</logo>
|
48
|
+
</result>
|
49
|
+
<cachedUntil>2107-12-03 01:43:40</cachedUntil>
|
50
|
+
</eveapi>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<eveapi version="2">
|
3
|
+
<currentTime>2009-08-26 09:56:41</currentTime>
|
4
|
+
<result>
|
5
|
+
<serverOpen>True</serverOpen>
|
6
|
+
<onlinePlayers>22347</onlinePlayers>
|
7
|
+
</result>
|
8
|
+
<cachedUntil>2109-08-26 09:59:41</cachedUntil>
|
9
|
+
</eveapi>
|
data/test/test_eaal.rb
CHANGED
@@ -28,7 +28,7 @@ class TestEaal < Test::Unit::TestCase
|
|
28
28
|
def test_api_parse_data
|
29
29
|
@api.scope = "account"
|
30
30
|
assert_equal @api.Characters.characters.first.name, "Test Tester"
|
31
|
-
assert_equal @api.Characters.characters.
|
31
|
+
assert_equal @api.Characters.characters[1].corporationID, "7890"
|
32
32
|
@api.scope = "char"
|
33
33
|
assert_equal @api.Killlog(:characterID => 12345).kills.length, 1
|
34
34
|
assert_equal @api.Killlog(:characterID => 12345).kills.first.victim.characterName, "Peter Powers"
|
@@ -75,6 +75,15 @@ class TestEaal < Test::Unit::TestCase
|
|
75
75
|
assert_equal @api.CorporationSheet(:corporationID => 150212025).walletDivisions[0].description, "Master Wallet"
|
76
76
|
end
|
77
77
|
|
78
|
+
def test_cache_only
|
79
|
+
@api.scope = "char"
|
80
|
+
result = @api.ContactList(:characterID => 12345, :cache_only => true)
|
81
|
+
assert_nil result
|
82
|
+
|
83
|
+
assert_not_nil @api.Standings(:characterID => 12345, :cache_only => false)
|
84
|
+
assert_not_nil @api.Standings(:characterID => 12345)
|
85
|
+
end
|
86
|
+
|
78
87
|
# Test to ensure Memcached works
|
79
88
|
def test_memcached
|
80
89
|
# FIXME must check if memcache server is installed... (binary memcache)
|
@@ -94,13 +103,13 @@ class TestEaal < Test::Unit::TestCase
|
|
94
103
|
@api.scope = 'account'
|
95
104
|
|
96
105
|
# store to cache
|
97
|
-
assert_equal EAAL.cache.save(@api.
|
106
|
+
assert_equal EAAL.cache.save(@api.keyid,@api.vcode,@api.scope,'Characters','',xml), "STORED\r\n"
|
98
107
|
|
99
108
|
# check key in cache
|
100
|
-
assert_equal EAAL.cache.key(@api.
|
109
|
+
assert_equal EAAL.cache.key(@api.keyid,@api.vcode,@api.scope,'Characters',''), "testtestaccountCharacters"
|
101
110
|
|
102
111
|
# load from cache
|
103
|
-
assert_equal EAAL.cache.load(@api.
|
112
|
+
assert_equal EAAL.cache.load(@api.keyid,@api.vcode,@api.scope,'Characters',''), xml
|
104
113
|
|
105
114
|
# FIXME high level tests
|
106
115
|
# Should store to cache
|
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.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,16 +9,16 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: hpricot
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '0.6'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,15 +26,15 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: '0.6'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: memcache-client
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 1.7.1
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,15 +42,15 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 1.7.1
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: faraday
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 0.8.4
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,15 +58,15 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.8.4
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: hoe
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: '0'
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,23 +74,23 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: '0'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
name: hoe
|
79
|
+
name: hoe-gemspec
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ! '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
85
|
+
version: '0'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '0'
|
94
94
|
description: ! 'EAAL (Eve API Access Layer) is a ruby library for accessing data of
|
95
95
|
the API of
|
96
96
|
|
@@ -118,16 +118,20 @@ files:
|
|
118
118
|
- lib/eaal/exception.rb
|
119
119
|
- lib/eaal/result.rb
|
120
120
|
- lib/eaal/rowset.rb
|
121
|
-
- script/console
|
122
|
-
- script/destroy
|
123
|
-
- script/generate
|
124
121
|
- test/fixtures/test/test/account/Characters/Request_.xml
|
122
|
+
- test/fixtures/test/test/char/CharacterSheet/Request_.xml
|
123
|
+
- test/fixtures/test/test/char/CharacterSheet/Request_characterID_12345.xml
|
125
124
|
- test/fixtures/test/test/char/Killlog/Request_.xml
|
126
|
-
- test/fixtures/test/test/char/Killlog/
|
125
|
+
- test/fixtures/test/test/char/Killlog/Request_characterID_12345.xml
|
126
|
+
- test/fixtures/test/test/char/SkillInTraining/Request_characterID_12345.xml
|
127
|
+
- test/fixtures/test/test/char/SkillQueue/Request_characterID_12345.xml
|
128
|
+
- test/fixtures/test/test/char/Standings/Request_.xml
|
129
|
+
- test/fixtures/test/test/char/Standings/Request_characterID_12345.xml
|
130
|
+
- test/fixtures/test/test/corp/CorporationSheet/Request_corporationID_150212025.xml
|
127
131
|
- test/fixtures/test/test/eve/AllianceList/Request_.xml
|
132
|
+
- test/fixtures/test/test/server/ServerStatus/Request_.xml
|
128
133
|
- test/test_eaal.rb
|
129
134
|
- test/test_helper.rb
|
130
|
-
- .gemtest
|
131
135
|
homepage: http://eaal.rubyforge.org
|
132
136
|
licenses: []
|
133
137
|
post_install_message:
|
data/.gemtest
DELETED
File without changes
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/eaal.rb'}"
|
9
|
-
puts "Loading eaal gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|