reve 0.0.130 → 0.0.131
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/Rakefile +1 -1
- data/lib/reve.rb +5 -4
- data/test/test_reve.rb +15 -5
- metadata +5 -5
data/Rakefile
CHANGED
@@ -23,7 +23,7 @@ if File.exists?('.git')
|
|
23
23
|
s.rubyforge_project = "reve"
|
24
24
|
s.author = "Lisa Seelye"
|
25
25
|
s.email = "lisa@thedoh.com"
|
26
|
-
s.homepage = "http://
|
26
|
+
s.homepage = "http://github.com/lisa/reve"
|
27
27
|
s.platform = Gem::Platform::RUBY
|
28
28
|
s.summary = "Reve is a Ruby library to interface with the Eve Online API"
|
29
29
|
s.files = FileList["Rakefile","LICENSE", "lib/**/*.rb","reve.rb","tester.rb","init.rb"].to_a
|
data/lib/reve.rb
CHANGED
@@ -112,7 +112,7 @@ module Reve
|
|
112
112
|
|
113
113
|
attr_accessor :key, :userid, :charid
|
114
114
|
attr_accessor :http_user_agent, :save_path
|
115
|
-
attr_reader :current_time, :cached_until, :last_hash
|
115
|
+
attr_reader :current_time, :cached_until, :last_hash, :reve_version
|
116
116
|
|
117
117
|
# Create a new API instance.
|
118
118
|
# current_time and cached_until are meaningful only for the LAST call made.
|
@@ -127,13 +127,14 @@ module Reve
|
|
127
127
|
@charid = (charid || "").to_s
|
128
128
|
|
129
129
|
@save_path = nil
|
130
|
-
|
131
|
-
@http_user_agent = "Reve"
|
130
|
+
|
132
131
|
@max_tries = 3
|
133
132
|
|
134
133
|
@current_time = nil
|
135
134
|
@cached_until = nil
|
136
135
|
@last_hash = nil
|
136
|
+
@reve_version = File.read(File.join(File.dirname(__FILE__),'../','VERSION'))
|
137
|
+
@http_user_agent = "Reve v#{@reve_version}; http://github.com/lisa/reve"
|
137
138
|
end
|
138
139
|
# Save XML to this directory with the format:
|
139
140
|
# :save_path/:userid/:method/:expires_at_in_unixtime.xml
|
@@ -1030,7 +1031,7 @@ module Reve
|
|
1030
1031
|
opts.merge({ :version => 2, :url => nil }) #the uri bit will now ignored in format_url_request
|
1031
1032
|
req_args = format_url_request(opts)
|
1032
1033
|
req = Net::HTTP::Get.new(source.path + req_args)
|
1033
|
-
req['User-Agent'] = @http_referer_agent || "Reve"
|
1034
|
+
req['User-Agent'] = @http_referer_agent || "Reve v#{@reve_version}; http://github.com/lisa/reve"
|
1034
1035
|
|
1035
1036
|
res = nil
|
1036
1037
|
response = nil
|
data/test/test_reve.rb
CHANGED
@@ -1252,11 +1252,14 @@ class TestReve < Test::Unit::TestCase
|
|
1252
1252
|
assert_equal real,time
|
1253
1253
|
end
|
1254
1254
|
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1255
|
+
# It's useful to know the version and we'll stick it in the user agent
|
1256
|
+
# now as well.
|
1257
|
+
def test_reve_version
|
1258
|
+
# Path to Reve version is ../VERSION. We rely on File.read here and in the
|
1259
|
+
# class so it's kind of crummy.
|
1260
|
+
version = File.read(File.join(File.dirname(__FILE__),'../','VERSION'))
|
1261
|
+
assert_equal(@api.reve_version, version)
|
1262
|
+
assert_equal("Reve v#{version}; http://github.com/lisa/reve", @api.http_user_agent)
|
1260
1263
|
end
|
1261
1264
|
|
1262
1265
|
# no need to test corporate cos they're the same.
|
@@ -1308,4 +1311,11 @@ class TestReve < Test::Unit::TestCase
|
|
1308
1311
|
end
|
1309
1312
|
end
|
1310
1313
|
|
1314
|
+
#### All tests above this method.
|
1315
|
+
protected
|
1316
|
+
def get_api(userid = nil, apikey = nil, charid = nil)
|
1317
|
+
api = Reve::API.new(userid, apikey, charid)
|
1318
|
+
api.save_path = nil
|
1319
|
+
api
|
1320
|
+
end
|
1311
1321
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 281
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 131
|
10
|
+
version: 0.0.131
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lisa Seelye
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-22 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -175,7 +175,7 @@ files:
|
|
175
175
|
- test/xml/wallet_balance.xml
|
176
176
|
- test/xml/wallet_journal.xml
|
177
177
|
has_rdoc: true
|
178
|
-
homepage: http://
|
178
|
+
homepage: http://github.com/lisa/reve
|
179
179
|
licenses: []
|
180
180
|
|
181
181
|
post_install_message:
|