neweden 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/init.rb +2 -1
- data/lib/neweden/account.rb +12 -10
- data/lib/neweden/api.rb +6 -4
- data/lib/neweden/character.rb +41 -39
- data/lib/neweden/connection.rb +135 -0
- data/lib/neweden/corporation.rb +21 -19
- data/lib/neweden/errors.rb +12 -10
- data/lib/neweden/eve.rb +22 -20
- data/lib/neweden/image.rb +22 -20
- data/lib/neweden/map.rb +14 -12
- data/lib/neweden/server.rb +6 -4
- data/lib/neweden.rb +2 -133
- data/lib/string_extensions.rb +1 -0
- data/neweden.gemspec +10 -10
- metadata +54 -18
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/init.rb
CHANGED
@@ -13,4 +13,5 @@ require File.join(File.dirname(__FILE__), 'lib', 'neweden', 'eve')
|
|
13
13
|
require File.join(File.dirname(__FILE__), 'lib', 'neweden', 'image')
|
14
14
|
require File.join(File.dirname(__FILE__), 'lib', 'neweden', 'map')
|
15
15
|
require File.join(File.dirname(__FILE__), 'lib', 'neweden', 'server')
|
16
|
-
require File.join(File.dirname(__FILE__), 'lib', 'neweden
|
16
|
+
require File.join(File.dirname(__FILE__), 'lib', 'neweden', 'connection')
|
17
|
+
require File.join(File.dirname(__FILE__), 'lib', 'neweden')
|
data/lib/neweden/account.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module NewEden
|
2
|
+
module Account
|
3
|
+
def account_status
|
4
|
+
request('/account/AccountStatus.xml.aspx')
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def api_key_info
|
8
|
+
request('/account/APIKeyInfo.xml.aspx')
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
def characters
|
12
|
+
request('/account/Characters.xml.aspx')
|
13
|
+
end
|
12
14
|
end
|
13
|
-
end
|
15
|
+
end
|
data/lib/neweden/api.rb
CHANGED
data/lib/neweden/character.rb
CHANGED
@@ -1,48 +1,50 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
module NewEden
|
2
|
+
module Character
|
3
|
+
CHARACTER_ENDPOINTS = %w{ AccountBalance AssetList CharacterSheet ContactList ContactNotifications Contracts FacWarStats
|
4
|
+
IndustryJobs Killlog MailBodies MailingLists MailMessages MarketOrders Medals Notifications Research
|
5
|
+
SkillinTraining SkillQueue Standings WalletJournal WalletTransactions
|
6
|
+
}
|
7
|
+
|
8
|
+
CHARACTER_ENDPOINTS.each do |endpoint|
|
9
|
+
module_eval <<-RUBY
|
10
|
+
def #{endpoint.underscore}(character_id)
|
11
|
+
character_request("/char/#{endpoint}.xml.aspx", character_id)
|
12
|
+
end
|
13
|
+
RUBY
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
def notification_texts(character_id, *notification_ids)
|
17
|
+
request("/char/NotificationTexts.xml.aspx", :post, :characterID => character_id, :IDs => notification_ids.map { |nid| nid.to_s }.join(','))
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
def all_notification_texts(character_id)
|
21
|
+
n_results = self.notifications(character_id)
|
22
|
+
if n_results[:rowset][:row].nil?
|
23
|
+
nil
|
24
|
+
else
|
25
|
+
notification_ids = n_results[:rowset][:row].map { |row| row[:notificationID] }
|
26
|
+
notification_texts(character_id, notification_ids)
|
27
|
+
end
|
26
28
|
end
|
27
|
-
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
def calendar_event_attendees(character_id)
|
31
|
+
upcoming_calendar_events(character_id)
|
32
|
+
character_request("/char/CalendarEventAttendees.xml.aspx", character_id)
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
def upcoming_calendar_events(character_id)
|
36
|
+
@upcoming_events ||= {}
|
37
|
+
@upcoming_events[character_id.to_s] ||= character_request("/char/UpcomingCalendarEvents.xml.aspx", character_id)
|
38
|
+
end
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
alias :factional_warfare_stats :fac_war_stats
|
41
|
+
alias :kill_log :killlog
|
42
|
+
alias :skill_in_training :skillin_training
|
42
43
|
|
43
|
-
|
44
|
+
private
|
44
45
|
|
45
|
-
|
46
|
-
|
46
|
+
def character_request(endpoint, character_id)
|
47
|
+
request(endpoint, :post, :characterID => character_id)
|
48
|
+
end
|
47
49
|
end
|
48
|
-
end
|
50
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
module NewEden
|
2
|
+
class Connection
|
3
|
+
include Account
|
4
|
+
include Api
|
5
|
+
include Character
|
6
|
+
include Corporation
|
7
|
+
include Errors
|
8
|
+
include Eve
|
9
|
+
include Image
|
10
|
+
include Map
|
11
|
+
include Server
|
12
|
+
|
13
|
+
REQUEST_TIMEOUT = 60000 # 60 seconds
|
14
|
+
CACHE_TIMEOUT = 300 # 5 minutes
|
15
|
+
|
16
|
+
attr_reader :key_id, :vcode, :server, :game_server, :test_server, :hydra
|
17
|
+
|
18
|
+
def initialize(key_id, vcode, use_test = false)
|
19
|
+
@key_id = key_id
|
20
|
+
@vcode = vcode
|
21
|
+
@game_server = "api.eveonline.com".freeze
|
22
|
+
@test_server = "apitest.eveonline.com".freeze
|
23
|
+
@server = use_test ? @test_server : @game_server
|
24
|
+
@hydra = Typhoeus::Hydra.new
|
25
|
+
end
|
26
|
+
|
27
|
+
def request(endpoint, method = :post, params = {})
|
28
|
+
xml = handle_response(raw_request(endpoint, method, params))
|
29
|
+
if xml
|
30
|
+
Hash.from_xml((xml/:eveapi/:result).to_s)[:result] # rescue raise XMLParsingError, "No result in set"
|
31
|
+
else
|
32
|
+
raise XMLParsingError, "No XML parsed successfully"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def raw_request(endpoint, method = :post, params = {})
|
37
|
+
url = "https://#{@server}/#{sanitize_endpoint(endpoint)}"
|
38
|
+
case method
|
39
|
+
when :get
|
40
|
+
Typhoeus::Request.get(url, request_params(params))
|
41
|
+
when :put
|
42
|
+
Typhoeus::Request.put(url, request_params(params))
|
43
|
+
when :delete
|
44
|
+
Typhoeus::Request.delete(url, request_params(params))
|
45
|
+
else
|
46
|
+
Typhoeus::Request.post(url, request_params(params))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def handle_response(response)
|
51
|
+
if response.timed_out?
|
52
|
+
raise TimeoutError, "Response timed out."
|
53
|
+
elsif response.code == 0
|
54
|
+
raise NoResponseError, "No response received."
|
55
|
+
elsif response.code == 404
|
56
|
+
raise NotFoundError, "API endpoint not found."
|
57
|
+
elsif !response.success?
|
58
|
+
raise UnsuccessfulResponseError, "Received HTTP response: #{response.code.to_s}"
|
59
|
+
end
|
60
|
+
|
61
|
+
xml = Nokogiri::XML.parse(response.body)
|
62
|
+
|
63
|
+
unless (xml/:eveapi/:error).empty?
|
64
|
+
error_code = (xml/:error).attribute('code').value.to_i
|
65
|
+
case error_code
|
66
|
+
when 203
|
67
|
+
raise AuthenticationError, "Invalid key id or vcode."
|
68
|
+
when 124, 125
|
69
|
+
raise NotInvolvedInFactionalWarfare, "Not involved in factional warfare."
|
70
|
+
else
|
71
|
+
raise ApiError, (xml/:eveapi/:error).children.map { |e| e.to_s.gsub(/\.$/, '') }.join(", ")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
xml
|
76
|
+
end
|
77
|
+
|
78
|
+
def use_game_server
|
79
|
+
@server = @game_server
|
80
|
+
end
|
81
|
+
|
82
|
+
def use_test_server
|
83
|
+
@server = @test_server
|
84
|
+
end
|
85
|
+
|
86
|
+
def request_url
|
87
|
+
"https://#{@server}/#{sanitize_endpoint(endpoint)}"
|
88
|
+
end
|
89
|
+
|
90
|
+
def request_params(params = {})
|
91
|
+
if @key_id.nil? || @vcode.nil?
|
92
|
+
{
|
93
|
+
:headers => { :Accept => "application/xml" },
|
94
|
+
:timeout => REQUEST_TIMEOUT,
|
95
|
+
:cache_timeout => CACHE_TIMEOUT
|
96
|
+
}
|
97
|
+
else
|
98
|
+
{
|
99
|
+
:headers => { :Accept => "application/xml" },
|
100
|
+
:timeout => REQUEST_TIMEOUT,
|
101
|
+
:cache_timeout => CACHE_TIMEOUT,
|
102
|
+
:params => params.merge({ :keyID => @key_id, :vCode => @vcode })
|
103
|
+
}
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def sanitize_endpoint(endpoint)
|
110
|
+
endpoint.strip.gsub(/^\/+/, '')
|
111
|
+
end
|
112
|
+
|
113
|
+
# def symbolize_keys(myhash)
|
114
|
+
# myhash.keys.each do |key|
|
115
|
+
# if myhash[key].kind_of?(Hash)
|
116
|
+
# symbolize_keys(myhash[key])
|
117
|
+
# elsif myhash[key].kind_of?(Array)
|
118
|
+
# myhash[key].each do |element|
|
119
|
+
# symbolize_keys(element) if element.kind_of?(Hash)
|
120
|
+
# end
|
121
|
+
# elsif myhash[key].is_a?(String)
|
122
|
+
# if myhash[key].strip =~ /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/
|
123
|
+
# myhash[key] = DateTime.parse(myhash[key]).to_time
|
124
|
+
# elsif myhash[key].strip =~ /^\d+$/
|
125
|
+
# myhash[key] = myhash[key].to_i
|
126
|
+
# elsif myhash[key].strip =~ /^\d+\.\d+$/
|
127
|
+
# myhash[key] = myhash[key].to_f
|
128
|
+
# end
|
129
|
+
# end
|
130
|
+
# end
|
131
|
+
|
132
|
+
# myhash
|
133
|
+
# end
|
134
|
+
end
|
135
|
+
end
|
data/lib/neweden/corporation.rb
CHANGED
@@ -1,24 +1,26 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module NewEden
|
2
|
+
module Corporation
|
3
|
+
CORPORATION_ENDPOINTS = %w{ AccountBalance AssetList ContactList ContainerLog Contracts CorporationSheet FacWarStats
|
4
|
+
IndustryJobs Killlog MarketOrders Medals MemberMedals MemberSecurity MemberSecurityLog MemberTracking OutpostList
|
5
|
+
OutpostServiceDetail Shareholders Standings StarbaseDetail StarbaseList Titles WalletJournal WalletTransactions
|
6
|
+
}
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
CORPORATION_ENDPOINTS.each do |endpoint|
|
9
|
+
module_eval <<-RUBY
|
10
|
+
def corp_#{endpoint.underscore}(character_id)
|
11
|
+
corportaion_request("/corp/#{endpoint}.xml.aspx", character_id)
|
12
|
+
end
|
13
|
+
RUBY
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
alias :corp_account_balances :corp_account_balance
|
17
|
+
alias :corp_factional_warfare_stats :corp_fac_war_stats
|
18
|
+
alias :corp_kill_log :corp_killlog
|
18
19
|
|
19
|
-
|
20
|
+
private
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def corportaion_request(endpoint, character_id)
|
23
|
+
request(endpoint, :post, :characterID => character_id)
|
24
|
+
end
|
23
25
|
end
|
24
|
-
end
|
26
|
+
end
|
data/lib/neweden/errors.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
1
|
+
module NewEden
|
2
|
+
module Errors
|
3
|
+
class TimeoutError < StandardError; end
|
4
|
+
class AuthenticationError < StandardError; end
|
5
|
+
class NoResponseError < StandardError; end
|
6
|
+
class UnsuccessfulResponseError < StandardError; end
|
7
|
+
class NotFoundError < StandardError; end
|
8
|
+
class ApiError < StandardError; end
|
9
|
+
class XMLParsingError < StandardError; end
|
10
|
+
class NotInvolvedInFactionalWarfare < StandardError; end
|
11
|
+
end
|
12
|
+
end
|
data/lib/neweden/eve.rb
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module NewEden
|
2
|
+
module Eve
|
3
|
+
EVE_ENDPOINTS = %w{ AllianceList CertificateTree ConquerableStationList ErrorList FacWarStats FacWarTopStats RefTypes SkillTree }
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
EVE_ENDPOINTS.each do |endpoint|
|
6
|
+
module_eval <<-RUBY
|
7
|
+
def eve_#{endpoint.underscore}
|
8
|
+
request("/eve/#{endpoint}.xml.aspx")
|
9
|
+
end
|
10
|
+
RUBY
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
def character_ids(*names)
|
14
|
+
request("/eve/CharacterID.xml.aspx", :post, :names => names.join(","))
|
15
|
+
end
|
16
|
+
alias :character_id :character_ids
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
def character_info(character_id)
|
19
|
+
request("/eve/CharacterInfo.xml.aspx", :post, :characterID => character_id)
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def character_names(*ids)
|
23
|
+
request("/eve/CharacterName.xml.aspx", :post, :ids => ids.join(","))
|
24
|
+
end
|
25
|
+
alias :character_name :character_names
|
23
26
|
end
|
24
|
-
|
25
|
-
end
|
27
|
+
end
|
data/lib/neweden/image.rb
CHANGED
@@ -1,24 +1,26 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
module NewEden
|
2
|
+
module Image
|
3
|
+
IMAGE_ENDPOINTS = {
|
4
|
+
:Character => [30, 32, 64, 128, 200, 256, 512, 1024],
|
5
|
+
:Corporation => [30, 32, 64, 128, 256],
|
6
|
+
:Alliance => [30, 32, 64, 128],
|
7
|
+
:InventoryType => [32, 64],
|
8
|
+
:Render => [32, 64, 128, 256, 512]
|
9
|
+
}
|
10
|
+
IMAGE_ENDPOINTS.each_pair do |endpoint, sizes|
|
11
|
+
sizes.each do |size|
|
12
|
+
module_eval <<-RUBY
|
13
|
+
def #{endpoint.to_s.underscore}_image_url_#{size}(relevant_id, extension = :png)
|
14
|
+
image_url(#{endpoint}, relevant_id, #{size}, extension)
|
15
|
+
end
|
16
|
+
RUBY
|
17
|
+
end
|
16
18
|
end
|
17
|
-
end
|
18
19
|
|
19
|
-
|
20
|
+
private
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def image_url(type, relevant_id, size, extension = :png)
|
23
|
+
"http://image.eveonline.com/#{type}/#{relevant_id}_#{size}.#{extension.to_s}"
|
24
|
+
end
|
23
25
|
end
|
24
|
-
end
|
26
|
+
end
|
data/lib/neweden/map.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module NewEden
|
2
|
+
module Map
|
3
|
+
MAP_ENDPOINTS = %w{ FacWarSystems Jumps Kills Sovereignty }
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
MAP_ENDPOINTS.each do |endpoint|
|
6
|
+
module_eval <<-RUBY
|
7
|
+
def map_#{endpoint.to_s.underscore}
|
8
|
+
request("/map/#{endpoint}.xml.aspx")
|
9
|
+
end
|
10
|
+
RUBY
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
13
|
+
alias :map_factional_warfare_systems :map_fac_war_systems
|
14
|
+
alias :factional_warfare_systems :map_fac_war_systems
|
15
|
+
end
|
16
|
+
end
|
data/lib/neweden/server.rb
CHANGED
data/lib/neweden.rb
CHANGED
@@ -1,133 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
include Api
|
4
|
-
include Character
|
5
|
-
include Corporation
|
6
|
-
include Errors
|
7
|
-
include Eve
|
8
|
-
include Image
|
9
|
-
include Map
|
10
|
-
include Server
|
11
|
-
|
12
|
-
REQUEST_TIMEOUT = 60000 # 60 seconds
|
13
|
-
CACHE_TIMEOUT = 300 # 5 minutes
|
14
|
-
|
15
|
-
attr_reader :key_id, :vcode, :server, :game_server, :test_server, :hydra
|
16
|
-
|
17
|
-
def initialize(key_id, vcode, use_test = false)
|
18
|
-
@key_id = key_id
|
19
|
-
@vcode = vcode
|
20
|
-
@game_server = "api.eveonline.com".freeze
|
21
|
-
@test_server = "apitest.eveonline.com".freeze
|
22
|
-
@server = use_test ? @test_server : @game_server
|
23
|
-
@hydra = Typhoeus::Hydra.new
|
24
|
-
end
|
25
|
-
|
26
|
-
def request(endpoint, method = :post, params = {})
|
27
|
-
xml = handle_response(raw_request(endpoint, method, params))
|
28
|
-
if xml
|
29
|
-
Hash.from_xml((xml/:eveapi/:result).to_s)[:result] # rescue raise XMLParsingError, "No result in set"
|
30
|
-
else
|
31
|
-
raise XMLParsingError, "No XML parsed successfully"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def raw_request(endpoint, method = :post, params = {})
|
36
|
-
url = "https://#{@server}/#{sanitize_endpoint(endpoint)}"
|
37
|
-
case method
|
38
|
-
when :get
|
39
|
-
Typhoeus::Request.get(url, request_params(params))
|
40
|
-
when :put
|
41
|
-
Typhoeus::Request.put(url, request_params(params))
|
42
|
-
when :delete
|
43
|
-
Typhoeus::Request.delete(url, request_params(params))
|
44
|
-
else
|
45
|
-
Typhoeus::Request.post(url, request_params(params))
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def handle_response(response)
|
50
|
-
if response.timed_out?
|
51
|
-
raise TimeoutError, "Response timed out."
|
52
|
-
elsif response.code == 0
|
53
|
-
raise NoResponseError, "No response received."
|
54
|
-
elsif response.code == 404
|
55
|
-
raise NotFoundError, "API endpoint not found."
|
56
|
-
elsif !response.success?
|
57
|
-
raise UnsuccessfulResponseError, "Received HTTP response: #{response.code.to_s}"
|
58
|
-
end
|
59
|
-
|
60
|
-
xml = Nokogiri::XML.parse(response.body)
|
61
|
-
|
62
|
-
unless (xml/:eveapi/:error).empty?
|
63
|
-
error_code = (xml/:error).attribute('code').value.to_i
|
64
|
-
case error_code
|
65
|
-
when 203
|
66
|
-
raise AuthenticationError, "Invalid key id or vcode."
|
67
|
-
when 124, 125
|
68
|
-
raise NotInvolvedInFactionalWarfare, "Not involved in factional warfare."
|
69
|
-
else
|
70
|
-
raise ApiError, (xml/:eveapi/:error).children.map { |e| e.to_s.gsub(/\.$/, '') }.join(", ")
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
xml
|
75
|
-
end
|
76
|
-
|
77
|
-
def use_game_server
|
78
|
-
@server = @game_server
|
79
|
-
end
|
80
|
-
|
81
|
-
def use_test_server
|
82
|
-
@server = @test_server
|
83
|
-
end
|
84
|
-
|
85
|
-
def request_url
|
86
|
-
"https://#{@server}/#{sanitize_endpoint(endpoint)}"
|
87
|
-
end
|
88
|
-
|
89
|
-
def request_params(params = {})
|
90
|
-
if @key_id.nil? || @vcode.nil?
|
91
|
-
{
|
92
|
-
:headers => { :Accept => "application/xml" },
|
93
|
-
:timeout => REQUEST_TIMEOUT,
|
94
|
-
:cache_timeout => CACHE_TIMEOUT
|
95
|
-
}
|
96
|
-
else
|
97
|
-
{
|
98
|
-
:headers => { :Accept => "application/xml" },
|
99
|
-
:timeout => REQUEST_TIMEOUT,
|
100
|
-
:cache_timeout => CACHE_TIMEOUT,
|
101
|
-
:params => params.merge({ :keyID => @key_id, :vCode => @vcode })
|
102
|
-
}
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
private
|
107
|
-
|
108
|
-
def sanitize_endpoint(endpoint)
|
109
|
-
endpoint.strip.gsub(/^\/+/, '')
|
110
|
-
end
|
111
|
-
|
112
|
-
# def symbolize_keys(myhash)
|
113
|
-
# myhash.keys.each do |key|
|
114
|
-
# if myhash[key].kind_of?(Hash)
|
115
|
-
# symbolize_keys(myhash[key])
|
116
|
-
# elsif myhash[key].kind_of?(Array)
|
117
|
-
# myhash[key].each do |element|
|
118
|
-
# symbolize_keys(element) if element.kind_of?(Hash)
|
119
|
-
# end
|
120
|
-
# elsif myhash[key].is_a?(String)
|
121
|
-
# if myhash[key].strip =~ /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/
|
122
|
-
# myhash[key] = DateTime.parse(myhash[key]).to_time
|
123
|
-
# elsif myhash[key].strip =~ /^\d+$/
|
124
|
-
# myhash[key] = myhash[key].to_i
|
125
|
-
# elsif myhash[key].strip =~ /^\d+\.\d+$/
|
126
|
-
# myhash[key] = myhash[key].to_f
|
127
|
-
# end
|
128
|
-
# end
|
129
|
-
# end
|
130
|
-
|
131
|
-
# myhash
|
132
|
-
# end
|
133
|
-
end
|
1
|
+
module NewEden
|
2
|
+
end
|
data/lib/string_extensions.rb
CHANGED
data/neweden.gemspec
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.1.
|
7
|
+
s.name = "neweden"
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date =
|
13
|
-
s.email =
|
11
|
+
s.authors = ["Jason Adams"]
|
12
|
+
s.date = "2012-05-05"
|
13
|
+
s.email = "jasonmadams@gmail.com"
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt",
|
16
16
|
"README.md"
|
@@ -43,11 +43,11 @@ Gem::Specification.new do |s|
|
|
43
43
|
"test/test_neweden.rb",
|
44
44
|
"test/test_neweden_live.rb"
|
45
45
|
]
|
46
|
-
s.homepage =
|
47
|
-
s.licenses = [
|
48
|
-
s.require_paths = [
|
49
|
-
s.rubygems_version =
|
50
|
-
s.summary =
|
46
|
+
s.homepage = "http://github.com/ealdent/neweden"
|
47
|
+
s.licenses = ["MIT"]
|
48
|
+
s.require_paths = ["lib"]
|
49
|
+
s.rubygems_version = "1.8.23"
|
50
|
+
s.summary = "Ruby library for accessing Eve Online API"
|
51
51
|
|
52
52
|
if s.respond_to? :specification_version then
|
53
53
|
s.specification_version = 3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neweden
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: nokogiri
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: json
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: shoulda-context
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: bundler
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: jeweler
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: awesome_print
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,7 +117,12 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
description:
|
92
127
|
email: jasonmadams@gmail.com
|
93
128
|
executables: []
|
@@ -109,6 +144,7 @@ files:
|
|
109
144
|
- lib/neweden/account.rb
|
110
145
|
- lib/neweden/api.rb
|
111
146
|
- lib/neweden/character.rb
|
147
|
+
- lib/neweden/connection.rb
|
112
148
|
- lib/neweden/corporation.rb
|
113
149
|
- lib/neweden/errors.rb
|
114
150
|
- lib/neweden/eve.rb
|
@@ -137,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
173
|
version: '0'
|
138
174
|
segments:
|
139
175
|
- 0
|
140
|
-
hash: -
|
176
|
+
hash: -2985683257398667345
|
141
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
178
|
none: false
|
143
179
|
requirements:
|
@@ -146,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
182
|
version: '0'
|
147
183
|
requirements: []
|
148
184
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
185
|
+
rubygems_version: 1.8.23
|
150
186
|
signing_key:
|
151
187
|
specification_version: 3
|
152
188
|
summary: Ruby library for accessing Eve Online API
|