reve 0.0.86 → 0.0.91
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/reve/classes.rb +1 -1
- data/lib/reve.rb +17 -16
- data/test/test_reve.rb +6 -1
- metadata +2 -2
data/lib/reve/classes.rb
CHANGED
@@ -531,7 +531,7 @@ module Reve #:nodoc:
|
|
531
531
|
attr_reader :system_id, :ship_kills, :faction_kills, :pod_kills
|
532
532
|
def initialize(elem) #:nodoc:
|
533
533
|
@system_id = elem['solarSystemID'].to_i
|
534
|
-
@ship_kills = elem['
|
534
|
+
@ship_kills = elem['shipKills'].to_i
|
535
535
|
@faction_kills = elem['factionKills'].to_i
|
536
536
|
@pod_kills = elem['podKills'].to_i
|
537
537
|
end
|
data/lib/reve.rb
CHANGED
@@ -308,7 +308,7 @@ module Reve
|
|
308
308
|
# Does big brother tracking from
|
309
309
|
# http://api.eve-online.com/corp/MemberTracking.xml.aspx
|
310
310
|
# Expects:
|
311
|
-
# *
|
311
|
+
# * characterid ( Integer | String ) - Look at players in this Character's Corporation
|
312
312
|
# See also: Reve::Classes::MemberTracking
|
313
313
|
def member_tracking(opts = {:characterid => nil})
|
314
314
|
args = postfields(opts)
|
@@ -320,7 +320,7 @@ module Reve
|
|
320
320
|
# Gets one's own personal WalletBalance from
|
321
321
|
# http://api.eve-online.com/char/AccountBalance.xml.aspx
|
322
322
|
# Expects:
|
323
|
-
# *
|
323
|
+
# * characterid ( Integer | String ) - Look at this player's WalletBalance
|
324
324
|
# See also: Reve::Classes::WalletBalance and corporate_wallet_balance
|
325
325
|
def personal_wallet_balance(opts = { :characterid => nil })
|
326
326
|
args = postfields(opts)
|
@@ -332,7 +332,7 @@ module Reve
|
|
332
332
|
# Gets one's corporate WalletBalance from
|
333
333
|
# http://api.eve-online.com/corp/AccountBalance.xml.aspx
|
334
334
|
# Expects:
|
335
|
-
# *
|
335
|
+
# * characterid ( Integer | String ) - Look at WalletBalance objects from this Character's Corporation
|
336
336
|
# See also: Reve::Classes::WalletBalance and personal_wallet_balance
|
337
337
|
def corporate_wallet_balance(opts = { :characterd => nil })
|
338
338
|
args = postfields(opts)
|
@@ -359,7 +359,7 @@ module Reve
|
|
359
359
|
# http://api.eve-online.com/corp/WalletTransactions.xml.aspx
|
360
360
|
# Expects:
|
361
361
|
# * account_key ( Integer | String ) - Account key (1000-1006) to look at.
|
362
|
-
# *
|
362
|
+
# * characterid ( Integer | String ) - Look at WalletTransaction objects from this Character's Corporation
|
363
363
|
# * before_trans_id ( Integer | String ) - Gets a list of WalletTransaction objects from before this Transaction ID.
|
364
364
|
# See also: Reve::Classes::WalletTransaction and
|
365
365
|
# personal_wallet_transactions
|
@@ -374,7 +374,7 @@ module Reve
|
|
374
374
|
# http://api.eve-online.com/corp/WalletJournal.xml.aspx
|
375
375
|
# Expects:
|
376
376
|
# * account_key ( Integer | String ) - Account key (1000-1006) to look at.
|
377
|
-
# *
|
377
|
+
# * characterid ( Integer | String ) - Look at WalletJournal objects from this Character's Corporation
|
378
378
|
# * before_ref_id ( Integer | String ) - Gets a list of WalletTransaction objects from before this RefID.
|
379
379
|
# See also: Reve::Classes::WalletJournal and personal_wallet_journal
|
380
380
|
def corporate_wallet_journal(opts = {:accountkey => nil, :characterid => nil, :beforerefid => nil})
|
@@ -387,7 +387,7 @@ module Reve
|
|
387
387
|
# Gets one's own personal WalletJournal list from
|
388
388
|
# http://api.eve-online.com/char/WalletJournal.xml.aspx
|
389
389
|
# Expects:
|
390
|
-
# *
|
390
|
+
# * characterid ( Integer | String ) - Look at this player's WalletJournal list
|
391
391
|
# * before_ref_id ( Integer | String ) - Gets a list of WalletJournal objects from before this RefID.
|
392
392
|
# See also: Reve::Classes::WalletJournal and corporate_wallet_journal
|
393
393
|
def personal_wallet_journal(opts = { :characterid => nil, :beforerefid => nil} )
|
@@ -446,7 +446,7 @@ module Reve
|
|
446
446
|
# Gets the SkillInTraining from
|
447
447
|
# http://api.eve-online.com/char/SkillInTraining.xml.aspx
|
448
448
|
# Expects:
|
449
|
-
# *
|
449
|
+
# * characterid ( Integer | String ) - Get the SkillInTraining for this Character
|
450
450
|
# See also: Reve::Classes::SkillInTraining
|
451
451
|
def skill_in_training(opts = {:characterid => nil})
|
452
452
|
args = postfields(opts)
|
@@ -462,10 +462,10 @@ module Reve
|
|
462
462
|
Reve::Classes::SkillInTraining.new(h)
|
463
463
|
end
|
464
464
|
|
465
|
-
# Returns a list of Reve::Classes::Starbase for
|
465
|
+
# Returns a list of Reve::Classes::Starbase for characterid's Corporation.
|
466
466
|
# http://api.eve-online.com/corp/StarbaseList.xml.aspx
|
467
467
|
# Expects:
|
468
|
-
# *
|
468
|
+
# * characterid ( Integer | String ) - Get the Starbase list for this character's Corporation
|
469
469
|
# See also Reve::Classes::Starbase
|
470
470
|
def starbases(opts = { :characterid => nil})
|
471
471
|
args = postfields(opts)
|
@@ -477,7 +477,7 @@ module Reve
|
|
477
477
|
# Returns the fuel status for the Starbase whose item id is starbase_id
|
478
478
|
# http://api.eve-online.com/corp/StarbaseDetail.xml.aspx
|
479
479
|
# Expects:
|
480
|
-
# *
|
480
|
+
# * characterid ( Integer | String ) - Get the Starbase associated wih this character's Corporation
|
481
481
|
# * starbase_id ( Integer ) - Get the fuel for this Starbase. This is the Starbase's itemid.
|
482
482
|
# See also Reve::Classes::StarbaseFuel
|
483
483
|
def starbase_fuel(opts = { :characterid => nil, :starbaseid => nil })
|
@@ -641,9 +641,9 @@ module Reve
|
|
641
641
|
# TODO: Consider moving this whole thing into process_query to avoid
|
642
642
|
# calling this in every method!
|
643
643
|
def postfields(opts = {})
|
644
|
-
ret = { "
|
644
|
+
ret = { "userid" => @userid, "apikey" => @key, "characterid" => @charid }.merge(opts.stringify_keys)
|
645
645
|
ret.inject({}) do |n, (k,v)|
|
646
|
-
n[k] = v.to_s if v
|
646
|
+
n[k.downcase] = v.to_s if v
|
647
647
|
n
|
648
648
|
end
|
649
649
|
end
|
@@ -656,10 +656,11 @@ module Reve
|
|
656
656
|
# nil will be returned
|
657
657
|
# TODO: Consider moving this whole thing into process_query before the URI parsing
|
658
658
|
def compute_hash(args = {})
|
659
|
-
|
660
|
-
args.
|
661
|
-
|
662
|
-
args.
|
659
|
+
args.stringify_keys!
|
660
|
+
return nil unless args.include?('just_hash')
|
661
|
+
args.delete('just_hash')
|
662
|
+
url = args['url'].kind_of?(URI) ? args['url'].path : args['url']
|
663
|
+
args.delete('url')
|
663
664
|
spl = url.split '/'
|
664
665
|
ret = (spl[-2] + '/' + spl[-1]) + ':'
|
665
666
|
args.delete_if { |k,v| (v || "").to_s.length == 0 } # Delete keys if the value is nil
|
data/test/test_reve.rb
CHANGED
@@ -51,6 +51,11 @@ class TestReve < Test::Unit::TestCase
|
|
51
51
|
assert_instance_of String, h
|
52
52
|
assert_equal "xml/alliances.xml", h
|
53
53
|
end
|
54
|
+
|
55
|
+
def test_charid_default_works_when_characterid_is_nil
|
56
|
+
# this line of code is wrong on so many levels.
|
57
|
+
assert_equal("CharID", Reve::API.new('uid','key','CharID').send(:postfields,{})['characterid'])
|
58
|
+
end
|
54
59
|
|
55
60
|
def test_makes_a_complex_hash
|
56
61
|
Reve::API.corporate_wallet_trans_url = XML_BASE + 'market_transactions.xml'
|
@@ -58,7 +63,7 @@ class TestReve < Test::Unit::TestCase
|
|
58
63
|
@api.key = 'aaa'
|
59
64
|
h = @api.corporate_wallet_transactions :accountkey => '1001', :characterid => 123, :beforerefid => 456, :just_hash => true
|
60
65
|
assert_instance_of String, h
|
61
|
-
assert_equal 'xml/market_transactions.xml:accountkey:1001:
|
66
|
+
assert_equal 'xml/market_transactions.xml:accountkey:1001:apikey:aaa:beforerefid:456:characterid:123:userid:999',h
|
62
67
|
end
|
63
68
|
|
64
69
|
def test_bad_xml
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: reve
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2008-
|
6
|
+
version: 0.0.91
|
7
|
+
date: 2008-06-06 00:00:00 -04:00
|
8
8
|
summary: Reve is a Ruby library to interface with the Eve Online API
|
9
9
|
require_paths:
|
10
10
|
- lib
|