eve_online 0.18.0 → 0.19.0

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -1
  3. data/Gemfile.lock +3 -7
  4. data/Gemfile.mutant.lock +20 -24
  5. data/README.md +208 -52
  6. data/TODO.md +2 -2
  7. data/eve_online.gemspec +1 -2
  8. data/lib/eve_online.rb +62 -35
  9. data/lib/eve_online/esi/alliance_corporations.rb +1 -1
  10. data/lib/eve_online/esi/alliances.rb +1 -1
  11. data/lib/eve_online/esi/ancestries.rb +1 -1
  12. data/lib/eve_online/esi/base.rb +72 -36
  13. data/lib/eve_online/esi/bloodlines.rb +1 -1
  14. data/lib/eve_online/esi/character_assets.rb +0 -4
  15. data/lib/eve_online/esi/character_assets_locations.rb +43 -0
  16. data/lib/eve_online/esi/character_assets_names.rb +43 -0
  17. data/lib/eve_online/esi/character_blueprints.rb +0 -4
  18. data/lib/eve_online/esi/character_bookmark_folders.rb +0 -4
  19. data/lib/eve_online/esi/character_bookmarks.rb +0 -4
  20. data/lib/eve_online/esi/character_implants.rb +1 -1
  21. data/lib/eve_online/esi/character_killmails_recent.rb +0 -4
  22. data/lib/eve_online/esi/character_wallet_journal.rb +0 -4
  23. data/lib/eve_online/esi/corporation_blueprints.rb +0 -4
  24. data/lib/eve_online/esi/corporation_industry_jobs.rb +0 -4
  25. data/lib/eve_online/esi/corporation_killmails_recent.rb +0 -4
  26. data/lib/eve_online/esi/corporation_orders.rb +0 -4
  27. data/lib/eve_online/esi/dogma_attributes.rb +1 -1
  28. data/lib/eve_online/esi/dogma_effect.rb +41 -0
  29. data/lib/eve_online/esi/dogma_effects.rb +19 -0
  30. data/lib/eve_online/esi/factions.rb +1 -1
  31. data/lib/eve_online/esi/models/asset_location.rb +23 -0
  32. data/lib/eve_online/esi/models/asset_name.rb +24 -0
  33. data/lib/eve_online/esi/models/constellation.rb +4 -15
  34. data/lib/eve_online/esi/models/dogma_attribute_short.rb +24 -0
  35. data/lib/eve_online/esi/models/dogma_attributes.rb +21 -0
  36. data/lib/eve_online/esi/models/dogma_effect.rb +118 -0
  37. data/lib/eve_online/esi/models/dogma_effect_modifier.rb +44 -0
  38. data/lib/eve_online/esi/models/dogma_effect_modifiers.rb +21 -0
  39. data/lib/eve_online/esi/models/dogma_effect_short.rb +24 -0
  40. data/lib/eve_online/esi/models/dogma_effects.rb +21 -0
  41. data/lib/eve_online/esi/models/position.rb +29 -0
  42. data/lib/eve_online/esi/models/type.rb +8 -2
  43. data/lib/eve_online/esi/races.rb +1 -1
  44. data/lib/eve_online/esi/universe_constellation.rb +3 -3
  45. data/lib/eve_online/esi/universe_constellations.rb +1 -1
  46. data/lib/eve_online/esi/universe_region.rb +1 -1
  47. data/lib/eve_online/esi/universe_regions.rb +1 -1
  48. data/lib/eve_online/esi/universe_systems.rb +1 -1
  49. data/lib/eve_online/esi/universe_type.rb +2 -2
  50. data/lib/eve_online/esi/universe_types.rb +1 -5
  51. data/lib/eve_online/esi/war_killmails.rb +0 -4
  52. data/lib/eve_online/esi/wars.rb +1 -1
  53. data/lib/eve_online/version.rb +1 -1
  54. metadata +17 -17
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaEffectModifier < Base
7
+ def as_json
8
+ {
9
+ domain: domain,
10
+ effect_id: effect_id,
11
+ func: func,
12
+ modified_attribute_id: modified_attribute_id,
13
+ modifying_attribute_id: modifying_attribute_id,
14
+ operator: operator
15
+ }
16
+ end
17
+
18
+ def domain
19
+ options['domain']
20
+ end
21
+
22
+ def effect_id
23
+ options['effect_id']
24
+ end
25
+
26
+ def func
27
+ options['func']
28
+ end
29
+
30
+ def modified_attribute_id
31
+ options['modified_attribute_id']
32
+ end
33
+
34
+ def modifying_attribute_id
35
+ options['modifying_attribute_id']
36
+ end
37
+
38
+ def operator
39
+ options['operator']
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaEffectModifiers < Base
7
+ def modifiers
8
+ output = []
9
+
10
+ return output if !options.is_a?(Array)
11
+
12
+ options.each do |dogma_effect_modifier|
13
+ output << DogmaEffectModifier.new(dogma_effect_modifier)
14
+ end
15
+
16
+ output
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaEffectShort < Base
7
+ def as_json
8
+ {
9
+ effect_id: effect_id,
10
+ is_default: is_default
11
+ }
12
+ end
13
+
14
+ def effect_id
15
+ options['effect_id']
16
+ end
17
+
18
+ def is_default
19
+ options['is_default']
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class DogmaEffects < Base
7
+ def dogma_effects
8
+ output = []
9
+
10
+ return output if !options.is_a?(Array)
11
+
12
+ options.each do |dogma_effect_short|
13
+ output << DogmaEffectShort.new(dogma_effect_short)
14
+ end
15
+
16
+ output
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class Position < Base
7
+ def as_json
8
+ {
9
+ x: x,
10
+ y: y,
11
+ z: z
12
+ }
13
+ end
14
+
15
+ def x
16
+ options['x']
17
+ end
18
+
19
+ def y
20
+ options['y']
21
+ end
22
+
23
+ def z
24
+ options['z']
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -8,8 +8,6 @@ module EveOnline
8
8
  {
9
9
  capacity: capacity,
10
10
  description: description,
11
- # TODO: dogma_attributes
12
- # TODO: dogma_effects
13
11
  graphic_id: graphic_id,
14
12
  group_id: group_id,
15
13
  icon_id: icon_id,
@@ -80,6 +78,14 @@ module EveOnline
80
78
  def volume
81
79
  options['volume']
82
80
  end
81
+
82
+ def dogma_attributes
83
+ @dogma_attributes ||= DogmaAttributes.new(options['dogma_attributes']).dogma_attributes
84
+ end
85
+
86
+ def dogma_effects
87
+ @dogma_effects ||= DogmaEffects.new(options['dogma_effects']).dogma_effects
88
+ end
83
89
  end
84
90
  end
85
91
  end
@@ -3,7 +3,7 @@
3
3
  module EveOnline
4
4
  module ESI
5
5
  class Races < Base
6
- API_ENDPOINT = 'https://esi.evetech.net/v1/universe/races/?datasource=%<datasource>s&language=en-us'
6
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/races/?datasource=%<datasource>s'
7
7
 
8
8
  def races
9
9
  output = []
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class UniverseConstellation < Base
8
8
  extend Forwardable
9
9
 
10
- API_ENDPOINT = 'https://esi.evetech.net/v1/universe/constellations/%<constellation_id>s/?datasource=%<datasource>s&language=en-us'
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/constellations/%<constellation_id>s/?datasource=%<datasource>s'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -17,8 +17,8 @@ module EveOnline
17
17
  @id = options.fetch(:id)
18
18
  end
19
19
 
20
- def_delegators :model, :as_json, :constellation_id, :name, :position_x,
21
- :position_y, :position_z, :region_id, :systems
20
+ def_delegators :model, :as_json, :constellation_id, :name, :region_id,
21
+ :systems, :position
22
22
 
23
23
  def model
24
24
  Models::Constellation.new(response)
@@ -5,7 +5,7 @@ module EveOnline
5
5
  class UniverseConstellations < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/constellations/?datasource=%<datasource>s'
7
7
 
8
- def constellations_ids
8
+ def constellation_ids
9
9
  response
10
10
  end
11
11
 
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class UniverseRegion < Base
8
8
  extend Forwardable
9
9
 
10
- API_ENDPOINT = 'https://esi.evetech.net/v1/universe/regions/%<region_id>s/?datasource=%<datasource>s&language=en-us'
10
+ API_ENDPOINT = 'https://esi.evetech.net/v1/universe/regions/%<region_id>s/?datasource=%<datasource>s'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -5,7 +5,7 @@ module EveOnline
5
5
  class UniverseRegions < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/regions/?datasource=%<datasource>s'
7
7
 
8
- def universe_regions_ids
8
+ def universe_region_ids
9
9
  response
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ module EveOnline
5
5
  class UniverseSystems < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/systems/?datasource=%<datasource>s'
7
7
 
8
- def universe_systems_ids
8
+ def universe_system_ids
9
9
  response
10
10
  end
11
11
 
@@ -7,7 +7,7 @@ module EveOnline
7
7
  class UniverseType < Base
8
8
  extend Forwardable
9
9
 
10
- API_ENDPOINT = 'https://esi.evetech.net/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'
11
11
 
12
12
  attr_reader :id
13
13
 
@@ -20,7 +20,7 @@ module EveOnline
20
20
  def_delegators :model, :as_json, :capacity, :description, :graphic_id,
21
21
  :group_id, :icon_id, :market_group_id, :mass, :name,
22
22
  :packaged_volume, :portion_size, :published, :radius,
23
- :type_id, :volume
23
+ :type_id, :volume, :dogma_attributes, :dogma_effects
24
24
 
25
25
  def model
26
26
  Models::Type.new(response)
@@ -13,14 +13,10 @@ module EveOnline
13
13
  @page = options.fetch(:page, 1)
14
14
  end
15
15
 
16
- def universe_types_ids
16
+ def universe_type_ids
17
17
  response
18
18
  end
19
19
 
20
- def total_pages
21
- resource.headers['x-pages']&.to_i
22
- end
23
-
24
20
  def scope; end
25
21
 
26
22
  def url
@@ -23,10 +23,6 @@ module EveOnline
23
23
  end
24
24
  memoize :killmails
25
25
 
26
- def total_pages
27
- resource.headers['x-pages']&.to_i
28
- end
29
-
30
26
  def scope; end
31
27
 
32
28
  def url
@@ -5,7 +5,7 @@ module EveOnline
5
5
  class Wars < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/wars/?datasource=%<datasource>s'
7
7
 
8
- def wars_ids
8
+ def war_ids
9
9
  response
10
10
  end
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EveOnline
4
- VERSION = '0.18.0'
4
+ VERSION = '0.19.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.18.0
4
+ version: 0.19.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-09-17 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 4.2.0
139
- - !ruby/object:Gem::Dependency
140
- name: faraday
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: json
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -219,6 +205,8 @@ files:
219
205
  - lib/eve_online/esi/bloodlines.rb
220
206
  - lib/eve_online/esi/character.rb
221
207
  - lib/eve_online/esi/character_assets.rb
208
+ - lib/eve_online/esi/character_assets_locations.rb
209
+ - lib/eve_online/esi/character_assets_names.rb
222
210
  - lib/eve_online/esi/character_attributes.rb
223
211
  - lib/eve_online/esi/character_blueprints.rb
224
212
  - lib/eve_online/esi/character_bookmark_folders.rb
@@ -248,6 +236,8 @@ files:
248
236
  - lib/eve_online/esi/corporation_orders.rb
249
237
  - lib/eve_online/esi/dogma_attribute.rb
250
238
  - lib/eve_online/esi/dogma_attributes.rb
239
+ - lib/eve_online/esi/dogma_effect.rb
240
+ - lib/eve_online/esi/dogma_effects.rb
251
241
  - lib/eve_online/esi/factions.rb
252
242
  - lib/eve_online/esi/market_history.rb
253
243
  - lib/eve_online/esi/models/alliance.rb
@@ -255,6 +245,8 @@ files:
255
245
  - lib/eve_online/esi/models/alliance_short.rb
256
246
  - lib/eve_online/esi/models/ancestry.rb
257
247
  - lib/eve_online/esi/models/asset.rb
248
+ - lib/eve_online/esi/models/asset_location.rb
249
+ - lib/eve_online/esi/models/asset_name.rb
258
250
  - lib/eve_online/esi/models/attributes.rb
259
251
  - lib/eve_online/esi/models/base.rb
260
252
  - lib/eve_online/esi/models/bloodline.rb
@@ -272,6 +264,13 @@ files:
272
264
  - lib/eve_online/esi/models/corporation_industry_job.rb
273
265
  - lib/eve_online/esi/models/corporation_order.rb
274
266
  - lib/eve_online/esi/models/dogma_attribute.rb
267
+ - lib/eve_online/esi/models/dogma_attribute_short.rb
268
+ - lib/eve_online/esi/models/dogma_attributes.rb
269
+ - lib/eve_online/esi/models/dogma_effect.rb
270
+ - lib/eve_online/esi/models/dogma_effect_modifier.rb
271
+ - lib/eve_online/esi/models/dogma_effect_modifiers.rb
272
+ - lib/eve_online/esi/models/dogma_effect_short.rb
273
+ - lib/eve_online/esi/models/dogma_effects.rb
275
274
  - lib/eve_online/esi/models/event.rb
276
275
  - lib/eve_online/esi/models/faction.rb
277
276
  - lib/eve_online/esi/models/fatigue.rb
@@ -282,6 +281,7 @@ files:
282
281
  - lib/eve_online/esi/models/market_history.rb
283
282
  - lib/eve_online/esi/models/notification.rb
284
283
  - lib/eve_online/esi/models/online.rb
284
+ - lib/eve_online/esi/models/position.rb
285
285
  - lib/eve_online/esi/models/race.rb
286
286
  - lib/eve_online/esi/models/region.rb
287
287
  - lib/eve_online/esi/models/server_status.rb
@@ -314,7 +314,7 @@ files:
314
314
  - lib/eve_online/version.rb
315
315
  - mutant.sh
316
316
  - server.http
317
- homepage: https://github.com/biow0lf/eve_online
317
+ homepage: https://github.com/evemonk/eve_online
318
318
  licenses:
319
319
  - MIT
320
320
  metadata: {}