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,23 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarycolonies.html
4
- class CharacterPlanetaryColonies < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryColonies.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, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def url
19
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
20
- end
21
- end
22
- end
23
- end
@@ -1,24 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarylinks.html
4
- class CharacterPlanetaryLinks < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryLinks.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2
8
-
9
- attr_reader :key_id, :v_code, :character_id, :planet_id
10
-
11
- def initialize(key_id, v_code, character_id, planet_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- @planet_id = planet_id
17
- end
18
-
19
- def url
20
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetarypins.html
4
- class CharacterPlanetaryPins < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryPins.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2
8
-
9
- attr_reader :key_id, :v_code, :character_id, :planet_id
10
-
11
- def initialize(key_id, v_code, character_id, planet_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- @planet_id = planet_id
17
- end
18
-
19
- def url
20
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_planetaryroutes.html
4
- class CharacterPlanetaryRoutes < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/PlanetaryRoutes.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 2
8
-
9
- attr_reader :key_id, :v_code, :character_id, :planet_id
10
-
11
- def initialize(key_id, v_code, character_id, planet_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- @planet_id = planet_id
17
- end
18
-
19
- def url
20
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }&planetID=#{ planet_id }"
21
- end
22
- end
23
- end
24
- end
@@ -1,23 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_research.html
4
- class CharacterResearch < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/Research.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 65_536
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def url
19
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
20
- end
21
- end
22
- end
23
- end
@@ -1,231 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_charactersheet.html
4
- class CharacterSheet < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/CharacterSheet.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 8
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
- id: id,
21
- name: name,
22
- home_station_id: home_station_id,
23
- dob: dob,
24
- race: race,
25
- blood_line_id: blood_line_id,
26
- blood_line: blood_line,
27
- ancestry_id: ancestry_id,
28
- ancestry: ancestry,
29
- gender: gender,
30
- corporation_name: corporation_name,
31
- corporation_id: corporation_id,
32
- alliance_name: alliance_name,
33
- alliance_id: alliance_id,
34
- faction_name: faction_name,
35
- faction_id: faction_id,
36
- clone_type_id: clone_type_id,
37
- clone_name: clone_name,
38
- clone_skill_points: clone_skill_points,
39
- free_skill_points: free_skill_points,
40
- free_respecs: free_respecs,
41
- clone_jump_date: clone_jump_date,
42
- last_respec_date: last_respec_date,
43
- last_timed_respec: last_timed_respec,
44
- remote_station_date: remote_station_date
45
- }
46
- end
47
-
48
- def id
49
- result.fetch('characterID').to_i
50
- end
51
-
52
- def name
53
- result.fetch('name')
54
- end
55
-
56
- def home_station_id
57
- result.fetch('homeStationID').to_i
58
- end
59
-
60
- def dob
61
- parse_datetime_with_timezone(result.fetch('DoB'))
62
- end
63
-
64
- def race
65
- result.fetch('race')
66
- end
67
-
68
- def blood_line_id
69
- result.fetch('bloodLineID').to_i
70
- end
71
-
72
- def blood_line
73
- result.fetch('bloodLine')
74
- end
75
-
76
- def ancestry_id
77
- result.fetch('ancestryID').to_i
78
- end
79
-
80
- def ancestry
81
- result.fetch('ancestry')
82
- end
83
-
84
- def gender
85
- result.fetch('gender').downcase.to_sym
86
- end
87
-
88
- def corporation_name
89
- result.fetch('corporationName')
90
- end
91
-
92
- def corporation_id
93
- result.fetch('corporationID').to_i
94
- end
95
-
96
- def alliance_name
97
- # TODO: Corporation "Federal Navy Academy" doesn't have allianceName in response
98
- result.fetch('allianceName')
99
- end
100
-
101
- def alliance_id
102
- # TODO: Corporation "Federal Navy Academy" doesn't have allianceID in response
103
- result.fetch('allianceID').to_i
104
- end
105
-
106
- def faction_name
107
- # TODO: Corporation "Federal Navy Academy" doesn't have factionName in response
108
- result.fetch('factionName')
109
- end
110
-
111
- def faction_id
112
- # TODO: Corporation "Federal Navy Academy" doesn't have factionID in response
113
- result.fetch('factionID').to_i
114
- end
115
-
116
- def clone_type_id
117
- result.fetch('cloneTypeID').to_i
118
- end
119
-
120
- def clone_name
121
- result.fetch('cloneName')
122
- end
123
-
124
- def clone_skill_points
125
- result.fetch('cloneSkillPoints').to_i
126
- end
127
-
128
- def free_skill_points
129
- result.fetch('freeSkillPoints').to_i
130
- end
131
-
132
- def free_respecs
133
- result.fetch('freeRespecs').to_i
134
- end
135
-
136
- def clone_jump_date
137
- parse_datetime_with_timezone(result.fetch('cloneJumpDate'))
138
- end
139
-
140
- def last_respec_date
141
- parse_datetime_with_timezone(result.fetch('lastRespecDate'))
142
- end
143
-
144
- def last_timed_respec
145
- parse_datetime_with_timezone(result.fetch('lastTimedRespec'))
146
- end
147
-
148
- def remote_station_date
149
- parse_datetime_with_timezone(result.fetch('remoteStationDate'))
150
- end
151
-
152
- # TODO: add to as_json output
153
- def jump_activation
154
- parse_datetime_with_timezone(result.fetch('jumpActivation'))
155
- end
156
-
157
- # TODO: add to as_json output
158
- def jump_fatigue
159
- parse_datetime_with_timezone(result.fetch('jumpFatigue'))
160
- end
161
-
162
- # TODO: add to as_json output
163
- def jump_last_update
164
- parse_datetime_with_timezone(result.fetch('jumpLastUpdate'))
165
- end
166
-
167
- # TODO: add to as_json output
168
- def balance
169
- result.fetch('balance').to_f
170
- end
171
-
172
- # TODO: add to as_json output
173
- def intelligence
174
- attributes.fetch('intelligence').to_i
175
- end
176
-
177
- # TODO: add to as_json output
178
- def memory
179
- attributes.fetch('memory').to_i
180
- end
181
-
182
- # TODO: add to as_json output
183
- def charisma
184
- attributes.fetch('charisma').to_i
185
- end
186
-
187
- # TODO: add to as_json output
188
- def perception
189
- attributes.fetch('perception').to_i
190
- end
191
-
192
- # TODO: add to as_json output
193
- def willpower
194
- attributes.fetch('willpower').to_i
195
- end
196
-
197
- def implants
198
- CharacterImplants.new(result).implants
199
- end
200
- memoize :implants
201
-
202
- def skills
203
- CharacterSkills.new(result).skills
204
- end
205
- memoize :skills
206
-
207
- def jump_clones
208
- CharacterJumpClones.new(result).jump_clones
209
- end
210
- memoize :jump_clones
211
-
212
- def jump_clone_implants
213
- CharacterJumpCloneImplants.new(result).jump_clone_implants
214
- end
215
- memoize :jump_clone_implants
216
-
217
- def url
218
- output = "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
219
- output = "#{ output }&characterID=#{ character_id }" if character_id
220
- output
221
- end
222
-
223
- private
224
-
225
- def attributes
226
- result.fetch('attributes')
227
- end
228
- memoize :attributes
229
- end
230
- end
231
- end
@@ -1,68 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/character/char_skillintraining.html
4
- class CharacterSkillInTraining < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/SkillInTraining.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 131_072
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def as_json
19
- {
20
- current_tq_time: current_tq_time,
21
- training_end_time: training_end_time,
22
- training_start_time: training_start_time,
23
- training_type_id: training_type_id,
24
- training_start_sp: training_start_sp,
25
- training_destination_sp: training_destination_sp,
26
- training_to_level: training_to_level,
27
- skill_in_training: skill_in_training
28
- }
29
- end
30
-
31
- def current_tq_time
32
- parse_datetime_with_timezone(result.fetch('currentTQTime'))
33
- end
34
-
35
- def training_end_time
36
- parse_datetime_with_timezone(result.fetch('trainingEndTime'))
37
- end
38
-
39
- def training_start_time
40
- parse_datetime_with_timezone(result.fetch('trainingStartTime'))
41
- end
42
-
43
- def training_type_id
44
- result.fetch('trainingTypeID').to_i
45
- end
46
-
47
- def training_start_sp
48
- result.fetch('trainingStartSP').to_i
49
- end
50
-
51
- def training_destination_sp
52
- result.fetch('trainingDestinationSP').to_i
53
- end
54
-
55
- def training_to_level
56
- result.fetch('trainingToLevel').to_i
57
- end
58
-
59
- def skill_in_training
60
- result.fetch('skillInTraining').to_i
61
- end
62
-
63
- def url
64
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
65
- end
66
- end
67
- end
68
- end
@@ -1,51 +0,0 @@
1
- module EveOnline
2
- module XML
3
- # https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/character/char_skillqueue.html
4
- class CharacterSkillQueue < Base
5
- API_ENDPOINT = 'https://api.eveonline.com/char/SkillQueue.xml.aspx'.freeze
6
-
7
- ACCESS_MASK = 262_144
8
-
9
- attr_reader :key_id, :v_code, :character_id
10
-
11
- def initialize(key_id, v_code, character_id)
12
- super()
13
- @key_id = key_id
14
- @v_code = v_code
15
- @character_id = character_id
16
- end
17
-
18
- def skills
19
- case row
20
- when Hash
21
- [EveOnline::XML::Models::SkillQueueEntry.new(row)]
22
- when Array
23
- output = []
24
- row.each do |skill|
25
- output << EveOnline::XML::Models::SkillQueueEntry.new(skill)
26
- end
27
- output
28
- else
29
- raise ArgumentError
30
- end
31
- end
32
- memoize :skills
33
-
34
- def url
35
- "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }&characterID=#{ character_id }"
36
- end
37
-
38
- private
39
-
40
- def rowset
41
- result.fetch('rowset')
42
- end
43
- memoize :rowset
44
-
45
- def row
46
- rowset.fetch('row')
47
- end
48
- memoize :row
49
- end
50
- end
51
- end