eve_online 0.20.0 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +12 -7
  4. data/CHANGELOG.md +26 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +30 -27
  7. data/Gemfile.mutant.lock +20 -25
  8. data/README.md +41 -21
  9. data/TODO.md +1 -0
  10. data/eve_online.gemspec +8 -2
  11. data/lib/eve_online.rb +9 -4
  12. data/lib/eve_online/esi/alliance.rb +4 -2
  13. data/lib/eve_online/esi/alliances.rb +4 -0
  14. data/lib/eve_online/esi/base.rb +7 -11
  15. data/lib/eve_online/esi/character.rb +1 -2
  16. data/lib/eve_online/esi/character_assets.rb +8 -6
  17. data/lib/eve_online/esi/character_assets_locations.rb +8 -6
  18. data/lib/eve_online/esi/character_assets_names.rb +8 -6
  19. data/lib/eve_online/esi/character_attributes.rb +1 -2
  20. data/lib/eve_online/esi/character_blueprints.rb +8 -6
  21. data/lib/eve_online/esi/character_bookmark_folders.rb +8 -6
  22. data/lib/eve_online/esi/character_bookmarks.rb +8 -6
  23. data/lib/eve_online/esi/character_calendar.rb +8 -6
  24. data/lib/eve_online/esi/character_clones.rb +9 -8
  25. data/lib/eve_online/esi/character_fatigue.rb +1 -2
  26. data/lib/eve_online/esi/character_industry_jobs.rb +8 -6
  27. data/lib/eve_online/esi/character_killmails_recent.rb +8 -6
  28. data/lib/eve_online/esi/character_location.rb +1 -2
  29. data/lib/eve_online/esi/character_loyalty_points.rb +8 -6
  30. data/lib/eve_online/esi/character_notifications.rb +9 -6
  31. data/lib/eve_online/esi/character_online.rb +1 -2
  32. data/lib/eve_online/esi/character_orders.rb +8 -6
  33. data/lib/eve_online/esi/character_portrait.rb +1 -2
  34. data/lib/eve_online/esi/character_ship.rb +1 -2
  35. data/lib/eve_online/esi/character_skill_queue.rb +8 -6
  36. data/lib/eve_online/esi/character_skills.rb +8 -6
  37. data/lib/eve_online/esi/character_standings.rb +8 -6
  38. data/lib/eve_online/esi/character_wallet_journal.rb +8 -6
  39. data/lib/eve_online/esi/corporation.rb +5 -3
  40. data/lib/eve_online/esi/corporation_blueprints.rb +8 -6
  41. data/lib/eve_online/esi/corporation_industry_jobs.rb +8 -6
  42. data/lib/eve_online/esi/corporation_killmails_recent.rb +8 -6
  43. data/lib/eve_online/esi/corporation_orders.rb +8 -6
  44. data/lib/eve_online/esi/dogma_attribute.rb +1 -2
  45. data/lib/eve_online/esi/dogma_effect.rb +1 -2
  46. data/lib/eve_online/esi/market_history.rb +8 -6
  47. data/lib/eve_online/esi/models/alliance.rb +4 -1
  48. data/lib/eve_online/esi/models/corporation.rb +4 -1
  49. data/lib/eve_online/esi/models/model_with_etag.rb +13 -0
  50. data/lib/eve_online/esi/models/star.rb +4 -1
  51. data/lib/eve_online/esi/models/stargate.rb +4 -1
  52. data/lib/eve_online/esi/response_with_etag.rb +11 -0
  53. data/lib/eve_online/esi/server_status.rb +1 -2
  54. data/lib/eve_online/esi/{ancestries.rb → universe_ancestries.rb} +13 -7
  55. data/lib/eve_online/esi/{bloodlines.rb → universe_bloodlines.rb} +13 -7
  56. data/lib/eve_online/esi/universe_constellation.rb +1 -2
  57. data/lib/eve_online/esi/{factions.rb → universe_factions.rb} +13 -7
  58. data/lib/eve_online/esi/{races.rb → universe_races.rb} +13 -7
  59. data/lib/eve_online/esi/universe_region.rb +1 -2
  60. data/lib/eve_online/esi/universe_star.rb +5 -3
  61. data/lib/eve_online/esi/universe_stargate.rb +4 -3
  62. data/lib/eve_online/esi/universe_station.rb +1 -2
  63. data/lib/eve_online/esi/universe_system_jumps.rb +8 -6
  64. data/lib/eve_online/esi/universe_system_kills.rb +8 -6
  65. data/lib/eve_online/esi/universe_type.rb +1 -2
  66. data/lib/eve_online/esi/war_killmails.rb +8 -6
  67. data/lib/eve_online/version.rb +1 -1
  68. metadata +15 -38
  69. data/server.http +0 -0
@@ -4,12 +4,15 @@ module EveOnline
4
4
  module ESI
5
5
  module Models
6
6
  class Stargate < Base
7
+ include ModelWithEtag
8
+
7
9
  def as_json
8
10
  {
9
11
  name: name,
10
12
  stargate_id: stargate_id,
11
13
  system_id: system_id,
12
- type_id: type_id
14
+ type_id: type_id,
15
+ etag: etag
13
16
  }
14
17
  end
15
18
 
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module ResponseWithEtag
6
+ def response_with_etag
7
+ @response_with_etag ||= response.merge('etag' => current_etag)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -12,9 +12,8 @@ module EveOnline
12
12
  def_delegators :model, :as_json, :start_time, :players, :server_version, :vip
13
13
 
14
14
  def model
15
- Models::ServerStatus.new(response)
15
+ @model ||= Models::ServerStatus.new(response)
16
16
  end
17
- memoize :model
18
17
 
19
18
  def scope; end
20
19
 
@@ -2,17 +2,23 @@
2
2
 
3
3
  module EveOnline
4
4
  module ESI
5
- class Ancestries < Base
5
+ class UniverseAncestries < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/ancestries/?datasource=%<datasource>s'
7
7
 
8
8
  def ancestries
9
- output = []
10
- response.each do |ancestry|
11
- output << Models::Ancestry.new(ancestry)
12
- end
13
- output
9
+ @ancestries ||=
10
+ begin
11
+ output = []
12
+ response.each do |ancestry|
13
+ output << Models::Ancestry.new(ancestry)
14
+ end
15
+ output
16
+ end
17
+ end
18
+
19
+ def etag
20
+ current_etag
14
21
  end
15
- memoize :ancestries
16
22
 
17
23
  def scope; end
18
24
 
@@ -2,17 +2,23 @@
2
2
 
3
3
  module EveOnline
4
4
  module ESI
5
- class Bloodlines < Base
5
+ class UniverseBloodlines < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/bloodlines/?datasource=%<datasource>s'
7
7
 
8
8
  def bloodlines
9
- output = []
10
- response.each do |bloodline|
11
- output << Models::Bloodline.new(bloodline)
12
- end
13
- output
9
+ @bloodlines ||=
10
+ begin
11
+ output = []
12
+ response.each do |bloodline|
13
+ output << Models::Bloodline.new(bloodline)
14
+ end
15
+ output
16
+ end
17
+ end
18
+
19
+ def etag
20
+ current_etag
14
21
  end
15
- memoize :bloodlines
16
22
 
17
23
  def scope; end
18
24
 
@@ -21,9 +21,8 @@ module EveOnline
21
21
  :systems, :position
22
22
 
23
23
  def model
24
- Models::Constellation.new(response)
24
+ @model ||= Models::Constellation.new(response)
25
25
  end
26
- memoize :model
27
26
 
28
27
  def scope; end
29
28
 
@@ -2,17 +2,23 @@
2
2
 
3
3
  module EveOnline
4
4
  module ESI
5
- class Factions < Base
5
+ class UniverseFactions < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v2/universe/factions/?datasource=%<datasource>s'
7
7
 
8
8
  def factions
9
- output = []
10
- response.each do |faction|
11
- output << Models::Faction.new(faction)
12
- end
13
- output
9
+ @factions ||=
10
+ begin
11
+ output = []
12
+ response.each do |faction|
13
+ output << Models::Faction.new(faction)
14
+ end
15
+ output
16
+ end
17
+ end
18
+
19
+ def etag
20
+ current_etag
14
21
  end
15
- memoize :factions
16
22
 
17
23
  def scope; end
18
24
 
@@ -2,17 +2,23 @@
2
2
 
3
3
  module EveOnline
4
4
  module ESI
5
- class Races < Base
5
+ class UniverseRaces < Base
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/races/?datasource=%<datasource>s'
7
7
 
8
8
  def races
9
- output = []
10
- response.each do |race|
11
- output << Models::Race.new(race)
12
- end
13
- output
9
+ @races ||=
10
+ begin
11
+ output = []
12
+ response.each do |race|
13
+ output << Models::Race.new(race)
14
+ end
15
+ output
16
+ end
17
+ end
18
+
19
+ def etag
20
+ current_etag
14
21
  end
15
- memoize :races
16
22
 
17
23
  def scope; end
18
24
 
@@ -21,9 +21,8 @@ module EveOnline
21
21
  :region_id
22
22
 
23
23
  def model
24
- Models::Region.new(response)
24
+ @model ||= Models::Region.new(response)
25
25
  end
26
- memoize :model
27
26
 
28
27
  def scope; end
29
28
 
@@ -7,6 +7,8 @@ module EveOnline
7
7
  class UniverseStar < Base
8
8
  extend Forwardable
9
9
 
10
+ include ResponseWithEtag
11
+
10
12
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/stars/%<star_id>s/?datasource=%<datasource>s'
11
13
 
12
14
  attr_reader :id
@@ -18,12 +20,12 @@ module EveOnline
18
20
  end
19
21
 
20
22
  def_delegators :model, :as_json, :age, :luminosity, :name, :radius,
21
- :solar_system_id, :spectral_class, :temperature, :type_id
23
+ :solar_system_id, :spectral_class, :temperature,
24
+ :type_id, :etag
22
25
 
23
26
  def model
24
- Models::Star.new(response)
27
+ @model ||= Models::Star.new(response_with_etag)
25
28
  end
26
- memoize :model
27
29
 
28
30
  def scope; end
29
31
 
@@ -7,6 +7,8 @@ module EveOnline
7
7
  class UniverseStargate < Base
8
8
  extend Forwardable
9
9
 
10
+ include ResponseWithEtag
11
+
10
12
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/stargates/%<stargate_id>s/?datasource=%<datasource>s'
11
13
 
12
14
  attr_reader :id
@@ -18,12 +20,11 @@ module EveOnline
18
20
  end
19
21
 
20
22
  def_delegators :model, :as_json, :name, :stargate_id, :system_id,
21
- :type_id, :destination, :position
23
+ :type_id, :destination, :position, :etag
22
24
 
23
25
  def model
24
- Models::Stargate.new(response)
26
+ @model ||= Models::Stargate.new(response_with_etag)
25
27
  end
26
- memoize :model
27
28
 
28
29
  def scope; end
29
30
 
@@ -23,9 +23,8 @@ module EveOnline
23
23
  :services, :station_id, :system_id, :type_id, :position
24
24
 
25
25
  def model
26
- Models::Station.new(response)
26
+ @model ||= Models::Station.new(response)
27
27
  end
28
- memoize :model
29
28
 
30
29
  def scope; end
31
30
 
@@ -6,13 +6,15 @@ module EveOnline
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v1/universe/system_jumps/?datasource=%<datasource>s'
7
7
 
8
8
  def system_jumps
9
- output = []
10
- response.each do |system_jump|
11
- output << Models::SystemJump.new(system_jump)
12
- end
13
- output
9
+ @system_jumps ||=
10
+ begin
11
+ output = []
12
+ response.each do |system_jump|
13
+ output << Models::SystemJump.new(system_jump)
14
+ end
15
+ output
16
+ end
14
17
  end
15
- memoize :system_jumps
16
18
 
17
19
  def scope; end
18
20
 
@@ -6,13 +6,15 @@ module EveOnline
6
6
  API_ENDPOINT = 'https://esi.evetech.net/v2/universe/system_kills/?datasource=%<datasource>s'
7
7
 
8
8
  def system_kills
9
- output = []
10
- response.each do |system_kill|
11
- output << Models::SystemKill.new(system_kill)
12
- end
13
- output
9
+ @system_kills ||=
10
+ begin
11
+ output = []
12
+ response.each do |system_kill|
13
+ output << Models::SystemKill.new(system_kill)
14
+ end
15
+ output
16
+ end
14
17
  end
15
- memoize :system_kills
16
18
 
17
19
  def scope; end
18
20
 
@@ -23,9 +23,8 @@ module EveOnline
23
23
  :type_id, :volume, :dogma_attributes, :dogma_effects
24
24
 
25
25
  def model
26
- Models::Type.new(response)
26
+ @model ||= Models::Type.new(response)
27
27
  end
28
- memoize :model
29
28
 
30
29
  def scope; end
31
30
 
@@ -15,13 +15,15 @@ module EveOnline
15
15
  end
16
16
 
17
17
  def killmails
18
- output = []
19
- response.each do |killmail|
20
- output << Models::KillmailShort.new(killmail)
21
- end
22
- output
18
+ @killmails ||=
19
+ begin
20
+ output = []
21
+ response.each do |killmail|
22
+ output << Models::KillmailShort.new(killmail)
23
+ end
24
+ output
25
+ end
23
26
  end
24
- memoize :killmails
25
27
 
26
28
  def scope; end
27
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EveOnline
4
- VERSION = '0.20.0'
4
+ VERSION = '0.21.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.20.0
4
+ version: 0.21.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-10-19 00:00:00.000000000 Z
11
+ date: 2018-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,34 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 4.2.0
139
- - !ruby/object:Gem::Dependency
140
- name: json
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
- - !ruby/object:Gem::Dependency
154
- name: memoist
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
139
  description: EveOnline ESI API.
168
140
  email:
169
141
  - igor.zubkov@gmail.com
@@ -200,9 +172,7 @@ files:
200
172
  - lib/eve_online/esi/alliance_corporations.rb
201
173
  - lib/eve_online/esi/alliance_icon.rb
202
174
  - lib/eve_online/esi/alliances.rb
203
- - lib/eve_online/esi/ancestries.rb
204
175
  - lib/eve_online/esi/base.rb
205
- - lib/eve_online/esi/bloodlines.rb
206
176
  - lib/eve_online/esi/character.rb
207
177
  - lib/eve_online/esi/character_assets.rb
208
178
  - lib/eve_online/esi/character_assets_locations.rb
@@ -238,7 +208,6 @@ files:
238
208
  - lib/eve_online/esi/dogma_attributes.rb
239
209
  - lib/eve_online/esi/dogma_effect.rb
240
210
  - lib/eve_online/esi/dogma_effects.rb
241
- - lib/eve_online/esi/factions.rb
242
211
  - lib/eve_online/esi/market_history.rb
243
212
  - lib/eve_online/esi/models/alliance.rb
244
213
  - lib/eve_online/esi/models/alliance_icon.rb
@@ -283,6 +252,7 @@ files:
283
252
  - lib/eve_online/esi/models/killmail_short.rb
284
253
  - lib/eve_online/esi/models/loyalty_point.rb
285
254
  - lib/eve_online/esi/models/market_history.rb
255
+ - lib/eve_online/esi/models/model_with_etag.rb
286
256
  - lib/eve_online/esi/models/moon.rb
287
257
  - lib/eve_online/esi/models/notification.rb
288
258
  - lib/eve_online/esi/models/online.rb
@@ -305,19 +275,23 @@ files:
305
275
  - lib/eve_online/esi/models/system_kill.rb
306
276
  - lib/eve_online/esi/models/type.rb
307
277
  - lib/eve_online/esi/models/wallet_journal_entry.rb
308
- - lib/eve_online/esi/races.rb
278
+ - lib/eve_online/esi/response_with_etag.rb
309
279
  - lib/eve_online/esi/server_status.rb
280
+ - lib/eve_online/esi/universe_ancestries.rb
310
281
  - lib/eve_online/esi/universe_asteroid_belt.rb
282
+ - lib/eve_online/esi/universe_bloodlines.rb
311
283
  - lib/eve_online/esi/universe_categories.rb
312
284
  - lib/eve_online/esi/universe_category.rb
313
285
  - lib/eve_online/esi/universe_constellation.rb
314
286
  - lib/eve_online/esi/universe_constellations.rb
287
+ - lib/eve_online/esi/universe_factions.rb
315
288
  - lib/eve_online/esi/universe_graphic.rb
316
289
  - lib/eve_online/esi/universe_graphics.rb
317
290
  - lib/eve_online/esi/universe_group.rb
318
291
  - lib/eve_online/esi/universe_groups.rb
319
292
  - lib/eve_online/esi/universe_moon.rb
320
293
  - lib/eve_online/esi/universe_planet.rb
294
+ - lib/eve_online/esi/universe_races.rb
321
295
  - lib/eve_online/esi/universe_region.rb
322
296
  - lib/eve_online/esi/universe_regions.rb
323
297
  - lib/eve_online/esi/universe_star.rb
@@ -344,11 +318,15 @@ files:
344
318
  - lib/eve_online/exceptions/unauthorized.rb
345
319
  - lib/eve_online/version.rb
346
320
  - mutant.sh
347
- - server.http
348
321
  homepage: https://github.com/evemonk/eve_online
349
322
  licenses:
350
323
  - MIT
351
- metadata: {}
324
+ metadata:
325
+ bug_tracker_uri: https://github.com/evemonk/eve_online/issues
326
+ changelog_uri: https://github.com/evemonk/eve_online/blob/master/CHANGELOG.md
327
+ documentation_uri: https://github.com/evemonk/eve_online/blob/master/README.md
328
+ homepage_uri: https://github.com/evemonk/eve_online
329
+ source_code_uri: https://github.com/evemonk/eve_online
352
330
  post_install_message:
353
331
  rdoc_options: []
354
332
  require_paths:
@@ -364,8 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
342
  - !ruby/object:Gem::Version
365
343
  version: '0'
366
344
  requirements: []
367
- rubyforge_project:
368
- rubygems_version: 2.7.7
345
+ rubygems_version: 3.0.1
369
346
  signing_key:
370
347
  specification_version: 4
371
348
  summary: EveOnline ESI API.