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
@@ -1,14 +0,0 @@
1
- module EveOnline
2
- module SDE
3
- class ChrRaces < Base
4
- def chr_races
5
- output = []
6
- data.each do |chr_race|
7
- output << EveOnline::SDE::Models::ChrRace.new(chr_race)
8
- end
9
- output
10
- end
11
- memoize :chr_races
12
- end
13
- end
14
- end
@@ -1,38 +0,0 @@
1
- module EveOnline
2
- module SDE
3
- module Models
4
- class ChrRace
5
- attr_reader :data
6
-
7
- def initialize(data)
8
- @data = data
9
- end
10
-
11
- def as_json
12
- {
13
- race_id: race_id,
14
- race_name: race_name,
15
- short_description: short_description,
16
- description: description
17
- }
18
- end
19
-
20
- def race_id
21
- data['raceID']
22
- end
23
-
24
- def race_name
25
- data['raceName']
26
- end
27
-
28
- def short_description
29
- data['shortDescription']
30
- end
31
-
32
- def description
33
- data['description']
34
- end
35
- end
36
- end
37
- end
38
- end
@@ -1,34 +0,0 @@
1
- module EveOnline
2
- class Skill
3
- attr_reader :options
4
-
5
- def initialize(options)
6
- @options = options
7
- end
8
-
9
- def as_json
10
- {
11
- type_id: type_id,
12
- skillpoints: skillpoints,
13
- level: level,
14
- published: published
15
- }
16
- end
17
-
18
- def type_id
19
- options.fetch('@typeID').to_i
20
- end
21
-
22
- def skillpoints
23
- options.fetch('@skillpoints').to_i
24
- end
25
-
26
- def level
27
- options.fetch('@level').to_i
28
- end
29
-
30
- def published
31
- options.fetch('@published') == '1'
32
- end
33
- end
34
- end
@@ -1,28 +0,0 @@
1
- module EveOnline
2
- module Sovereignty
3
- # TODO: WTF? where docs???
4
- # https://developers.eveonline.com/blog/article/aegis-sovereignty-api-changes
5
- class Campaigns < BaseCREST
6
- API_ENDPOINT = 'https://crest-tq.eveonline.com/sovereignty/campaigns/'.freeze
7
-
8
- # TODO: return array of objects
9
- def items
10
- response.fetch('items')
11
- end
12
-
13
- # TODO: recheck this and maybe remove as unneeded
14
- def page_count
15
- response.fetch('pageCount')
16
- end
17
-
18
- # TODO: recheck this and maybe remove as unneeded
19
- def total_count
20
- response.fetch('totalCount')
21
- end
22
-
23
- def url
24
- API_ENDPOINT
25
- end
26
- end
27
- end
28
- end
@@ -1,29 +0,0 @@
1
- module EveOnline
2
- class Standing
3
- attr_reader :options
4
-
5
- def initialize(options)
6
- @options = options
7
- end
8
-
9
- def as_json
10
- {
11
- from_id: from_id,
12
- from_name: from_name,
13
- standing: standing
14
- }
15
- end
16
-
17
- def from_id
18
- options.fetch('@fromID').to_i
19
- end
20
-
21
- def from_name
22
- options.fetch('@fromName')
23
- end
24
-
25
- def standing
26
- options.fetch('@standing').to_f
27
- end
28
- end
29
- end
@@ -1,48 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/account/account_characters.html
4
- class AccountCharacters < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/account/Characters.xml.aspx'.freeze
6
-
7
- attr_reader :key_id, :v_code
8
-
9
- def initialize(key_id, v_code)
10
- super()
11
- @key_id = key_id
12
- @v_code = v_code
13
- end
14
-
15
- def characters
16
- case row
17
- when Hash
18
- [Character.new(row)]
19
- when Array
20
- output = []
21
- row.each do |character|
22
- output << Character.new(character)
23
- end
24
- output
25
- else
26
- raise ArgumentError
27
- end
28
- end
29
- memoize :characters
30
-
31
- def url
32
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
33
- end
34
-
35
- private
36
-
37
- def rowset
38
- result.fetch('rowset')
39
- end
40
- memoize :rowset
41
-
42
- def row
43
- rowset.fetch('row')
44
- end
45
- memoize :row
46
- end
47
- end
48
- end
@@ -1,31 +0,0 @@
1
- require 'forwardable'
2
-
3
- module EveOnline
4
- module XML
5
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/account/account_accountstatus.html
6
- class AccountStatus < Base
7
- extend Forwardable
8
-
9
- API_ENDPOINT = 'https://api.eveonline.com/account/AccountStatus.xml.aspx'.freeze
10
-
11
- attr_reader :key_id, :v_code, :model
12
-
13
- def_delegators :model, :as_json, :paid_until, :create_date, :logon_count, :logon_minutes
14
-
15
- def initialize(key_id, v_code)
16
- super()
17
- @key_id = key_id
18
- @v_code = v_code
19
- end
20
-
21
- def model
22
- Models::AccountStatus.new(result)
23
- end
24
- memoize :model
25
-
26
- def url
27
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
28
- end
29
- end
30
- end
31
- end
@@ -1,63 +0,0 @@
1
- require 'forwardable'
2
-
3
- module EveOnline
4
- module XML
5
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/account/account_apikeyinfo.html
6
- class ApiKeyInfo < Base
7
- extend Forwardable
8
-
9
- API_ENDPOINT = 'https://api.eveonline.com/account/APIKeyInfo.xml.aspx'.freeze
10
-
11
- attr_reader :key_id, :v_code
12
-
13
- def_delegators :model, :as_json, :expires, :api_key_type, :access_mask
14
-
15
- def initialize(key_id, v_code)
16
- super()
17
- @key_id = key_id
18
- @v_code = v_code
19
- end
20
-
21
- def model
22
- Models::ApiKeyInfo.new(key)
23
- end
24
- memoize :model
25
-
26
- def characters
27
- case row
28
- when Hash
29
- [Character.new(row)]
30
- when Array
31
- output = []
32
- row.each do |character|
33
- output << Character.new(character)
34
- end
35
- output
36
- else
37
- raise ArgumentError
38
- end
39
- end
40
- memoize :characters
41
-
42
- def url
43
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
44
- end
45
-
46
- private
47
-
48
- def key
49
- result.fetch('key')
50
- end
51
-
52
- def rowset
53
- key.fetch('rowset')
54
- end
55
- memoize :rowset
56
-
57
- def row
58
- rowset.fetch('row')
59
- end
60
- memoize :row
61
- end
62
- end
63
- end
@@ -1,59 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_accountbalance.html
4
- class CharacterAccountBalance < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/AccountBalance.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 1
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 as_json
19
- {
20
- account_id: account_id,
21
- account_key: account_key,
22
- balance: balance,
23
- current_time: current_time,
24
- cached_until: cached_until
25
- }
26
- end
27
-
28
- def account_id
29
- row.fetch('@accountID').to_i
30
- end
31
-
32
- def account_key
33
- row.fetch('@accountKey').to_i
34
- end
35
-
36
- def balance
37
- row.fetch('@balance').to_f
38
- end
39
-
40
- def url
41
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
42
- output = "#{ output }&characterID=#{ character_id }" if character_id
43
- output
44
- end
45
-
46
- private
47
-
48
- def rowset
49
- result.fetch('rowset')
50
- end
51
- memoize :rowset
52
-
53
- def row
54
- rowset.fetch('row')
55
- end
56
- memoize :row
57
- end
58
- end
59
- end
@@ -1,54 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_assetlist.html
4
- class CharacterAssetList < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/AssetList.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2
8
-
9
- attr_reader :key_id, :v_code, :character_id, :flat
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
- @flat = options.fetch(:flat, 1)
17
- end
18
-
19
- def assets
20
- case row
21
- when Hash
22
- [Item.new(row)]
23
- when Array
24
- output = []
25
- row.each do |item|
26
- output << Item.new(item)
27
- end
28
- output
29
- else
30
- raise ArgumentError
31
- end
32
- end
33
- memoize :assets
34
-
35
- def url
36
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&flat=#{ flat }"
37
- output = "#{ output }&characterID=#{ character_id }" if character_id
38
- output
39
- end
40
-
41
- private
42
-
43
- def rowset
44
- result.fetch('rowset')
45
- end
46
- memoize :rowset
47
-
48
- def row
49
- rowset.fetch('row')
50
- end
51
- memoize :row
52
- end
53
- end
54
- end
@@ -1,53 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_blueprints.html
4
- class CharacterBlueprints < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/Blueprints.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2
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 blueprints
19
- case row
20
- when Hash
21
- [Blueprint.new(row)]
22
- when Array
23
- output = []
24
- row.each do |blueprint|
25
- output << Blueprint.new(blueprint)
26
- end
27
- output
28
- else
29
- raise ArgumentError
30
- end
31
- end
32
- memoize :blueprints
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