dsander-reve 0.0.121 → 0.0.122
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/reve/classes.rb +5 -1
- data/lib/reve/extensions.rb +27 -0
- data/test/xml/mail_messages.xml +6 -6
- metadata +19 -9
data/lib/reve/classes.rb
CHANGED
@@ -435,6 +435,8 @@ module Reve #:nodoc:
|
|
435
435
|
@flag = elem['flag'].to_i
|
436
436
|
@singleton = elem['singleton'] == "1"
|
437
437
|
@assets = []
|
438
|
+
#@xml_hash = elem.to_s.gsub(/\n|\r|\s/,'')
|
439
|
+
#@xml_hash = ::Digest::SHA1.hexdigest elem.to_s.gsub(/\n|\r|\s/,'')
|
438
440
|
end
|
439
441
|
end
|
440
442
|
|
@@ -453,6 +455,8 @@ module Reve #:nodoc:
|
|
453
455
|
@quantity = elem['quantity'].to_i
|
454
456
|
@flag = elem['flag'].to_i
|
455
457
|
@singleton = elem['singleton'].to_i
|
458
|
+
#@xml_hash = elem.to_s.gsub(/\n|\r|\s/,'')
|
459
|
+
#@xml_hash = ::Digest::SHA1.hexdigest elem.to_s.gsub(/\n|\r|\s/,'')
|
456
460
|
end
|
457
461
|
end
|
458
462
|
|
@@ -1476,7 +1480,7 @@ module Reve #:nodoc:
|
|
1476
1480
|
@title = elem['title']
|
1477
1481
|
@to_corp_or_alliance_id = elem['toCorpOrAllianceID'] == '' ? nil : elem['toCorpOrAllianceID'].to_i
|
1478
1482
|
@to_character_ids = elem['toCharacterIDs'] == '' ? nil : elem['toCharacterIDs'].split(',').collect {|id| id.to_i }
|
1479
|
-
@to_list_ids = elem['
|
1483
|
+
@to_list_ids = elem['toListID'] == '' ? nil : elem['toListID'].split(',').collect {|id| id.to_i }
|
1480
1484
|
@read = elem['read'] == '1'
|
1481
1485
|
end
|
1482
1486
|
end
|
data/lib/reve/extensions.rb
CHANGED
@@ -87,6 +87,29 @@ module Reve #:nodoc:
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
90
|
+
module Array
|
91
|
+
def to_hash(space = 0)
|
92
|
+
hash = ""
|
93
|
+
each do |c|
|
94
|
+
vars = []
|
95
|
+
c.instance_variables.each do |m|
|
96
|
+
data = c.instance_variable_get(m)
|
97
|
+
if data.kind_of? Array
|
98
|
+
if data.length == 0
|
99
|
+
vars << "#{m} => {}"
|
100
|
+
else
|
101
|
+
vars << "#{m} => {\n#{data.to_hash(space + 1)}}"
|
102
|
+
end
|
103
|
+
else
|
104
|
+
vars << " #{m} => #{data}"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
hash << "#{' ' * space}{#{vars.join(',')}}\n"
|
108
|
+
end
|
109
|
+
hash
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
90
113
|
end
|
91
114
|
end
|
92
115
|
|
@@ -106,6 +129,10 @@ class NilClass #:nodoc:
|
|
106
129
|
include Reve::Extensions::NilClass
|
107
130
|
end
|
108
131
|
|
132
|
+
class Array #:nodoc:
|
133
|
+
include Reve::Extensions::Array
|
134
|
+
end
|
135
|
+
|
109
136
|
class Object
|
110
137
|
def rsend(*args, &block)
|
111
138
|
obj = self
|
data/test/xml/mail_messages.xml
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
<eveapi version="2">
|
3
3
|
<currentTime>2009-12-02 00:46:10</currentTime>
|
4
4
|
<result>
|
5
|
-
<rowset name="mailMessages" key="messageID" columns="messageID,senderID,sentDate,title,toCorpOrAllianceID,toCharacterIDs,
|
6
|
-
<row messageID="290285276" senderID="1" sentDate="2009-12-01 01:04:00" title="Corp mail" toCorpOrAllianceID="4" toCharacterIDs=""
|
7
|
-
<row messageID="290285275" senderID="2" sentDate="2009-12-01 01:04:00" title="Personal mail" toCorpOrAllianceID="" toCharacterIDs="5"
|
8
|
-
<row messageID="290285274" senderID="2" sentDate="2009-12-01 01:04:00" title="Message to mailing list" toCorpOrAllianceID="" toCharacterIDs=""
|
9
|
-
<row messageID="290285278" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Personal mail" toCorpOrAllianceID="" toCharacterIDs="5,6,7"
|
10
|
-
<row messageID="290285279" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Message to mailing list" toCorpOrAllianceID="" toCharacterIDs=""
|
5
|
+
<rowset name="mailMessages" key="messageID" columns="messageID,senderID,sentDate,title,toCorpOrAllianceID,toCharacterIDs,toListID,read">
|
6
|
+
<row messageID="290285276" senderID="1" sentDate="2009-12-01 01:04:00" title="Corp mail" toCorpOrAllianceID="4" toCharacterIDs="" toListID="" read="1" />
|
7
|
+
<row messageID="290285275" senderID="2" sentDate="2009-12-01 01:04:00" title="Personal mail" toCorpOrAllianceID="" toCharacterIDs="5" toListID="" read="1" />
|
8
|
+
<row messageID="290285274" senderID="2" sentDate="2009-12-01 01:04:00" title="Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439" read="0" />
|
9
|
+
<row messageID="290285278" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Personal mail" toCorpOrAllianceID="" toCharacterIDs="5,6,7" toListID="" read="1" />
|
10
|
+
<row messageID="290285279" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439,141157801" read="0" />
|
11
11
|
</rowset>
|
12
12
|
</result>
|
13
13
|
<cachedUntil>2009-12-02 01:16:10</cachedUntil>
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dsander-reve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 122
|
9
|
+
version: 0.0.122
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Lisa Seelye
|
@@ -9,19 +14,22 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2009-12-04 00:00:00 +
|
17
|
+
date: 2009-12-04 00:00:00 +00:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: hpricot
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 6
|
23
30
|
version: "0.6"
|
24
|
-
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
25
33
|
description:
|
26
34
|
email: lisa@thedoh.com
|
27
35
|
executables: []
|
@@ -54,18 +62,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
62
|
requirements:
|
55
63
|
- - ">="
|
56
64
|
- !ruby/object:Gem::Version
|
65
|
+
segments:
|
66
|
+
- 0
|
57
67
|
version: "0"
|
58
|
-
version:
|
59
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
69
|
requirements:
|
61
70
|
- - ">="
|
62
71
|
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
63
74
|
version: "0"
|
64
|
-
version:
|
65
75
|
requirements: []
|
66
76
|
|
67
77
|
rubyforge_project: reve
|
68
|
-
rubygems_version: 1.3.
|
78
|
+
rubygems_version: 1.3.6
|
69
79
|
signing_key:
|
70
80
|
specification_version: 3
|
71
81
|
summary: Reve is a Ruby library to interface with the Eve Online API
|