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.
Files changed (128) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -2
  3. data/.rubocop.yml +8 -15
  4. data/.rubocop_general.yml +10 -2
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +15 -16
  7. data/CHANGELOG.md +60 -0
  8. data/Gemfile +3 -0
  9. data/Gemfile.lock +170 -0
  10. data/LICENSE.txt +1 -1
  11. data/README.md +569 -587
  12. data/Rakefile +2 -0
  13. data/eve_online.gemspec +7 -6
  14. data/gemfiles/activesupport_42.gemfile +3 -1
  15. data/gemfiles/activesupport_50.gemfile +3 -1
  16. data/gemfiles/activesupport_51.gemfile +3 -1
  17. data/gemfiles/activesupport_52.gemfile +4 -2
  18. data/gemfiles/activesupport_edge.gemfile +3 -1
  19. data/lib/eve_online.rb +23 -40
  20. data/lib/eve_online/esi/alliance.rb +3 -1
  21. data/lib/eve_online/esi/alliance_corporations.rb +27 -0
  22. data/lib/eve_online/esi/alliance_icon.rb +4 -2
  23. data/lib/eve_online/esi/alliances.rb +19 -0
  24. data/lib/eve_online/esi/alliances_names.rb +32 -0
  25. data/lib/eve_online/esi/ancestries.rb +24 -0
  26. data/lib/eve_online/esi/base.rb +3 -0
  27. data/lib/eve_online/esi/bloodlines.rb +3 -1
  28. data/lib/eve_online/esi/character.rb +3 -1
  29. data/lib/eve_online/esi/character_assets.rb +3 -1
  30. data/lib/eve_online/esi/character_attributes.rb +3 -1
  31. data/lib/eve_online/esi/character_blueprints.rb +3 -1
  32. data/lib/eve_online/esi/character_bookmark_folders.rb +34 -0
  33. data/lib/eve_online/esi/character_bookmarks.rb +34 -0
  34. data/lib/eve_online/esi/character_calendar.rb +34 -0
  35. data/lib/eve_online/esi/character_clones.rb +3 -1
  36. data/lib/eve_online/esi/character_fatigue.rb +3 -1
  37. data/lib/eve_online/esi/character_implants.rb +3 -1
  38. data/lib/eve_online/esi/character_industry_jobs.rb +4 -2
  39. data/lib/eve_online/esi/character_loyalty_points.rb +3 -1
  40. data/lib/eve_online/esi/character_notifications.rb +34 -0
  41. data/lib/eve_online/esi/character_online.rb +3 -1
  42. data/lib/eve_online/esi/character_orders.rb +34 -0
  43. data/lib/eve_online/esi/character_portrait.rb +3 -1
  44. data/lib/eve_online/esi/character_skill_queue.rb +3 -1
  45. data/lib/eve_online/esi/character_skills.rb +3 -1
  46. data/lib/eve_online/esi/character_standings.rb +3 -1
  47. data/lib/eve_online/esi/character_wallet.rb +3 -1
  48. data/lib/eve_online/esi/character_wallet_journal.rb +34 -0
  49. data/lib/eve_online/esi/corporation.rb +3 -1
  50. data/lib/eve_online/esi/corporation_blueprints.rb +3 -1
  51. data/lib/eve_online/esi/corporation_industry_jobs.rb +4 -2
  52. data/lib/eve_online/esi/corporation_orders.rb +39 -0
  53. data/lib/eve_online/esi/dogma_attribute.rb +3 -1
  54. data/lib/eve_online/esi/dogma_attributes.rb +3 -1
  55. data/lib/eve_online/esi/factions.rb +3 -1
  56. data/lib/eve_online/esi/market_history.rb +4 -2
  57. data/lib/eve_online/esi/models/alliance.rb +2 -0
  58. data/lib/eve_online/esi/models/alliance_icon.rb +6 -4
  59. data/lib/eve_online/esi/models/alliance_short.rb +24 -0
  60. data/lib/eve_online/esi/models/ancestry.rb +44 -0
  61. data/lib/eve_online/esi/models/asset.rb +2 -0
  62. data/lib/eve_online/esi/models/attributes.rb +2 -0
  63. data/lib/eve_online/esi/models/base.rb +2 -0
  64. data/lib/eve_online/esi/models/bloodline.rb +2 -0
  65. data/lib/eve_online/esi/models/blueprint.rb +2 -0
  66. data/lib/eve_online/esi/models/bookmark.rb +76 -0
  67. data/lib/eve_online/esi/models/bookmark_folder.rb +24 -0
  68. data/lib/eve_online/esi/models/character.rb +2 -0
  69. data/lib/eve_online/esi/models/character_order.rb +96 -0
  70. data/lib/eve_online/esi/models/character_portrait.rb +2 -0
  71. data/lib/eve_online/esi/models/corporation.rb +2 -0
  72. data/lib/eve_online/esi/models/corporation_order.rb +91 -0
  73. data/lib/eve_online/esi/models/dogma_attribute.rb +2 -0
  74. data/lib/eve_online/esi/models/event.rb +41 -0
  75. data/lib/eve_online/esi/models/faction.rb +2 -0
  76. data/lib/eve_online/esi/models/fatigue.rb +2 -0
  77. data/lib/eve_online/esi/models/home_location.rb +2 -0
  78. data/lib/eve_online/esi/models/industry_job.rb +2 -0
  79. data/lib/eve_online/esi/models/jump_clone.rb +2 -0
  80. data/lib/eve_online/esi/models/loyalty_point.rb +2 -0
  81. data/lib/eve_online/esi/models/market_history.rb +2 -0
  82. data/lib/eve_online/esi/models/notification.rb +51 -0
  83. data/lib/eve_online/esi/models/online.rb +2 -0
  84. data/lib/eve_online/esi/models/race.rb +2 -0
  85. data/lib/eve_online/esi/models/server_status.rb +2 -0
  86. data/lib/eve_online/esi/models/skill.rb +2 -0
  87. data/lib/eve_online/esi/models/skill_queue_entry.rb +2 -0
  88. data/lib/eve_online/esi/models/standing.rb +2 -0
  89. data/lib/eve_online/esi/models/wallet_journal_entry.rb +77 -0
  90. data/lib/eve_online/esi/races.rb +3 -1
  91. data/lib/eve_online/esi/server_status.rb +3 -1
  92. data/lib/eve_online/exceptions/base.rb +2 -0
  93. data/lib/eve_online/exceptions/invalid_character_id_exception.rb +2 -0
  94. data/lib/eve_online/exceptions/timeout_exception.rb +2 -0
  95. data/lib/eve_online/exceptions/unauthorized_exception.rb +2 -0
  96. data/lib/eve_online/version.rb +3 -1
  97. metadata +55 -50
  98. data/lib/eve_online/base.rb +0 -34
  99. data/lib/eve_online/base_xml.rb +0 -43
  100. data/lib/eve_online/bookmark.rb +0 -71
  101. data/lib/eve_online/bookmark_folder.rb +0 -56
  102. data/lib/eve_online/contact_notification.rb +0 -42
  103. data/lib/eve_online/event.rb +0 -66
  104. data/lib/eve_online/event_response_object.rb +0 -18
  105. data/lib/eve_online/market_order.rb +0 -91
  106. data/lib/eve_online/sde/agt_agent_types.rb +0 -14
  107. data/lib/eve_online/sde/agt_agents.rb +0 -14
  108. data/lib/eve_online/sde/agt_research_agents.rb +0 -14
  109. data/lib/eve_online/sde/base.rb +0 -25
  110. data/lib/eve_online/sde/inv_flags.rb +0 -14
  111. data/lib/eve_online/sde/inv_items.rb +0 -14
  112. data/lib/eve_online/sde/inv_names.rb +0 -14
  113. data/lib/eve_online/sde/inv_positions.rb +0 -14
  114. data/lib/eve_online/sde/models/agt_agent.rb +0 -58
  115. data/lib/eve_online/sde/models/agt_agent_type.rb +0 -28
  116. data/lib/eve_online/sde/models/agt_research_agent.rb +0 -28
  117. data/lib/eve_online/sde/models/inv_flag.rb +0 -38
  118. data/lib/eve_online/sde/models/inv_item.rb +0 -48
  119. data/lib/eve_online/sde/models/inv_name.rb +0 -28
  120. data/lib/eve_online/sde/models/inv_position.rb +0 -53
  121. data/lib/eve_online/wallet_journal_entry.rb +0 -97
  122. data/lib/eve_online/xml/base.rb +0 -84
  123. data/lib/eve_online/xml/character_bookmarks.rb +0 -53
  124. data/lib/eve_online/xml/character_contact_notifications.rb +0 -51
  125. data/lib/eve_online/xml/character_market_orders.rb +0 -55
  126. data/lib/eve_online/xml/character_upcoming_calendar_events.rb +0 -51
  127. data/lib/eve_online/xml/character_wallet_journal.rb +0 -57
  128. data/lib/eve_online/xml/corporation_market_orders.rb +0 -55
@@ -1,84 +0,0 @@
1
- require 'nori'
2
- require 'memoist'
3
- require 'faraday'
4
- require 'active_support/time'
5
-
6
- module EveOnline
7
- module XML
8
- class Base
9
- extend Memoist
10
-
11
- attr_reader :parser
12
-
13
- def initialize
14
- @parser = Nori.new(advanced_typecasting: false)
15
- end
16
-
17
- def url
18
- raise NotImplementedError
19
- end
20
-
21
- def user_agent
22
- "EveOnline API (https://github.com/biow0lf/eve_online) v#{ VERSION }"
23
- end
24
-
25
- def content
26
- faraday = Faraday.new
27
-
28
- faraday.headers[:user_agent] = user_agent
29
- faraday.options.timeout = 60
30
- faraday.options.open_timeout = 60
31
-
32
- resource = faraday.get(url)
33
-
34
- case resource.status
35
- when 200
36
- resource.body
37
- when 400
38
- raise EveOnline::Exceptions::InvalidCharacterIDException
39
- when 403
40
- raise EveOnline::Exceptions::UnauthorizedException
41
- end
42
- rescue Faraday::TimeoutError
43
- raise EveOnline::Exceptions::TimeoutException
44
- end
45
- memoize :content
46
-
47
- def response
48
- parser.parse(content)
49
- end
50
- memoize :response
51
-
52
- def eveapi
53
- response.fetch('eveapi')
54
- end
55
- memoize :eveapi
56
-
57
- def result
58
- eveapi.fetch('result')
59
- end
60
- memoize :result
61
-
62
- def cached_until
63
- parse_datetime_with_timezone(eveapi.fetch('cachedUntil'))
64
- end
65
- memoize :cached_until
66
-
67
- def current_time
68
- parse_datetime_with_timezone(eveapi.fetch('currentTime'))
69
- end
70
- memoize :current_time
71
-
72
- def version
73
- eveapi.fetch('@version').to_i
74
- end
75
- memoize :version
76
-
77
- private
78
-
79
- def parse_datetime_with_timezone(value)
80
- ActiveSupport::TimeZone['UTC'].parse(value)
81
- end
82
- end
83
- end
84
- end
@@ -1,53 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_bookmarks.html
4
- class CharacterBookmarks < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/Bookmarks.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 268_435_456
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, options = {})
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = options.fetch(:character_id, nil)
16
- end
17
-
18
- def bookmark_folders
19
- case row
20
- when Hash
21
- [BookmarkFolder.new(row)]
22
- when Array
23
- output = []
24
- row.each do |bookmark_folder|
25
- output << BookmarkFolder.new(bookmark_folder)
26
- end
27
- output
28
- else
29
- raise ArgumentError
30
- end
31
- end
32
- memoize :bookmark_folders
33
-
34
- def url
35
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
36
- output = "#{ output }&characterID=#{ character_id }" if character_id
37
- output
38
- end
39
-
40
- private
41
-
42
- def rowset
43
- result.fetch('rowset')
44
- end
45
- memoize :rowset
46
-
47
- def row
48
- rowset.fetch('row')
49
- end
50
- memoize :row
51
- end
52
- end
53
- end
@@ -1,51 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_contactnotifications.html
4
- class CharacterContactNotifications < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/ContactNotifications.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 32
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def contact_notifications
19
- case row
20
- when Hash
21
- [ContactNotification.new(row)]
22
- when Array
23
- output = []
24
- row.each do |contact_notification|
25
- output << ContactNotification.new(contact_notification)
26
- end
27
- output
28
- else
29
- raise ArgumentError
30
- end
31
- end
32
- memoize :contact_notifications
33
-
34
- def url
35
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
36
- end
37
-
38
- private
39
-
40
- def rowset
41
- result.fetch('rowset')
42
- end
43
- memoize :rowset
44
-
45
- def row
46
- rowset.fetch('row')
47
- end
48
- memoize :row
49
- end
50
- end
51
- end
@@ -1,55 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_marketorders.html
4
- class CharacterMarketOrders < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/MarketOrders.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 4_096
8
-
9
- attr_reader :key_id, :v_code, :character_id, :order_id
10
-
11
- def initialize(key_id, v_code, options = {})
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = options.fetch(:character_id, nil)
16
- @order_id = options.fetch(:order_id, nil)
17
- end
18
-
19
- def orders
20
- case row
21
- when Hash
22
- [MarketOrder.new(row)]
23
- when Array
24
- output = []
25
- row.each do |order|
26
- output << MarketOrder.new(order)
27
- end
28
- output
29
- else
30
- raise ArgumentError
31
- end
32
- end
33
- memoize :orders
34
-
35
- def url
36
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
37
- output = "#{ output }&characterID=#{ character_id }" if character_id
38
- output = "#{ output }&orderID=#{ order_id }" if order_id
39
- output
40
- end
41
-
42
- private
43
-
44
- def rowset
45
- result.fetch('rowset')
46
- end
47
- memoize :rowset
48
-
49
- def row
50
- rowset.fetch('row')
51
- end
52
- memoize :row
53
- end
54
- end
55
- end
@@ -1,51 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_upcomingcalendarevents.html
4
- class CharacterUpcomingCalendarEvents < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/UpcomingCalendarEvents.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 1_048_576
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def events
19
- case row
20
- when Hash
21
- [Event.new(row)]
22
- when Array
23
- output = []
24
- row.each do |event|
25
- output << Event.new(event)
26
- end
27
- output
28
- else
29
- raise ArgumentError
30
- end
31
- end
32
- memoize :events
33
-
34
- def url
35
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
36
- end
37
-
38
- private
39
-
40
- def rowset
41
- result.fetch('rowset')
42
- end
43
- memoize :rowset
44
-
45
- def row
46
- rowset.fetch('row')
47
- end
48
- memoize :row
49
- end
50
- end
51
- end
@@ -1,57 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_walletjournal.html
4
- class CharacterWalletJournal < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/WalletJournal.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2_097_152
8
-
9
- attr_reader :key_id, :v_code, :character_id, :account_key, :from_id, :row_count
10
-
11
- def initialize(key_id, v_code, character_id, options = {})
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- @account_key = options.fetch(:account_key, 1000)
17
- @from_id = options.fetch(:from_id, nil)
18
- @row_count = options.fetch(:row_count, nil)
19
- end
20
-
21
- def wallet_journal_entries
22
- case row
23
- when Hash
24
- [WalletJournalEntry.new(row)]
25
- when Array
26
- output = []
27
- row.each do |blueprint|
28
- output << WalletJournalEntry.new(blueprint)
29
- end
30
- output
31
- else
32
- raise ArgumentError
33
- end
34
- end
35
- memoize :wallet_journal_entries
36
-
37
- def url
38
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&accountKey=#{ account_key }"
39
- output = "#{ output }&fromID=#{ from_id }" if from_id
40
- output = "#{ output }&rowCount=#{ row_count }" if row_count
41
- output
42
- end
43
-
44
- private
45
-
46
- def rowset
47
- result.fetch('rowset')
48
- end
49
- memoize :rowset
50
-
51
- def row
52
- rowset.fetch('row')
53
- end
54
- memoize :row
55
- end
56
- end
57
- end
@@ -1,55 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/index.html
4
- class CorporationMarketOrders < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/corp/MarketOrders.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 4_096
8
-
9
- attr_reader :key_id, :v_code, :character_id, :order_id
10
-
11
- def initialize(key_id, v_code, options = {})
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = options.fetch(:character_id, nil)
16
- @order_id = options.fetch(:order_id, nil)
17
- end
18
-
19
- def orders
20
- case row
21
- when Hash
22
- [MarketOrder.new(row)]
23
- when Array
24
- output = []
25
- row.each do |order|
26
- output << MarketOrder.new(order)
27
- end
28
- output
29
- else
30
- raise ArgumentError
31
- end
32
- end
33
- memoize :orders
34
-
35
- def url
36
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
37
- output = "#{ output }&characterID=#{ character_id }" if character_id
38
- output = "#{ output }&orderID=#{ order_id }" if order_id
39
- output
40
- end
41
-
42
- private
43
-
44
- def rowset
45
- result.fetch('rowset')
46
- end
47
- memoize :rowset
48
-
49
- def row
50
- rowset.fetch('row')
51
- end
52
- memoize :row
53
- end
54
- end
55
- end