eve_online 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -12
  3. data/CHANGELOG.md +20 -0
  4. data/Gemfile.lock +3 -3
  5. data/README.md +240 -32
  6. data/TODO.md +4 -1
  7. data/lib/eve_online.rb +17 -0
  8. data/lib/eve_online/esi/alliance.rb +1 -1
  9. data/lib/eve_online/esi/alliance_corporations.rb +1 -1
  10. data/lib/eve_online/esi/alliance_icon.rb +1 -1
  11. data/lib/eve_online/esi/alliances.rb +1 -1
  12. data/lib/eve_online/esi/ancestries.rb +1 -1
  13. data/lib/eve_online/esi/base.rb +6 -0
  14. data/lib/eve_online/esi/bloodlines.rb +1 -1
  15. data/lib/eve_online/esi/character.rb +1 -1
  16. data/lib/eve_online/esi/character_assets.rb +8 -3
  17. data/lib/eve_online/esi/character_attributes.rb +1 -1
  18. data/lib/eve_online/esi/character_blueprints.rb +8 -3
  19. data/lib/eve_online/esi/character_bookmark_folders.rb +8 -3
  20. data/lib/eve_online/esi/character_bookmarks.rb +8 -3
  21. data/lib/eve_online/esi/character_calendar.rb +1 -1
  22. data/lib/eve_online/esi/character_clones.rb +1 -1
  23. data/lib/eve_online/esi/character_fatigue.rb +1 -1
  24. data/lib/eve_online/esi/character_implants.rb +1 -1
  25. data/lib/eve_online/esi/character_industry_jobs.rb +1 -1
  26. data/lib/eve_online/esi/character_killmails_recent.rb +39 -0
  27. data/lib/eve_online/esi/character_location.rb +37 -0
  28. data/lib/eve_online/esi/character_loyalty_points.rb +1 -1
  29. data/lib/eve_online/esi/character_notifications.rb +1 -1
  30. data/lib/eve_online/esi/character_online.rb +1 -1
  31. data/lib/eve_online/esi/character_orders.rb +1 -1
  32. data/lib/eve_online/esi/character_portrait.rb +1 -1
  33. data/lib/eve_online/esi/character_ship.rb +36 -0
  34. data/lib/eve_online/esi/character_skill_queue.rb +1 -1
  35. data/lib/eve_online/esi/character_skills.rb +1 -1
  36. data/lib/eve_online/esi/character_standings.rb +1 -1
  37. data/lib/eve_online/esi/character_wallet.rb +1 -1
  38. data/lib/eve_online/esi/character_wallet_journal.rb +8 -3
  39. data/lib/eve_online/esi/corporation.rb +1 -1
  40. data/lib/eve_online/esi/corporation_blueprints.rb +8 -3
  41. data/lib/eve_online/esi/corporation_industry_jobs.rb +8 -3
  42. data/lib/eve_online/esi/corporation_killmails_recent.rb +39 -0
  43. data/lib/eve_online/esi/corporation_orders.rb +8 -3
  44. data/lib/eve_online/esi/dogma_attribute.rb +1 -1
  45. data/lib/eve_online/esi/dogma_attributes.rb +1 -1
  46. data/lib/eve_online/esi/factions.rb +1 -1
  47. data/lib/eve_online/esi/market_history.rb +1 -1
  48. data/lib/eve_online/esi/models/alliance_icon.rb +1 -1
  49. data/lib/eve_online/esi/models/character_location.rb +29 -0
  50. data/lib/eve_online/esi/models/character_ship.rb +29 -0
  51. data/lib/eve_online/esi/models/constellation.rb +49 -0
  52. data/lib/eve_online/esi/models/killmail_short.rb +24 -0
  53. data/lib/eve_online/esi/models/region.rb +34 -0
  54. data/lib/eve_online/esi/races.rb +1 -1
  55. data/lib/eve_online/esi/server_status.rb +1 -1
  56. data/lib/eve_online/esi/universe_constellation.rb +35 -0
  57. data/lib/eve_online/esi/universe_constellations.rb +19 -0
  58. data/lib/eve_online/esi/universe_region.rb +35 -0
  59. data/lib/eve_online/esi/universe_regions.rb +19 -0
  60. data/lib/eve_online/esi/universe_systems.rb +19 -0
  61. data/lib/eve_online/esi/universe_type.rb +1 -1
  62. data/lib/eve_online/esi/universe_types.rb +14 -2
  63. data/lib/eve_online/esi/war_killmails.rb +37 -0
  64. data/lib/eve_online/esi/wars.rb +19 -0
  65. data/lib/eve_online/version.rb +1 -1
  66. metadata +18 -2
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class KillmailShort < Base
7
+ def as_json
8
+ {
9
+ killmail_hash: killmail_hash,
10
+ killmail_id: killmail_id
11
+ }
12
+ end
13
+
14
+ def killmail_hash
15
+ options['killmail_hash']
16
+ end
17
+
18
+ def killmail_id
19
+ options['killmail_id']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class Region < Base
7
+ def as_json
8
+ {
9
+ constellations: constellations,
10
+ description: description,
11
+ name: name,
12
+ region_id: region_id
13
+ }
14
+ end
15
+
16
+ def constellations
17
+ options['constellations']
18
+ end
19
+
20
+ def description
21
+ options['description']
22
+ end
23
+
24
+ def name
25
+ options['name']
26
+ end
27
+
28
+ def region_id
29
+ options['region_id']
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class Races < Base
6
- API_ENDPOINT = 'https://esi.tech.ccp.is/v1/universe/races/?datasource=%<datasource>s&language=en-us'
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/races/?datasource=%<datasource>s&language=en-us'
7
7
 
8
8
  def races
9
9
  output = []
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class ServerStatus < Base
8
8
  extend Forwardable
9
9
 
10
- API_ENDPOINT = 'https://esi.tech.ccp.is/v1/status/?datasource=%<datasource>s'
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/status/?datasource=%<datasource>s'
11
11
 
12
12
  def_delegators :model, :as_json, :start_time, :players, :server_version, :vip
13
13
 
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseConstellation < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/constellations/%<constellation_id>s/?datasource=%<datasource>s&language=en-us'
11
+
12
+ attr_reader :id
13
+
14
+ def initialize(options)
15
+ super
16
+
17
+ @id = options.fetch(:id)
18
+ end
19
+
20
+ def_delegators :model, :as_json, :constellation_id, :name, :position_x,
21
+ :position_y, :position_z, :region_id, :systems
22
+
23
+ def model
24
+ Models::Constellation.new(response)
25
+ end
26
+ memoize :model
27
+
28
+ def scope; end
29
+
30
+ def url
31
+ format(API_ENDPOINT, constellation_id: id, datasource: datasource)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseConstellations < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/constellations/?datasource=%<datasource>s'
7
+
8
+ def constellations_ids
9
+ response
10
+ end
11
+
12
+ def scope; end
13
+
14
+ def url
15
+ format(API_ENDPOINT, datasource: datasource)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class UniverseRegion < Base
8
+ extend Forwardable
9
+
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/regions/%<region_id>s/?datasource=%<datasource>s&language=en-us'
11
+
12
+ attr_reader :id
13
+
14
+ def initialize(options)
15
+ super
16
+
17
+ @id = options.fetch(:id)
18
+ end
19
+
20
+ def_delegators :model, :as_json, :constellations, :description, :name,
21
+ :region_id
22
+
23
+ def model
24
+ Models::Region.new(response)
25
+ end
26
+ memoize :model
27
+
28
+ def scope; end
29
+
30
+ def url
31
+ format(API_ENDPOINT, region_id: id, datasource: datasource)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseRegions < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/regions/?datasource=%<datasource>s'
7
+
8
+ def universe_regions_ids
9
+ response
10
+ end
11
+
12
+ def scope; end
13
+
14
+ def url
15
+ format(API_ENDPOINT, datasource: datasource)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class UniverseSystems < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/systems/?datasource=%<datasource>s'
7
+
8
+ def universe_systems_ids
9
+ response
10
+ end
11
+
12
+ def scope; end
13
+
14
+ def url
15
+ format(API_ENDPOINT, datasource: datasource)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class UniverseType < Base
8
8
  extend Forwardable
9
9
 
10
- API_ENDPOINT = 'https://esi.tech.ccp.is/v3/universe/types/%<type_id>s/?datasource=%<datasource>s&language=en-us'
10
+ API_ENDPOINT = 'https://esi.evetech.net/v3/universe/types/%<type_id>s/?datasource=%<datasource>s&language=en-us'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -3,16 +3,28 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class UniverseTypes < Base
6
- API_ENDPOINT = 'https://esi.tech.ccp.is/v1/universe/types/?datasource=%<datasource>s&page=1'
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/types/?datasource=%<datasource>s&page=%<page>s'
7
+
8
+ attr_reader :page
9
+
10
+ def initialize(options = {})
11
+ super
12
+
13
+ @page = options.fetch(:page, 1)
14
+ end
7
15
 
8
16
  def universe_types_ids
9
17
  response
10
18
  end
11
19
 
20
+ def total_pages
21
+ resource.headers['x-pages']&.to_i
22
+ end
23
+
12
24
  def scope; end
13
25
 
14
26
  def url
15
- format(API_ENDPOINT, datasource: datasource)
27
+ format(API_ENDPOINT, datasource: datasource, page: page)
16
28
  end
17
29
  end
18
30
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class WarKillmails < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/wars/%<war_id>s/killmails/?datasource=%<datasource>s&page=%<page>s'
7
+
8
+ attr_reader :war_id, :page
9
+
10
+ def initialize(options = {})
11
+ super
12
+
13
+ @war_id = options.fetch(:war_id)
14
+ @page = options.fetch(:page, 1)
15
+ end
16
+
17
+ def killmails
18
+ output = []
19
+ response.each do |killmail|
20
+ output << Models::KillmailShort.new(killmail)
21
+ end
22
+ output
23
+ end
24
+ memoize :killmails
25
+
26
+ def total_pages
27
+ resource.headers['x-pages']&.to_i
28
+ end
29
+
30
+ def scope; end
31
+
32
+ def url
33
+ format(API_ENDPOINT, war_id: war_id, datasource: datasource, page: page)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class Wars < Base
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/wars/?datasource=%<datasource>s'
7
+
8
+ def wars_ids
9
+ response
10
+ end
11
+
12
+ def scope; end
13
+
14
+ def url
15
+ format(API_ENDPOINT, datasource: datasource)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EveOnline
4
- VERSION = '0.17.0'
4
+ VERSION = '0.18.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eve_online
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Zubkov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,11 +228,14 @@ files:
228
228
  - lib/eve_online/esi/character_fatigue.rb
229
229
  - lib/eve_online/esi/character_implants.rb
230
230
  - lib/eve_online/esi/character_industry_jobs.rb
231
+ - lib/eve_online/esi/character_killmails_recent.rb
232
+ - lib/eve_online/esi/character_location.rb
231
233
  - lib/eve_online/esi/character_loyalty_points.rb
232
234
  - lib/eve_online/esi/character_notifications.rb
233
235
  - lib/eve_online/esi/character_online.rb
234
236
  - lib/eve_online/esi/character_orders.rb
235
237
  - lib/eve_online/esi/character_portrait.rb
238
+ - lib/eve_online/esi/character_ship.rb
236
239
  - lib/eve_online/esi/character_skill_queue.rb
237
240
  - lib/eve_online/esi/character_skills.rb
238
241
  - lib/eve_online/esi/character_standings.rb
@@ -241,6 +244,7 @@ files:
241
244
  - lib/eve_online/esi/corporation.rb
242
245
  - lib/eve_online/esi/corporation_blueprints.rb
243
246
  - lib/eve_online/esi/corporation_industry_jobs.rb
247
+ - lib/eve_online/esi/corporation_killmails_recent.rb
244
248
  - lib/eve_online/esi/corporation_orders.rb
245
249
  - lib/eve_online/esi/dogma_attribute.rb
246
250
  - lib/eve_online/esi/dogma_attributes.rb
@@ -259,8 +263,11 @@ files:
259
263
  - lib/eve_online/esi/models/bookmark_folder.rb
260
264
  - lib/eve_online/esi/models/character.rb
261
265
  - lib/eve_online/esi/models/character_industry_job.rb
266
+ - lib/eve_online/esi/models/character_location.rb
262
267
  - lib/eve_online/esi/models/character_order.rb
263
268
  - lib/eve_online/esi/models/character_portrait.rb
269
+ - lib/eve_online/esi/models/character_ship.rb
270
+ - lib/eve_online/esi/models/constellation.rb
264
271
  - lib/eve_online/esi/models/corporation.rb
265
272
  - lib/eve_online/esi/models/corporation_industry_job.rb
266
273
  - lib/eve_online/esi/models/corporation_order.rb
@@ -270,11 +277,13 @@ files:
270
277
  - lib/eve_online/esi/models/fatigue.rb
271
278
  - lib/eve_online/esi/models/home_location.rb
272
279
  - lib/eve_online/esi/models/jump_clone.rb
280
+ - lib/eve_online/esi/models/killmail_short.rb
273
281
  - lib/eve_online/esi/models/loyalty_point.rb
274
282
  - lib/eve_online/esi/models/market_history.rb
275
283
  - lib/eve_online/esi/models/notification.rb
276
284
  - lib/eve_online/esi/models/online.rb
277
285
  - lib/eve_online/esi/models/race.rb
286
+ - lib/eve_online/esi/models/region.rb
278
287
  - lib/eve_online/esi/models/server_status.rb
279
288
  - lib/eve_online/esi/models/skill.rb
280
289
  - lib/eve_online/esi/models/skill_queue_entry.rb
@@ -283,8 +292,15 @@ files:
283
292
  - lib/eve_online/esi/models/wallet_journal_entry.rb
284
293
  - lib/eve_online/esi/races.rb
285
294
  - lib/eve_online/esi/server_status.rb
295
+ - lib/eve_online/esi/universe_constellation.rb
296
+ - lib/eve_online/esi/universe_constellations.rb
297
+ - lib/eve_online/esi/universe_region.rb
298
+ - lib/eve_online/esi/universe_regions.rb
299
+ - lib/eve_online/esi/universe_systems.rb
286
300
  - lib/eve_online/esi/universe_type.rb
287
301
  - lib/eve_online/esi/universe_types.rb
302
+ - lib/eve_online/esi/war_killmails.rb
303
+ - lib/eve_online/esi/wars.rb
288
304
  - lib/eve_online/exceptions/bad_gateway.rb
289
305
  - lib/eve_online/exceptions/bad_request.rb
290
306
  - lib/eve_online/exceptions/base.rb