eve_online 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -2
- data/.rubocop.yml +8 -15
- data/.rubocop_general.yml +10 -2
- data/.ruby-version +1 -0
- data/.travis.yml +15 -16
- data/CHANGELOG.md +60 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +170 -0
- data/LICENSE.txt +1 -1
- data/README.md +569 -587
- data/Rakefile +2 -0
- data/eve_online.gemspec +7 -6
- data/gemfiles/activesupport_42.gemfile +3 -1
- data/gemfiles/activesupport_50.gemfile +3 -1
- data/gemfiles/activesupport_51.gemfile +3 -1
- data/gemfiles/activesupport_52.gemfile +4 -2
- data/gemfiles/activesupport_edge.gemfile +3 -1
- data/lib/eve_online.rb +23 -40
- data/lib/eve_online/esi/alliance.rb +3 -1
- data/lib/eve_online/esi/alliance_corporations.rb +27 -0
- data/lib/eve_online/esi/alliance_icon.rb +4 -2
- data/lib/eve_online/esi/alliances.rb +19 -0
- data/lib/eve_online/esi/alliances_names.rb +32 -0
- data/lib/eve_online/esi/ancestries.rb +24 -0
- data/lib/eve_online/esi/base.rb +3 -0
- data/lib/eve_online/esi/bloodlines.rb +3 -1
- data/lib/eve_online/esi/character.rb +3 -1
- data/lib/eve_online/esi/character_assets.rb +3 -1
- data/lib/eve_online/esi/character_attributes.rb +3 -1
- data/lib/eve_online/esi/character_blueprints.rb +3 -1
- data/lib/eve_online/esi/character_bookmark_folders.rb +34 -0
- data/lib/eve_online/esi/character_bookmarks.rb +34 -0
- data/lib/eve_online/esi/character_calendar.rb +34 -0
- data/lib/eve_online/esi/character_clones.rb +3 -1
- data/lib/eve_online/esi/character_fatigue.rb +3 -1
- data/lib/eve_online/esi/character_implants.rb +3 -1
- data/lib/eve_online/esi/character_industry_jobs.rb +4 -2
- data/lib/eve_online/esi/character_loyalty_points.rb +3 -1
- data/lib/eve_online/esi/character_notifications.rb +34 -0
- data/lib/eve_online/esi/character_online.rb +3 -1
- data/lib/eve_online/esi/character_orders.rb +34 -0
- data/lib/eve_online/esi/character_portrait.rb +3 -1
- data/lib/eve_online/esi/character_skill_queue.rb +3 -1
- data/lib/eve_online/esi/character_skills.rb +3 -1
- data/lib/eve_online/esi/character_standings.rb +3 -1
- data/lib/eve_online/esi/character_wallet.rb +3 -1
- data/lib/eve_online/esi/character_wallet_journal.rb +34 -0
- data/lib/eve_online/esi/corporation.rb +3 -1
- data/lib/eve_online/esi/corporation_blueprints.rb +3 -1
- data/lib/eve_online/esi/corporation_industry_jobs.rb +4 -2
- data/lib/eve_online/esi/corporation_orders.rb +39 -0
- data/lib/eve_online/esi/dogma_attribute.rb +3 -1
- data/lib/eve_online/esi/dogma_attributes.rb +3 -1
- data/lib/eve_online/esi/factions.rb +3 -1
- data/lib/eve_online/esi/market_history.rb +4 -2
- data/lib/eve_online/esi/models/alliance.rb +2 -0
- data/lib/eve_online/esi/models/alliance_icon.rb +6 -4
- data/lib/eve_online/esi/models/alliance_short.rb +24 -0
- data/lib/eve_online/esi/models/ancestry.rb +44 -0
- data/lib/eve_online/esi/models/asset.rb +2 -0
- data/lib/eve_online/esi/models/attributes.rb +2 -0
- data/lib/eve_online/esi/models/base.rb +2 -0
- data/lib/eve_online/esi/models/bloodline.rb +2 -0
- data/lib/eve_online/esi/models/blueprint.rb +2 -0
- data/lib/eve_online/esi/models/bookmark.rb +76 -0
- data/lib/eve_online/esi/models/bookmark_folder.rb +24 -0
- data/lib/eve_online/esi/models/character.rb +2 -0
- data/lib/eve_online/esi/models/character_order.rb +96 -0
- data/lib/eve_online/esi/models/character_portrait.rb +2 -0
- data/lib/eve_online/esi/models/corporation.rb +2 -0
- data/lib/eve_online/esi/models/corporation_order.rb +91 -0
- data/lib/eve_online/esi/models/dogma_attribute.rb +2 -0
- data/lib/eve_online/esi/models/event.rb +41 -0
- data/lib/eve_online/esi/models/faction.rb +2 -0
- data/lib/eve_online/esi/models/fatigue.rb +2 -0
- data/lib/eve_online/esi/models/home_location.rb +2 -0
- data/lib/eve_online/esi/models/industry_job.rb +2 -0
- data/lib/eve_online/esi/models/jump_clone.rb +2 -0
- data/lib/eve_online/esi/models/loyalty_point.rb +2 -0
- data/lib/eve_online/esi/models/market_history.rb +2 -0
- data/lib/eve_online/esi/models/notification.rb +51 -0
- data/lib/eve_online/esi/models/online.rb +2 -0
- data/lib/eve_online/esi/models/race.rb +2 -0
- data/lib/eve_online/esi/models/server_status.rb +2 -0
- data/lib/eve_online/esi/models/skill.rb +2 -0
- data/lib/eve_online/esi/models/skill_queue_entry.rb +2 -0
- data/lib/eve_online/esi/models/standing.rb +2 -0
- data/lib/eve_online/esi/models/wallet_journal_entry.rb +77 -0
- data/lib/eve_online/esi/races.rb +3 -1
- data/lib/eve_online/esi/server_status.rb +3 -1
- data/lib/eve_online/exceptions/base.rb +2 -0
- data/lib/eve_online/exceptions/invalid_character_id_exception.rb +2 -0
- data/lib/eve_online/exceptions/timeout_exception.rb +2 -0
- data/lib/eve_online/exceptions/unauthorized_exception.rb +2 -0
- data/lib/eve_online/version.rb +3 -1
- metadata +55 -50
- data/lib/eve_online/base.rb +0 -34
- data/lib/eve_online/base_xml.rb +0 -43
- data/lib/eve_online/bookmark.rb +0 -71
- data/lib/eve_online/bookmark_folder.rb +0 -56
- data/lib/eve_online/contact_notification.rb +0 -42
- data/lib/eve_online/event.rb +0 -66
- data/lib/eve_online/event_response_object.rb +0 -18
- data/lib/eve_online/market_order.rb +0 -91
- data/lib/eve_online/sde/agt_agent_types.rb +0 -14
- data/lib/eve_online/sde/agt_agents.rb +0 -14
- data/lib/eve_online/sde/agt_research_agents.rb +0 -14
- data/lib/eve_online/sde/base.rb +0 -25
- data/lib/eve_online/sde/inv_flags.rb +0 -14
- data/lib/eve_online/sde/inv_items.rb +0 -14
- data/lib/eve_online/sde/inv_names.rb +0 -14
- data/lib/eve_online/sde/inv_positions.rb +0 -14
- data/lib/eve_online/sde/models/agt_agent.rb +0 -58
- data/lib/eve_online/sde/models/agt_agent_type.rb +0 -28
- data/lib/eve_online/sde/models/agt_research_agent.rb +0 -28
- data/lib/eve_online/sde/models/inv_flag.rb +0 -38
- data/lib/eve_online/sde/models/inv_item.rb +0 -48
- data/lib/eve_online/sde/models/inv_name.rb +0 -28
- data/lib/eve_online/sde/models/inv_position.rb +0 -53
- data/lib/eve_online/wallet_journal_entry.rb +0 -97
- data/lib/eve_online/xml/base.rb +0 -84
- data/lib/eve_online/xml/character_bookmarks.rb +0 -53
- data/lib/eve_online/xml/character_contact_notifications.rb +0 -51
- data/lib/eve_online/xml/character_market_orders.rb +0 -55
- data/lib/eve_online/xml/character_upcoming_calendar_events.rb +0 -51
- data/lib/eve_online/xml/character_wallet_journal.rb +0 -57
- data/lib/eve_online/xml/corporation_market_orders.rb +0 -55
data/lib/eve_online/base.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'faraday'
|
2
|
-
require 'memoist'
|
3
|
-
|
4
|
-
module EveOnline
|
5
|
-
class Base
|
6
|
-
extend Memoist
|
7
|
-
|
8
|
-
def url
|
9
|
-
raise NotImplementedError
|
10
|
-
end
|
11
|
-
|
12
|
-
def user_agent
|
13
|
-
"EveOnline API (https://github.com/biow0lf/eve_online) v#{ VERSION }"
|
14
|
-
end
|
15
|
-
|
16
|
-
def content
|
17
|
-
faraday = Faraday.new
|
18
|
-
|
19
|
-
faraday.headers[:user_agent] = user_agent
|
20
|
-
faraday.options.timeout = 60
|
21
|
-
faraday.options.open_timeout = 60
|
22
|
-
|
23
|
-
faraday.get(url).body
|
24
|
-
rescue Faraday::TimeoutError
|
25
|
-
raise EveOnline::Exceptions::TimeoutException
|
26
|
-
end
|
27
|
-
memoize :content
|
28
|
-
|
29
|
-
def response
|
30
|
-
parser.parse(content)
|
31
|
-
end
|
32
|
-
memoize :response
|
33
|
-
end
|
34
|
-
end
|
data/lib/eve_online/base_xml.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'nori'
|
2
|
-
require 'active_support/time'
|
3
|
-
|
4
|
-
module EveOnline
|
5
|
-
class BaseXML < Base
|
6
|
-
attr_reader :parser
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@parser = Nori.new(advanced_typecasting: false)
|
10
|
-
end
|
11
|
-
|
12
|
-
def result
|
13
|
-
eveapi.fetch('result')
|
14
|
-
end
|
15
|
-
memoize :result
|
16
|
-
|
17
|
-
def cached_until
|
18
|
-
parse_datetime_with_timezone(eveapi.fetch('cachedUntil'))
|
19
|
-
end
|
20
|
-
memoize :cached_until
|
21
|
-
|
22
|
-
def current_time
|
23
|
-
parse_datetime_with_timezone(eveapi.fetch('currentTime'))
|
24
|
-
end
|
25
|
-
memoize :current_time
|
26
|
-
|
27
|
-
def version
|
28
|
-
eveapi.fetch('@version').to_i
|
29
|
-
end
|
30
|
-
memoize :version
|
31
|
-
|
32
|
-
def eveapi
|
33
|
-
response.fetch('eveapi')
|
34
|
-
end
|
35
|
-
memoize :eveapi
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def parse_datetime_with_timezone(value)
|
40
|
-
ActiveSupport::TimeZone['UTC'].parse(value)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/lib/eve_online/bookmark.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'active_support/time'
|
2
|
-
|
3
|
-
module EveOnline
|
4
|
-
class Bookmark
|
5
|
-
attr_reader :options
|
6
|
-
|
7
|
-
def initialize(options)
|
8
|
-
@options = options
|
9
|
-
end
|
10
|
-
|
11
|
-
def as_json
|
12
|
-
{
|
13
|
-
bookmark_id: bookmark_id,
|
14
|
-
creator_id: creator_id,
|
15
|
-
created: created,
|
16
|
-
item_id: item_id,
|
17
|
-
type_id: type_id,
|
18
|
-
location_id: location_id,
|
19
|
-
x: x,
|
20
|
-
y: y,
|
21
|
-
z: z,
|
22
|
-
memo: memo,
|
23
|
-
note: note
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
def bookmark_id
|
28
|
-
options.fetch('@bookmarkID').to_i
|
29
|
-
end
|
30
|
-
|
31
|
-
def creator_id
|
32
|
-
options.fetch('@creatorID').to_i
|
33
|
-
end
|
34
|
-
|
35
|
-
def created
|
36
|
-
ActiveSupport::TimeZone['UTC'].parse(options.fetch('@created'))
|
37
|
-
end
|
38
|
-
|
39
|
-
def item_id
|
40
|
-
options.fetch('@itemID').to_i
|
41
|
-
end
|
42
|
-
|
43
|
-
def type_id
|
44
|
-
options.fetch('@typeID').to_i
|
45
|
-
end
|
46
|
-
|
47
|
-
def location_id
|
48
|
-
options.fetch('@locationID').to_i
|
49
|
-
end
|
50
|
-
|
51
|
-
def x
|
52
|
-
options.fetch('@x').to_f
|
53
|
-
end
|
54
|
-
|
55
|
-
def y
|
56
|
-
options.fetch('@y').to_f
|
57
|
-
end
|
58
|
-
|
59
|
-
def z
|
60
|
-
options.fetch('@z').to_f
|
61
|
-
end
|
62
|
-
|
63
|
-
def memo
|
64
|
-
options.fetch('@memo')
|
65
|
-
end
|
66
|
-
|
67
|
-
def note
|
68
|
-
options.fetch('@note')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'memoist'
|
2
|
-
|
3
|
-
module EveOnline
|
4
|
-
class BookmarkFolder
|
5
|
-
extend Memoist
|
6
|
-
|
7
|
-
attr_reader :options
|
8
|
-
|
9
|
-
def initialize(options)
|
10
|
-
@options = options
|
11
|
-
end
|
12
|
-
|
13
|
-
def as_json
|
14
|
-
{
|
15
|
-
folder_id: folder_id,
|
16
|
-
folder_name: folder_name
|
17
|
-
}
|
18
|
-
end
|
19
|
-
|
20
|
-
def folder_id
|
21
|
-
options.fetch('@folderID').to_i
|
22
|
-
end
|
23
|
-
|
24
|
-
def folder_name
|
25
|
-
options.fetch('@folderName')
|
26
|
-
end
|
27
|
-
|
28
|
-
def bookmarks
|
29
|
-
case row
|
30
|
-
when Hash
|
31
|
-
[Bookmark.new(row)]
|
32
|
-
when Array
|
33
|
-
bookmarks = []
|
34
|
-
row.each do |bookmark|
|
35
|
-
bookmarks << Bookmark.new(bookmark)
|
36
|
-
end
|
37
|
-
bookmarks
|
38
|
-
else
|
39
|
-
raise ArgumentError
|
40
|
-
end
|
41
|
-
end
|
42
|
-
memoize :bookmarks
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def rowset
|
47
|
-
options.fetch('rowset')
|
48
|
-
end
|
49
|
-
memoize :rowset
|
50
|
-
|
51
|
-
def row
|
52
|
-
rowset.fetch('row')
|
53
|
-
end
|
54
|
-
memoize :row
|
55
|
-
end
|
56
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'active_support/time'
|
2
|
-
|
3
|
-
module EveOnline
|
4
|
-
class ContactNotification
|
5
|
-
attr_reader :options
|
6
|
-
|
7
|
-
def initialize(options)
|
8
|
-
@options = options
|
9
|
-
end
|
10
|
-
|
11
|
-
def as_json
|
12
|
-
{
|
13
|
-
notification_id: notification_id,
|
14
|
-
sender_id: sender_id,
|
15
|
-
sender_name: sender_name,
|
16
|
-
sent_date: sent_date,
|
17
|
-
message_data: message_data
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
def notification_id
|
22
|
-
options.fetch('@notificationID').to_i
|
23
|
-
end
|
24
|
-
|
25
|
-
def sender_id
|
26
|
-
options.fetch('@senderID').to_i
|
27
|
-
end
|
28
|
-
|
29
|
-
def sender_name
|
30
|
-
options.fetch('@senderName')
|
31
|
-
end
|
32
|
-
|
33
|
-
def sent_date
|
34
|
-
ActiveSupport::TimeZone['UTC'].parse(options.fetch('@sentDate'))
|
35
|
-
end
|
36
|
-
|
37
|
-
def message_data
|
38
|
-
# TODO: parse @messageData
|
39
|
-
options.fetch('@messageData')
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
data/lib/eve_online/event.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'active_support/time'
|
2
|
-
|
3
|
-
module EveOnline
|
4
|
-
class Event
|
5
|
-
attr_reader :options
|
6
|
-
|
7
|
-
def initialize(options)
|
8
|
-
@options = options
|
9
|
-
end
|
10
|
-
|
11
|
-
def as_json
|
12
|
-
{
|
13
|
-
event_id: event_id,
|
14
|
-
owner_id: owner_id,
|
15
|
-
owner_name: owner_name,
|
16
|
-
event_date: event_date,
|
17
|
-
event_title: event_title,
|
18
|
-
duration: duration,
|
19
|
-
importance: importance,
|
20
|
-
response: response,
|
21
|
-
event_text: event_text,
|
22
|
-
owner_type_id: owner_type_id
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
def event_id
|
27
|
-
options.fetch('@eventID').to_i
|
28
|
-
end
|
29
|
-
|
30
|
-
def owner_id
|
31
|
-
options.fetch('@ownerID').to_i
|
32
|
-
end
|
33
|
-
|
34
|
-
def owner_name
|
35
|
-
options.fetch('@ownerName')
|
36
|
-
end
|
37
|
-
|
38
|
-
def event_date
|
39
|
-
ActiveSupport::TimeZone['UTC'].parse(options.fetch('@eventDate'))
|
40
|
-
end
|
41
|
-
|
42
|
-
def event_title
|
43
|
-
options.fetch('@eventTitle')
|
44
|
-
end
|
45
|
-
|
46
|
-
def duration
|
47
|
-
options.fetch('@duration').to_i
|
48
|
-
end
|
49
|
-
|
50
|
-
def importance
|
51
|
-
options.fetch('@importance').eql?('1')
|
52
|
-
end
|
53
|
-
|
54
|
-
def response
|
55
|
-
EventResponseObject.new(options.fetch('@response')).value
|
56
|
-
end
|
57
|
-
|
58
|
-
def event_text
|
59
|
-
options.fetch('@eventText')
|
60
|
-
end
|
61
|
-
|
62
|
-
def owner_type_id
|
63
|
-
options.fetch('@ownerTypeID').to_i
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module EveOnline
|
2
|
-
class EventResponseObject
|
3
|
-
STATUSES = { 'Undecided' => :undecided, 'Accepted' => :accepted,
|
4
|
-
'Declined' => :declined, 'Tentative' => :tentative }.freeze
|
5
|
-
|
6
|
-
attr_reader :input
|
7
|
-
|
8
|
-
def initialize(input)
|
9
|
-
@input = input
|
10
|
-
end
|
11
|
-
|
12
|
-
def value
|
13
|
-
raise ArgumentError unless STATUSES.key?(input)
|
14
|
-
|
15
|
-
@value ||= STATUSES.fetch(input)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'active_support/time'
|
2
|
-
|
3
|
-
module EveOnline
|
4
|
-
class MarketOrder
|
5
|
-
attr_reader :options
|
6
|
-
|
7
|
-
def initialize(options)
|
8
|
-
@options = options
|
9
|
-
end
|
10
|
-
|
11
|
-
def as_json
|
12
|
-
{
|
13
|
-
order_id: order_id,
|
14
|
-
char_id: char_id,
|
15
|
-
station_id: station_id,
|
16
|
-
vol_entered: vol_entered,
|
17
|
-
vol_remaining: vol_remaining,
|
18
|
-
min_volume: min_volume,
|
19
|
-
order_state: order_state,
|
20
|
-
type_id: type_id,
|
21
|
-
range: range,
|
22
|
-
account_key: account_key,
|
23
|
-
duration: duration,
|
24
|
-
escrow: escrow,
|
25
|
-
price: price,
|
26
|
-
bid: bid,
|
27
|
-
issued: issued
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def order_id
|
32
|
-
options.fetch('@orderID').to_i
|
33
|
-
end
|
34
|
-
|
35
|
-
def char_id
|
36
|
-
options.fetch('@charID').to_i
|
37
|
-
end
|
38
|
-
|
39
|
-
def station_id
|
40
|
-
options.fetch('@stationID').to_i
|
41
|
-
end
|
42
|
-
|
43
|
-
def vol_entered
|
44
|
-
options.fetch('@volEntered').to_i
|
45
|
-
end
|
46
|
-
|
47
|
-
def vol_remaining
|
48
|
-
options.fetch('@volRemaining').to_i
|
49
|
-
end
|
50
|
-
|
51
|
-
def min_volume
|
52
|
-
options.fetch('@minVolume').to_i
|
53
|
-
end
|
54
|
-
|
55
|
-
def order_state
|
56
|
-
options.fetch('@orderState').to_i
|
57
|
-
end
|
58
|
-
|
59
|
-
def type_id
|
60
|
-
options.fetch('@typeID').to_i
|
61
|
-
end
|
62
|
-
|
63
|
-
def range
|
64
|
-
options.fetch('@range').to_i
|
65
|
-
end
|
66
|
-
|
67
|
-
def account_key
|
68
|
-
options.fetch('@accountKey').to_i
|
69
|
-
end
|
70
|
-
|
71
|
-
def duration
|
72
|
-
options.fetch('@duration').to_i
|
73
|
-
end
|
74
|
-
|
75
|
-
def escrow
|
76
|
-
options.fetch('@escrow').to_f
|
77
|
-
end
|
78
|
-
|
79
|
-
def price
|
80
|
-
options.fetch('@price').to_f
|
81
|
-
end
|
82
|
-
|
83
|
-
def bid
|
84
|
-
options.fetch('@bid') == '1'
|
85
|
-
end
|
86
|
-
|
87
|
-
def issued
|
88
|
-
ActiveSupport::TimeZone['UTC'].parse(options.fetch('@issued'))
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module EveOnline
|
2
|
-
module SDE
|
3
|
-
class AgtAgentTypes < Base
|
4
|
-
def agt_agent_types
|
5
|
-
output = []
|
6
|
-
data.each do |agt_agent_type|
|
7
|
-
output << EveOnline::SDE::Models::AgtAgentType.new(agt_agent_type)
|
8
|
-
end
|
9
|
-
output
|
10
|
-
end
|
11
|
-
memoize :agt_agent_types
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|