eve_online 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -1
  3. data/.rubocop-thread_safety.yml +9 -0
  4. data/.rubocop.yml +26 -102
  5. data/.rubocop_general.yml +94 -0
  6. data/.rubocop_rspec.yml +61 -0
  7. data/.rubocop_todo.yml +0 -0
  8. data/.travis.yml +14 -29
  9. data/CHANGELOG.md +329 -0
  10. data/Gemfile +1 -2
  11. data/README.md +840 -1088
  12. data/eve_online.gemspec +8 -8
  13. data/lib/eve_online.rb +45 -59
  14. data/lib/eve_online/esi/alliance.rb +33 -0
  15. data/lib/eve_online/esi/alliance_icon.rb +32 -0
  16. data/lib/eve_online/esi/base.rb +3 -2
  17. data/lib/eve_online/esi/bloodlines.rb +22 -0
  18. data/lib/eve_online/esi/character.rb +13 -56
  19. data/lib/eve_online/esi/character_assets.rb +32 -0
  20. data/lib/eve_online/esi/character_attributes.rb +36 -0
  21. data/lib/eve_online/esi/character_blueprints.rb +32 -0
  22. data/lib/eve_online/esi/character_clones.rb +43 -0
  23. data/lib/eve_online/esi/character_fatigue.rb +35 -0
  24. data/lib/eve_online/esi/character_implants.rb +27 -0
  25. data/lib/eve_online/esi/character_industry_jobs.rb +33 -0
  26. data/lib/eve_online/esi/character_loyalty_points.rb +4 -3
  27. data/lib/eve_online/esi/character_portrait.rb +12 -40
  28. data/lib/eve_online/esi/character_skill_queue.rb +6 -5
  29. data/lib/eve_online/esi/character_skills.rb +6 -5
  30. data/lib/eve_online/esi/character_standings.rb +32 -0
  31. data/lib/eve_online/esi/character_wallet.rb +33 -0
  32. data/lib/eve_online/esi/corporation.rb +35 -0
  33. data/lib/eve_online/esi/corporation_industry_jobs.rb +33 -0
  34. data/lib/eve_online/esi/dogma_attribute.rb +34 -0
  35. data/lib/eve_online/esi/dogma_attributes.rb +17 -0
  36. data/lib/eve_online/esi/factions.rb +22 -0
  37. data/lib/eve_online/esi/models/alliance.rb +34 -0
  38. data/lib/eve_online/esi/models/alliance_icon.rb +22 -0
  39. data/lib/eve_online/esi/models/asset.rb +47 -0
  40. data/lib/eve_online/esi/models/attributes.rb +56 -0
  41. data/lib/eve_online/esi/models/base.rb +21 -0
  42. data/lib/eve_online/esi/models/bloodline.rb +67 -0
  43. data/lib/eve_online/esi/models/blueprint.rb +52 -0
  44. data/lib/eve_online/esi/models/character.rb +64 -0
  45. data/lib/eve_online/esi/models/character_portrait.rb +48 -0
  46. data/lib/eve_online/esi/models/corporation.rb +69 -0
  47. data/lib/eve_online/esi/models/dogma_attribute.rb +62 -0
  48. data/lib/eve_online/esi/models/faction.rb +62 -0
  49. data/lib/eve_online/esi/models/fatigue.rb +33 -0
  50. data/lib/eve_online/esi/models/home_location.rb +22 -0
  51. data/lib/eve_online/esi/models/industry_job.rb +130 -0
  52. data/lib/eve_online/esi/models/jump_clone.rb +27 -0
  53. data/lib/eve_online/esi/models/loyalty_point.rb +1 -7
  54. data/lib/eve_online/esi/models/race.rb +32 -0
  55. data/lib/eve_online/esi/models/server_status.rb +34 -0
  56. data/lib/eve_online/esi/models/skill.rb +1 -7
  57. data/lib/eve_online/esi/models/skill_queue_entry.rb +13 -17
  58. data/lib/eve_online/esi/models/standing.rb +27 -0
  59. data/lib/eve_online/esi/races.rb +22 -0
  60. data/lib/eve_online/esi/server_status.rb +8 -24
  61. data/lib/eve_online/version.rb +1 -1
  62. metadata +67 -83
  63. data/.codeclimate.yml +0 -11
  64. data/.editorconfig +0 -10
  65. data/.rspec +0 -1
  66. data/lib/eve_online/base_crest.rb +0 -11
  67. data/lib/eve_online/blueprint.rb +0 -60
  68. data/lib/eve_online/character.rb +0 -54
  69. data/lib/eve_online/character_implants.rb +0 -29
  70. data/lib/eve_online/character_jump_clone_implants.rb +0 -29
  71. data/lib/eve_online/character_jump_clones.rb +0 -29
  72. data/lib/eve_online/character_skills.rb +0 -29
  73. data/lib/eve_online/eve/character_id.rb +0 -41
  74. data/lib/eve_online/implant.rb +0 -24
  75. data/lib/eve_online/item.rb +0 -49
  76. data/lib/eve_online/jump_clone.rb +0 -34
  77. data/lib/eve_online/jump_clone_implant.rb +0 -29
  78. data/lib/eve_online/sde/chr_races.rb +0 -14
  79. data/lib/eve_online/sde/models/chr_race.rb +0 -38
  80. data/lib/eve_online/skill.rb +0 -34
  81. data/lib/eve_online/sovereignty/campaigns.rb +0 -28
  82. data/lib/eve_online/standing.rb +0 -29
  83. data/lib/eve_online/xml/account_characters.rb +0 -48
  84. data/lib/eve_online/xml/account_status.rb +0 -31
  85. data/lib/eve_online/xml/api_key_info.rb +0 -63
  86. data/lib/eve_online/xml/character_account_balance.rb +0 -59
  87. data/lib/eve_online/xml/character_asset_list.rb +0 -54
  88. data/lib/eve_online/xml/character_blueprints.rb +0 -53
  89. data/lib/eve_online/xml/character_calendar_event_attendees.rb +0 -24
  90. data/lib/eve_online/xml/character_chat_channels.rb +0 -25
  91. data/lib/eve_online/xml/character_contact_list.rb +0 -25
  92. data/lib/eve_online/xml/character_contract_bids.rb +0 -23
  93. data/lib/eve_online/xml/character_contract_items.rb +0 -24
  94. data/lib/eve_online/xml/character_contracts.rb +0 -26
  95. data/lib/eve_online/xml/character_fac_war_stats.rb +0 -23
  96. data/lib/eve_online/xml/character_industry_jobs.rb +0 -23
  97. data/lib/eve_online/xml/character_industry_jobs_history.rb +0 -23
  98. data/lib/eve_online/xml/character_kill_mails.rb +0 -25
  99. data/lib/eve_online/xml/character_locations.rb +0 -32
  100. data/lib/eve_online/xml/character_mail_bodies.rb +0 -30
  101. data/lib/eve_online/xml/character_mail_messages.rb +0 -23
  102. data/lib/eve_online/xml/character_mailing_lists.rb +0 -23
  103. data/lib/eve_online/xml/character_medals.rb +0 -23
  104. data/lib/eve_online/xml/character_notification_texts.rb +0 -32
  105. data/lib/eve_online/xml/character_notifications.rb +0 -23
  106. data/lib/eve_online/xml/character_planetary_colonies.rb +0 -23
  107. data/lib/eve_online/xml/character_planetary_links.rb +0 -24
  108. data/lib/eve_online/xml/character_planetary_pins.rb +0 -24
  109. data/lib/eve_online/xml/character_planetary_routes.rb +0 -24
  110. data/lib/eve_online/xml/character_research.rb +0 -23
  111. data/lib/eve_online/xml/character_sheet.rb +0 -231
  112. data/lib/eve_online/xml/character_skill_in_training.rb +0 -68
  113. data/lib/eve_online/xml/character_skill_queue.rb +0 -51
  114. data/lib/eve_online/xml/character_standings.rb +0 -67
  115. data/lib/eve_online/xml/character_wallet_transactions.rb +0 -24
  116. data/lib/eve_online/xml/models/account_status.rb +0 -40
  117. data/lib/eve_online/xml/models/account_type_object.rb +0 -22
  118. data/lib/eve_online/xml/models/api_key_info.rb +0 -35
  119. data/lib/eve_online/xml/models/skill_queue_entry.rb +0 -55
  120. data/lib/eve_online/xml/server_status.rb +0 -31
@@ -0,0 +1,32 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterBlueprints < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v2/characters/%s/blueprints/?datasource=tranquility&page=1'.freeze
5
+
6
+ attr_reader :character_id
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ end
13
+
14
+ def blueprints
15
+ output = []
16
+ response.each do |blueprint|
17
+ output << Models::Blueprint.new(blueprint)
18
+ end
19
+ output
20
+ end
21
+ memoize :blueprints
22
+
23
+ def scope
24
+ 'esi-characters.read_blueprints.v1'
25
+ end
26
+
27
+ def url
28
+ API_ENDPOINT % character_id
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,43 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterClones < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v2/characters/%s/clones/?datasource=tranquility'.freeze
5
+
6
+ attr_reader :character_id
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ end
13
+
14
+ def last_jump_date
15
+ last_jump_date = response['last_jump_date']
16
+
17
+ parse_datetime_with_timezone(last_jump_date) if last_jump_date
18
+ end
19
+
20
+ def home_location
21
+ Models::HomeLocation.new(response['home_location'])
22
+ end
23
+ memoize :home_location
24
+
25
+ def jump_clones
26
+ output = []
27
+ response['jump_clones'].each do |jump_clone|
28
+ output << Models::JumpClone.new(jump_clone)
29
+ end
30
+ output
31
+ end
32
+ memoize :jump_clones
33
+
34
+ def scope
35
+ 'esi-clones.read_clones.v1'
36
+ end
37
+
38
+ def url
39
+ API_ENDPOINT % character_id
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,35 @@
1
+ require 'forwardable'
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class CharacterFatigue < Base
6
+ extend Forwardable
7
+
8
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/characters/%s/fatigue/?datasource=tranquility'.freeze
9
+
10
+ attr_reader :character_id
11
+
12
+ def initialize(options)
13
+ super
14
+
15
+ @character_id = options[:character_id]
16
+ end
17
+
18
+ def_delegators :model, :as_json, :jump_fatigue_expire_date,
19
+ :last_jump_date, :last_update_date
20
+
21
+ def model
22
+ Models::Fatigue.new(response)
23
+ end
24
+ memoize :model
25
+
26
+ def scope
27
+ 'esi-characters.read_fatigue.v1'
28
+ end
29
+
30
+ def url
31
+ API_ENDPOINT % character_id
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,27 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterImplants < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/characters/%s/implants/?datasource=tranquility'.freeze
5
+
6
+ attr_reader :character_id
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ end
13
+
14
+ def implants
15
+ response
16
+ end
17
+
18
+ def scope
19
+ 'esi-clones.read_implants.v1'
20
+ end
21
+
22
+ def url
23
+ API_ENDPOINT % character_id
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterIndustryJobs < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/characters/%s/industry/jobs/?datasource=tranquility&include_completed=%s'.freeze
5
+
6
+ attr_reader :character_id, :include_completed
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ @include_completed = options[:include_completed] ? true : false
13
+ end
14
+
15
+ def jobs
16
+ output = []
17
+ response.each do |job|
18
+ output << Models::IndustryJob.new(job)
19
+ end
20
+ output
21
+ end
22
+ memoize :jobs
23
+
24
+ def scope
25
+ 'esi-industry.read_character_jobs.v1'
26
+ end
27
+
28
+ def url
29
+ API_ENDPOINT % [character_id, include_completed]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -5,9 +5,10 @@ module EveOnline
5
5
 
6
6
  attr_reader :character_id
7
7
 
8
- def initialize(token, character_id)
9
- super(token)
10
- @character_id = character_id
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
11
12
  end
12
13
 
13
14
  def loyalty_points
@@ -1,55 +1,27 @@
1
+ require 'forwardable'
2
+
1
3
  module EveOnline
2
4
  module ESI
3
5
  class CharacterPortrait < Base
6
+ extend Forwardable
7
+
4
8
  API_ENDPOINT = 'https://esi.tech.ccp.is/v2/characters/%s/portrait/?datasource=tranquility'.freeze
5
9
 
6
10
  attr_reader :character_id
7
11
 
8
- def initialize(character_id)
9
- super()
10
- @character_id = character_id
11
- end
12
-
13
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/imageserver/intro.html#character-images
14
- # Available Sizes: 32, 64, 128, 256, 512, 1024
15
- # https://nethackwiki.com/wiki/Physical_size
16
- # Tiny = 0; Small = 1; Medium = 2; Large = 3; Huge = 4; Gigantic = 7.
17
- def as_json
18
- {
19
- small: small,
20
- medium: medium,
21
- large: large,
22
- huge: huge
23
- }
24
- end
25
-
26
- def tiny
27
- # FIXME: https://github.com/ccpgames/esi-issues/issues/270
28
- # FIXME: https://github.com/ccpgames/esi-issues/issues/131
29
- raise NotImplementedError
30
- end
31
-
32
- def small
33
- response['px64x64']
34
- end
12
+ def initialize(options)
13
+ super
35
14
 
36
- def medium
37
- response['px128x128']
15
+ @character_id = options[:character_id]
38
16
  end
39
17
 
40
- def large
41
- response['px256x256']
42
- end
43
-
44
- def huge
45
- response['px512x512']
46
- end
18
+ def_delegators :model, :as_json, :tiny, :small, :medium, :large, :huge,
19
+ :gigantic
47
20
 
48
- def gigantic
49
- # FIXME: https://github.com/ccpgames/esi-issues/issues/270
50
- # FIXME: https://github.com/ccpgames/esi-issues/issues/131
51
- raise NotImplementedError
21
+ def model
22
+ Models::CharacterPortrait.new(response)
52
23
  end
24
+ memoize :model
53
25
 
54
26
  def scope; end
55
27
 
@@ -1,19 +1,20 @@
1
1
  module EveOnline
2
2
  module ESI
3
3
  class CharacterSkillQueue < Base
4
- API_ENDPOINT = 'https://esi.tech.ccp.is/latest/characters/%s/skillqueue/?datasource=tranquility'.freeze
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v2/characters/%s/skillqueue/?datasource=tranquility'.freeze
5
5
 
6
6
  attr_reader :character_id
7
7
 
8
- def initialize(token, character_id)
9
- super(token)
10
- @character_id = character_id
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
11
12
  end
12
13
 
13
14
  def skills
14
15
  output = []
15
16
  response.each do |skill|
16
- output << EveOnline::ESI::Models::SkillQueueEntry.new(skill)
17
+ output << Models::SkillQueueEntry.new(skill)
17
18
  end
18
19
  output
19
20
  end
@@ -1,13 +1,14 @@
1
1
  module EveOnline
2
2
  module ESI
3
3
  class CharacterSkills < Base
4
- API_ENDPOINT = 'https://esi.tech.ccp.is/latest/characters/%s/skills/?datasource=tranquility'.freeze
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v3/characters/%s/skills/?datasource=tranquility'.freeze
5
5
 
6
6
  attr_reader :character_id
7
7
 
8
- def initialize(token, character_id)
9
- super(token)
10
- @character_id = character_id
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
11
12
  end
12
13
 
13
14
  def as_json
@@ -23,7 +24,7 @@ module EveOnline
23
24
  def skills
24
25
  output = []
25
26
  response.fetch('skills').each do |skill|
26
- output << EveOnline::ESI::Models::Skill.new(skill)
27
+ output << Models::Skill.new(skill)
27
28
  end
28
29
  output
29
30
  end
@@ -0,0 +1,32 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterStandings < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/characters/%s/standings/?datasource=tranquility'.freeze
5
+
6
+ attr_reader :character_id
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ end
13
+
14
+ def standings
15
+ output = []
16
+ response.each do |standing|
17
+ output << Models::Standing.new(standing)
18
+ end
19
+ output
20
+ end
21
+ memoize :standings
22
+
23
+ def scope
24
+ 'esi-characters.read_standings.v1'
25
+ end
26
+
27
+ def url
28
+ API_ENDPOINT % character_id
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,33 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CharacterWallet < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/characters/%s/wallet/?datasource=tranquility'.freeze
5
+
6
+ attr_reader :character_id
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @character_id = options[:character_id]
12
+ end
13
+
14
+ def as_json
15
+ {
16
+ wallet: wallet
17
+ }
18
+ end
19
+
20
+ def wallet
21
+ response
22
+ end
23
+
24
+ def scope
25
+ 'esi-wallet.read_character_wallet.v1'
26
+ end
27
+
28
+ def url
29
+ API_ENDPOINT % character_id
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,35 @@
1
+ require 'forwardable'
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class Corporation < Base
6
+ extend Forwardable
7
+
8
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v3/corporations/%s/?datasource=tranquility'.freeze
9
+
10
+ attr_reader :corporation_id
11
+
12
+ def initialize(options)
13
+ super
14
+
15
+ @corporation_id = options[:corporation_id]
16
+ end
17
+
18
+ def_delegators :model, :as_json, :alliance_id, :ceo_id,
19
+ :corporation_description, :corporation_name,
20
+ :creation_date, :creator_id, :faction,
21
+ :member_count, :tax_rate, :ticker, :corporation_url
22
+
23
+ def model
24
+ Models::Corporation.new(response)
25
+ end
26
+ memoize :model
27
+
28
+ def scope; end
29
+
30
+ def url
31
+ API_ENDPOINT % corporation_id
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,33 @@
1
+ module EveOnline
2
+ module ESI
3
+ class CorporationIndustryJobs < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/corporations/%s/industry/jobs/?datasource=tranquility&include_completed=%s'.freeze
5
+
6
+ attr_reader :corporation_id, :include_completed
7
+
8
+ def initialize(options)
9
+ super
10
+
11
+ @corporation_id = options[:corporation_id]
12
+ @include_completed = options[:include_completed] ? true : false
13
+ end
14
+
15
+ def jobs
16
+ output = []
17
+ response.each do |job|
18
+ output << Models::IndustryJob.new(job)
19
+ end
20
+ output
21
+ end
22
+ memoize :jobs
23
+
24
+ def scope
25
+ 'esi-industry.read_corporation_jobs.v1'
26
+ end
27
+
28
+ def url
29
+ API_ENDPOINT % [corporation_id, include_completed]
30
+ end
31
+ end
32
+ end
33
+ end