dsander-reve 0.0.137 → 0.0.138
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/reve.rb +5 -5
- data/test/test_reve.rb +1 -1
- data/test/xml/corp_membersecurity.xml +44 -42
- metadata +1 -1
data/lib/reve.rb
CHANGED
@@ -614,7 +614,7 @@ module Reve
|
|
614
614
|
h = compute_hash(args.merge(:url => @@personal_assets_url))
|
615
615
|
return h if h
|
616
616
|
xml = process_query(nil,opts[:url] || @@personal_assets_url,true,args)
|
617
|
-
self.recur_through_assets(xml.search("/eveapi/result/rowset[@name='assets']/row")
|
617
|
+
self.recur_through_assets(xml.search("/eveapi/result/rowset[@name='assets']/row"))
|
618
618
|
end
|
619
619
|
|
620
620
|
# Get a list of the Corporate Assets. Pass the characterid of the Corporate member See also assets_list method
|
@@ -623,7 +623,7 @@ module Reve
|
|
623
623
|
h = compute_hash(args.merge(:url => @@corporate_assets_url))
|
624
624
|
return h if h
|
625
625
|
xml = process_query(nil,opts[:url] || @@corporate_assets_url,true,args)
|
626
|
-
self.recur_through_assets(xml.search("/eveapi/result/rowset[@name='assets']/row")
|
626
|
+
self.recur_through_assets(xml.search("/eveapi/result/rowset[@name='assets']/row"))
|
627
627
|
end
|
628
628
|
|
629
629
|
# Returns a Character list for the associated key and userid from
|
@@ -819,7 +819,7 @@ module Reve
|
|
819
819
|
xml = process_query(nil,opts[:url] || @@corporation_member_security_url,true,args)
|
820
820
|
|
821
821
|
cmc = Reve::Classes::CorporationMemberSecurity.new
|
822
|
-
xml.search("/eveapi/result/
|
822
|
+
xml.search("/eveapi/result/rowset/row").each do |member|
|
823
823
|
mem = Reve::Classes::CorporationMember.new(member)
|
824
824
|
cmc.members << mem
|
825
825
|
[:roles, :grantableRoles, :rolesAtHQ, :grantableRolesAtHQ, :rolesAtBase, :grantableRolesAtBase, :rolesAtOther, :grantableRolesAtOther].each do |rowset|
|
@@ -975,10 +975,10 @@ module Reve
|
|
975
975
|
|
976
976
|
protected
|
977
977
|
# Helper method to handle nested assets
|
978
|
-
def recur_through_assets(rows
|
978
|
+
def recur_through_assets(rows)
|
979
979
|
assets = []
|
980
980
|
rows.each do |container|
|
981
|
-
|
981
|
+
unless container.empty?
|
982
982
|
asset_container = Reve::Classes::AssetContainer.new(container)
|
983
983
|
asset_container.assets = self.recur_through_assets(container.search("/rowset/row"))
|
984
984
|
assets << asset_container
|
data/test/test_reve.rb
CHANGED
@@ -1051,7 +1051,7 @@ class TestReve < Test::Unit::TestCase
|
|
1051
1051
|
def test_corporate_member_security
|
1052
1052
|
Reve::API.corporation_member_security_url = XML_BASE + 'corp_membersecurity.xml'
|
1053
1053
|
members = nil
|
1054
|
-
assert_nothing_raised do
|
1054
|
+
assert_nothing_raised do
|
1055
1055
|
members = @api.corporate_member_security
|
1056
1056
|
end
|
1057
1057
|
assert_equal 2, members.members.size
|
@@ -2,48 +2,50 @@
|
|
2
2
|
<eveapi version="2">
|
3
3
|
<currentTime>2009-01-13 20:56:21</currentTime>
|
4
4
|
<result>
|
5
|
-
<
|
6
|
-
<
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
5
|
+
<rowset name="members" key="characterID" columns="characterID, name">
|
6
|
+
<row characterID="194329244" name="Test Pilot">
|
7
|
+
<rowset name="roles" key="roleID" columns="roleID,roleName">
|
8
|
+
<row roleID="1" roleName="roleDirector" />
|
9
|
+
</rowset>
|
10
|
+
|
11
|
+
<rowset name="grantableRoles" key="roleID" columns="roleID,roleName" />
|
12
|
+
<rowset name="rolesAtHQ" key="roleID" columns="roleID,roleName">
|
13
|
+
<row roleID="1" roleName="roleDirector" />
|
14
|
+
</rowset>
|
15
|
+
<rowset name="grantableRolesAtHQ" key="roleID" columns="roleID,roleName" />
|
16
|
+
<rowset name="rolesAtBase" key="roleID" columns="roleID,roleName">
|
17
|
+
<row roleID="1" roleName="roleDirector" />
|
18
|
+
</rowset>
|
19
|
+
<rowset name="grantableRolesAtBase" key="roleID" columns="roleID,roleName" />
|
20
|
+
|
21
|
+
<rowset name="rolesAtOther" key="roleID" columns="roleID,roleName">
|
22
|
+
<row roleID="1" roleName="roleDirector" />
|
23
|
+
</rowset>
|
24
|
+
<rowset name="grantableRolesAtOther" key="roleID" columns="roleID,roleName" />
|
25
|
+
<rowset name="titles" key="titleID" columns="titleID,titleName">
|
26
|
+
<row titleID="1" titleName="01 Pilot" />
|
27
|
+
</rowset>
|
28
|
+
</row>
|
29
|
+
<row characterID="201320849" name="Test Pilot 2">
|
30
|
+
|
31
|
+
<rowset name="roles" key="roleID" columns="roleID,roleName" />
|
32
|
+
<rowset name="grantableRoles" key="roleID" columns="roleID,roleName" />
|
33
|
+
<rowset name="rolesAtHQ" key="roleID" columns="roleID,roleName" />
|
34
|
+
<rowset name="grantableRolesAtHQ" key="roleID" columns="roleID,roleName" />
|
35
|
+
<rowset name="rolesAtBase" key="roleID" columns="roleID,roleName" />
|
36
|
+
<rowset name="grantableRolesAtBase" key="roleID" columns="roleID,roleName" />
|
37
|
+
<rowset name="rolesAtOther" key="roleID" columns="roleID,roleName" />
|
38
|
+
<rowset name="grantableRolesAtOther" key="roleID" columns="roleID,roleName" />
|
39
|
+
<rowset name="titles" key="titleID" columns="titleID,titleName">
|
40
|
+
|
41
|
+
<row titleID="1" titleName="01" />
|
42
|
+
<row titleID="2" titleName="02" />
|
43
|
+
<row titleID="64" titleName="07" />
|
44
|
+
<row titleID="256" titleName="09" />
|
45
|
+
<row titleID="512" titleName="10" />
|
46
|
+
</rowset>
|
47
|
+
</row>
|
48
|
+
</rowset>
|
47
49
|
</result>
|
48
50
|
<cachedUntil>2009-01-13 21:56:22</cachedUntil>
|
49
51
|
</eveapi>
|