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,34 @@
1
+ require 'forwardable'
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class DogmaAttribute < Base
6
+ extend Forwardable
7
+
8
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/dogma/attributes/%s/?datasource=tranquility'.freeze
9
+
10
+ attr_reader :attribute_id
11
+
12
+ def initialize(options)
13
+ super
14
+
15
+ @attribute_id = options[:attribute_id]
16
+ end
17
+
18
+ def_delegators :model, :as_json, :id, :name, :description, :icon_id,
19
+ :default_value, :published, :display_name, :unit_id,
20
+ :stackable, :high_is_good
21
+
22
+ def model
23
+ Models::DogmaAttribute.new(response)
24
+ end
25
+ memoize :model
26
+
27
+ def scope; end
28
+
29
+ def url
30
+ API_ENDPOINT % attribute_id
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,17 @@
1
+ module EveOnline
2
+ module ESI
3
+ class DogmaAttributes < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v1/dogma/attributes/?datasource=tranquility'.freeze
5
+
6
+ def attributes
7
+ response
8
+ end
9
+
10
+ def scope; end
11
+
12
+ def url
13
+ API_ENDPOINT
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ module EveOnline
2
+ module ESI
3
+ class Factions < Base
4
+ API_ENDPOINT = 'https://esi.tech.ccp.is/v2/universe/factions/?datasource=tranquility&language=en-us'.freeze
5
+
6
+ def factions
7
+ output = []
8
+ response.each do |faction|
9
+ output << Models::Faction.new(faction)
10
+ end
11
+ output
12
+ end
13
+ memoize :factions
14
+
15
+ def scope; end
16
+
17
+ def url
18
+ API_ENDPOINT
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,34 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Alliance < Base
5
+ def as_json
6
+ {
7
+ alliance_name: alliance_name,
8
+ ticker: ticker,
9
+ date_founded: date_founded,
10
+ executor_corp: executor_corp
11
+ }
12
+ end
13
+
14
+ def alliance_name
15
+ options['alliance_name']
16
+ end
17
+
18
+ def ticker
19
+ options['ticker']
20
+ end
21
+
22
+ def date_founded
23
+ date_founded = options['date_founded']
24
+
25
+ parse_datetime_with_timezone(date_founded) if date_founded
26
+ end
27
+
28
+ def executor_corp
29
+ options['executor_corp']
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,22 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class AllianceIcon < Base
5
+ def as_json
6
+ {
7
+ small: small,
8
+ medium: medium
9
+ }
10
+ end
11
+
12
+ def small
13
+ options['px64x64']
14
+ end
15
+
16
+ def medium
17
+ options['px128x128']
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,47 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Asset < Base
5
+ def as_json
6
+ {
7
+ type_id: type_id,
8
+ location_id: location_id,
9
+ location_type: location_type,
10
+ item_id: item_id,
11
+ location_flag: location_flag,
12
+ is_singleton: is_singleton,
13
+ quantity: quantity
14
+ }
15
+ end
16
+
17
+ def type_id
18
+ options['type_id']
19
+ end
20
+
21
+ def location_id
22
+ options['location_id']
23
+ end
24
+
25
+ def location_type
26
+ options['location_type']
27
+ end
28
+
29
+ def item_id
30
+ options['item_id']
31
+ end
32
+
33
+ def location_flag
34
+ options['location_flag']
35
+ end
36
+
37
+ def is_singleton
38
+ options['is_singleton']
39
+ end
40
+
41
+ def quantity
42
+ options['quantity']
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,56 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Attributes < Base
5
+ def as_json
6
+ {
7
+ charisma: charisma,
8
+ intelligence: intelligence,
9
+ memory: memory,
10
+ perception: perception,
11
+ willpower: willpower,
12
+ bonus_remaps: bonus_remaps,
13
+ last_remap_date: last_remap_date,
14
+ accrued_remap_cooldown_date: accrued_remap_cooldown_date
15
+ }
16
+ end
17
+
18
+ def charisma
19
+ options['charisma']
20
+ end
21
+
22
+ def intelligence
23
+ options['intelligence']
24
+ end
25
+
26
+ def memory
27
+ options['memory']
28
+ end
29
+
30
+ def perception
31
+ options['perception']
32
+ end
33
+
34
+ def willpower
35
+ options['willpower']
36
+ end
37
+
38
+ def bonus_remaps
39
+ options['bonus_remaps']
40
+ end
41
+
42
+ def last_remap_date
43
+ last_remap_date = options['last_remap_date']
44
+
45
+ parse_datetime_with_timezone(last_remap_date) if last_remap_date
46
+ end
47
+
48
+ def accrued_remap_cooldown_date
49
+ accrued_remap_cooldown_date = options['accrued_remap_cooldown_date']
50
+
51
+ parse_datetime_with_timezone(accrued_remap_cooldown_date) if accrued_remap_cooldown_date
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,21 @@
1
+ require 'active_support/time'
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class Base
7
+ attr_reader :options
8
+
9
+ def initialize(options)
10
+ @options = options
11
+ end
12
+
13
+ private
14
+
15
+ def parse_datetime_with_timezone(value)
16
+ ActiveSupport::TimeZone['UTC'].parse(value)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,67 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Bloodline < Base
5
+ def as_json
6
+ {
7
+ bloodline_id: bloodline_id,
8
+ name: name,
9
+ description: description,
10
+ race_id: race_id,
11
+ ship_type_id: ship_type_id,
12
+ corporation_id: corporation_id,
13
+ perception: perception,
14
+ willpower: willpower,
15
+ charisma: charisma,
16
+ memory: memory,
17
+ intelligence: intelligence
18
+ }
19
+ end
20
+
21
+ def bloodline_id
22
+ options['bloodline_id']
23
+ end
24
+
25
+ def name
26
+ options['name']
27
+ end
28
+
29
+ def description
30
+ options['description']
31
+ end
32
+
33
+ def race_id
34
+ options['race_id']
35
+ end
36
+
37
+ def ship_type_id
38
+ options['ship_type_id']
39
+ end
40
+
41
+ def corporation_id
42
+ options['corporation_id']
43
+ end
44
+
45
+ def perception
46
+ options['perception']
47
+ end
48
+
49
+ def willpower
50
+ options['willpower']
51
+ end
52
+
53
+ def charisma
54
+ options['charisma']
55
+ end
56
+
57
+ def memory
58
+ options['memory']
59
+ end
60
+
61
+ def intelligence
62
+ options['intelligence']
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,52 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Blueprint < Base
5
+ def as_json
6
+ {
7
+ item_id: item_id,
8
+ location_flag: location_flag,
9
+ location_id: location_id,
10
+ material_efficiency: material_efficiency,
11
+ quantity: quantity,
12
+ runs: runs,
13
+ time_efficiency: time_efficiency,
14
+ type_id: type_id
15
+ }
16
+ end
17
+
18
+ def item_id
19
+ options['item_id']
20
+ end
21
+
22
+ def location_flag
23
+ options['location_flag']
24
+ end
25
+
26
+ def location_id
27
+ options['location_id']
28
+ end
29
+
30
+ def material_efficiency
31
+ options['material_efficiency']
32
+ end
33
+
34
+ def quantity
35
+ options['quantity']
36
+ end
37
+
38
+ def runs
39
+ options['runs']
40
+ end
41
+
42
+ def time_efficiency
43
+ options['time_efficiency']
44
+ end
45
+
46
+ def type_id
47
+ options['type_id']
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,64 @@
1
+ module EveOnline
2
+ module ESI
3
+ module Models
4
+ class Character < Base
5
+ def as_json
6
+ {
7
+ corporation_id: corporation_id,
8
+ birthday: birthday,
9
+ name: name,
10
+ gender: gender,
11
+ race_id: race_id,
12
+ bloodline_id: bloodline_id,
13
+ description: description,
14
+ alliance_id: alliance_id,
15
+ ancestry_id: ancestry_id,
16
+ security_status: security_status
17
+ }
18
+ end
19
+
20
+ def corporation_id
21
+ options['corporation_id']
22
+ end
23
+
24
+ def birthday
25
+ birthday = options['birthday']
26
+
27
+ parse_datetime_with_timezone(birthday) if birthday
28
+ end
29
+
30
+ def name
31
+ options['name']
32
+ end
33
+
34
+ def gender
35
+ options['gender']
36
+ end
37
+
38
+ def race_id
39
+ options['race_id']
40
+ end
41
+
42
+ def bloodline_id
43
+ options['bloodline_id']
44
+ end
45
+
46
+ def description
47
+ options['description']
48
+ end
49
+
50
+ def alliance_id
51
+ options['alliance_id']
52
+ end
53
+
54
+ def ancestry_id
55
+ options['ancestry_id']
56
+ end
57
+
58
+ def security_status
59
+ options['security_status']
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end