eve-4 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +0 -0
  4. data/.idea/.name +1 -0
  5. data/.idea/.rakeTasks +7 -0
  6. data/.idea/dictionaries/tylercollins.xml +3 -0
  7. data/.idea/encodings.xml +5 -0
  8. data/.idea/eve-updated.iml +58 -0
  9. data/.idea/misc.xml +5 -0
  10. data/.idea/modules.xml +9 -0
  11. data/.idea/scopes/scope_settings.xml +5 -0
  12. data/.idea/vcs.xml +7 -0
  13. data/.idea/workspace.xml +554 -0
  14. data/Gemfile +2 -0
  15. data/Gemfile.lock +108 -0
  16. data/History.txt +7 -0
  17. data/Rakefile +37 -0
  18. data/eve.gemspec +36 -0
  19. data/lib/eve.rb +26 -0
  20. data/lib/eve/api.rb +249 -0
  21. data/lib/eve/api/connectivity.rb +39 -0
  22. data/lib/eve/api/request.rb +80 -0
  23. data/lib/eve/api/response.rb +34 -0
  24. data/lib/eve/api/response/result.rb +87 -0
  25. data/lib/eve/api/response/row.rb +42 -0
  26. data/lib/eve/api/response/rowset.rb +18 -0
  27. data/lib/eve/api/services.rb +20 -0
  28. data/lib/eve/api/services/account.rb +12 -0
  29. data/lib/eve/api/services/character.rb +96 -0
  30. data/lib/eve/api/services/corporation.rb +150 -0
  31. data/lib/eve/api/services/eve.rb +76 -0
  32. data/lib/eve/api/services/map.rb +45 -0
  33. data/lib/eve/api/services/misc.rb +24 -0
  34. data/lib/eve/api/services/server.rb +20 -0
  35. data/lib/eve/dependencies.rb +48 -0
  36. data/lib/eve/deprecation.rb +3 -0
  37. data/lib/eve/errors.rb +129 -0
  38. data/lib/eve/errors/authentication_errors.rb +33 -0
  39. data/lib/eve/errors/internal_errors.rb +64 -0
  40. data/lib/eve/errors/miscellaneous_errors.rb +19 -0
  41. data/lib/eve/errors/user_input_errors.rb +62 -0
  42. data/lib/eve/javascript_helper.rb +196 -0
  43. data/lib/eve/trust.rb +87 -0
  44. data/lib/eve/trust/controller_helpers.rb +86 -0
  45. data/lib/eve/trust/igb_interface.rb +92 -0
  46. data/lib/eve/trust/mime_types.rb +4 -0
  47. data/lib/eve/version.rb +8 -0
  48. data/log/development.log +30 -0
  49. data/spec/controllers/controller_helpers_spec.rb +91 -0
  50. data/spec/helpers/javascript_helper_spec.rb +80 -0
  51. data/spec/helpers/view_helper_spec.rb +7 -0
  52. data/spec/lib/eve/api/calls/account/characters_spec.rb +22 -0
  53. data/spec/lib/eve/api/calls/character/account_balance_spec.rb +21 -0
  54. data/spec/lib/eve/api/calls/character/asset_list_spec.rb +23 -0
  55. data/spec/lib/eve/api/calls/character/character_sheet_spec.rb +51 -0
  56. data/spec/lib/eve/api/calls/character/fac_war_stats_spec.rb +31 -0
  57. data/spec/lib/eve/api/calls/character/industry_jobs_spec.rb +27 -0
  58. data/spec/lib/eve/api/calls/character/kill_log_spec.rb +27 -0
  59. data/spec/lib/eve/api/calls/character/mail_messages_spec.rb +21 -0
  60. data/spec/lib/eve/api/calls/character/mailing_lists_spec.rb +21 -0
  61. data/spec/lib/eve/api/calls/character/market_orders_spec.rb +21 -0
  62. data/spec/lib/eve/api/calls/character/medals_spec.rb +24 -0
  63. data/spec/lib/eve/api/calls/character/research_spec.rb +21 -0
  64. data/spec/lib/eve/api/calls/character/skill_in_training_spec.rb +44 -0
  65. data/spec/lib/eve/api/calls/character/skill_queue_spec.rb +21 -0
  66. data/spec/lib/eve/api/calls/character/standings_spec.rb +26 -0
  67. data/spec/lib/eve/api/calls/character/wallet_journal_spec.rb +21 -0
  68. data/spec/lib/eve/api/calls/character/wallet_transactions_spec.rb +21 -0
  69. data/spec/lib/eve/api/calls/character_portrait_spec.rb +17 -0
  70. data/spec/lib/eve/api/calls/corporation/account_balances_spec.rb +21 -0
  71. data/spec/lib/eve/api/calls/corporation/asset_list_spec.rb +25 -0
  72. data/spec/lib/eve/api/calls/corporation/container_log_spec.rb +23 -0
  73. data/spec/lib/eve/api/calls/corporation/corporation_sheet_spec.rb +36 -0
  74. data/spec/lib/eve/api/calls/corporation/fac_war_stats_spec.rb +23 -0
  75. data/spec/lib/eve/api/calls/corporation/industry_jobs_spec.rb +30 -0
  76. data/spec/lib/eve/api/calls/corporation/kill_log_spec.rb +27 -0
  77. data/spec/lib/eve/api/calls/corporation/market_orders_spec.rb +22 -0
  78. data/spec/lib/eve/api/calls/corporation/medals_spec.rb +21 -0
  79. data/spec/lib/eve/api/calls/corporation/member_medals_spec.rb +21 -0
  80. data/spec/lib/eve/api/calls/corporation/member_security_log_spec.rb +24 -0
  81. data/spec/lib/eve/api/calls/corporation/member_security_spec.rb +25 -0
  82. data/spec/lib/eve/api/calls/corporation/member_tracking_spec.rb +22 -0
  83. data/spec/lib/eve/api/calls/corporation/shareholders_spec.rb +23 -0
  84. data/spec/lib/eve/api/calls/corporation/standings_spec.rb +30 -0
  85. data/spec/lib/eve/api/calls/corporation/starbase_detail_spec.rb +32 -0
  86. data/spec/lib/eve/api/calls/corporation/starbase_list_spec.rb +22 -0
  87. data/spec/lib/eve/api/calls/corporation/titles_spec.rb +26 -0
  88. data/spec/lib/eve/api/calls/corporation/wallet_journal_spec.rb +22 -0
  89. data/spec/lib/eve/api/calls/corporation/wallet_transactions_spec.rb +22 -0
  90. data/spec/lib/eve/api/calls/empty_call_spec.rb +29 -0
  91. data/spec/lib/eve/api/calls/eve/alliance_list_spec.rb +26 -0
  92. data/spec/lib/eve/api/calls/eve/certificate_tree_spec.rb +18 -0
  93. data/spec/lib/eve/api/calls/eve/character_id_spec.rb +27 -0
  94. data/spec/lib/eve/api/calls/eve/conquerable_station_list_spec.rb +11 -0
  95. data/spec/lib/eve/api/calls/eve/error_list_spec.rb +21 -0
  96. data/spec/lib/eve/api/calls/eve/fac_war_stats_spec.rb +25 -0
  97. data/spec/lib/eve/api/calls/eve/fac_war_top_stats_spec.rb +54 -0
  98. data/spec/lib/eve/api/calls/eve/ref_types_spec.rb +11 -0
  99. data/spec/lib/eve/api/calls/eve/skill_tree_spec.rb +17 -0
  100. data/spec/lib/eve/api/calls/map/fac_war_systems_spec.rb +11 -0
  101. data/spec/lib/eve/api/calls/map/jumps_spec.rb +11 -0
  102. data/spec/lib/eve/api/calls/map/kills_spec.rb +11 -0
  103. data/spec/lib/eve/api/calls/map/sovereignty_spec.rb +11 -0
  104. data/spec/lib/eve/api/calls/server_status_spec.rb +28 -0
  105. data/spec/lib/eve/api/request_spec.rb +18 -0
  106. data/spec/lib/eve/api/response/error_spec.rb +13 -0
  107. data/spec/lib/eve/api/response_spec.rb +79 -0
  108. data/spec/lib/eve/api_spec.rb +13 -0
  109. data/spec/lib/eve/core_extensions/hash_spec.rb +23 -0
  110. data/spec/lib/eve/core_extensions/string_spec.rb +8 -0
  111. data/spec/lib/eve/trust/igb_interface_spec.rb +112 -0
  112. data/spec/log/development.log +0 -0
  113. data/spec/rcov.opts +2 -0
  114. data/spec/readme_spec.rb +36 -0
  115. data/spec/sample_api_key.yml +20 -0
  116. data/spec/spec.opts +4 -0
  117. data/spec/spec_helper.rb +63 -0
  118. data/spec/support/behaves_like_rowset.rb +50 -0
  119. data/spec/support/controllers/trust_controller.rb +24 -0
  120. data/spec/support/jpg/mock_portrait.jpg +0 -0
  121. data/spec/support/mock_api_helpers.rb +46 -0
  122. data/spec/support/views/trust/html_and_igb.html.erb +1 -0
  123. data/spec/support/views/trust/html_and_igb.igb.erb +1 -0
  124. data/spec/support/views/trust/html_only.html.erb +1 -0
  125. data/spec/support/views/trust/igb_only.igb.erb +1 -0
  126. data/spec/support/xml/account/characters.xml +15 -0
  127. data/spec/support/xml/character/account_balance.xml +10 -0
  128. data/spec/support/xml/character/asset_list.xml +50 -0
  129. data/spec/support/xml/character/character_sheet.xml +65 -0
  130. data/spec/support/xml/character/fac_war_stats.xml +20 -0
  131. data/spec/support/xml/character/industry_jobs.xml +70 -0
  132. data/spec/support/xml/character/kill_log.xml +51 -0
  133. data/spec/support/xml/character/mail_messages.xml +12 -0
  134. data/spec/support/xml/character/mailing_lists.xml +12 -0
  135. data/spec/support/xml/character/market_orders.xml +11 -0
  136. data/spec/support/xml/character/medals.xml +13 -0
  137. data/spec/support/xml/character/research.xml +13 -0
  138. data/spec/support/xml/character/skill_in_training.xml +14 -0
  139. data/spec/support/xml/character/skill_not_in_training.xml +7 -0
  140. data/spec/support/xml/character/skill_queue.xml +11 -0
  141. data/spec/support/xml/character/standings.xml +32 -0
  142. data/spec/support/xml/character/wallet_journal.xml +39 -0
  143. data/spec/support/xml/character/wallet_transactions.xml +44 -0
  144. data/spec/support/xml/corporation/account_balance.xml +15 -0
  145. data/spec/support/xml/corporation/asset_list.xml +50 -0
  146. data/spec/support/xml/corporation/container_log.xml +32 -0
  147. data/spec/support/xml/corporation/fac_war_stats.xml +19 -0
  148. data/spec/support/xml/corporation/industry_jobs.xml +70 -0
  149. data/spec/support/xml/corporation/kill_log.xml +51 -0
  150. data/spec/support/xml/corporation/market_orders.xml +37 -0
  151. data/spec/support/xml/corporation/medals.xml +8 -0
  152. data/spec/support/xml/corporation/member_corporation_sheet.xml +51 -0
  153. data/spec/support/xml/corporation/member_medals.xml +10 -0
  154. data/spec/support/xml/corporation/member_security.xml +21 -0
  155. data/spec/support/xml/corporation/member_security_log.xml +55 -0
  156. data/spec/support/xml/corporation/member_tracking.xml +18 -0
  157. data/spec/support/xml/corporation/non_member_corporation_sheet.xml +30 -0
  158. data/spec/support/xml/corporation/shareholders.xml +11 -0
  159. data/spec/support/xml/corporation/standings.xml +33 -0
  160. data/spec/support/xml/corporation/starbase_detail.xml +33 -0
  161. data/spec/support/xml/corporation/starbase_list.xml +17 -0
  162. data/spec/support/xml/corporation/titles.xml +34 -0
  163. data/spec/support/xml/corporation/wallet_journal.xml +40 -0
  164. data/spec/support/xml/corporation/wallet_transactions.xml +12 -0
  165. data/spec/support/xml/errors/106.xml +5 -0
  166. data/spec/support/xml/errors/516.xml +5 -0
  167. data/spec/support/xml/eve/alliance_list.xml +22 -0
  168. data/spec/support/xml/eve/certificate_tree.xml +49 -0
  169. data/spec/support/xml/eve/character_id.xml +15 -0
  170. data/spec/support/xml/eve/conquerable_station_list.xml +24 -0
  171. data/spec/support/xml/eve/error_list.xml +78 -0
  172. data/spec/support/xml/eve/fac_war_stats.xml +31 -0
  173. data/spec/support/xml/eve/fac_war_top_stats.xml +238 -0
  174. data/spec/support/xml/eve/ref_types.xml +105 -0
  175. data/spec/support/xml/eve/skill_tree.xml +52 -0
  176. data/spec/support/xml/map/fac_war_systems.xml +180 -0
  177. data/spec/support/xml/map/jumps.xml +166 -0
  178. data/spec/support/xml/map/kills.xml +191 -0
  179. data/spec/support/xml/map/sovereignty.xml +20 -0
  180. data/spec/support/xml/rowset_with_mismatched_attributes.xml +6 -0
  181. data/spec/support/xml/server/server_status.xml +9 -0
  182. metadata +310 -2
@@ -0,0 +1,76 @@
1
+ module Eve
2
+ class API
3
+ module Services
4
+ module Eve
5
+ def alliance_list; request(:eve, :alliance_list); end
6
+ def certificate_tree; request(:eve, :certificate_tree, :column_mapping => { 'level' => 'skillLevel' }); end
7
+ def conquerable_station_list; request(:eve, :conquerable_station_list); end
8
+ def error_list; request(:eve, :error_list); end
9
+ def fac_war_stats; request(:eve, :fac_war_stats); end
10
+ def fac_war_top_stats; request(:eve, :fac_war_top_stats); end
11
+ def skill_tree; request(:eve, :skill_tree); end
12
+
13
+ # Returns a list of transaction types used in the Journal Entries
14
+ # Response Example:
15
+ # result = api.eve.ref_types
16
+ # result.ref_types #=> (Rowset)
17
+ # result.ref_types[0].ref_type_id #=> 0
18
+ # result.ref_types[0].ref_type_name #=> "Undefined"
19
+ # result.ref_types[1].ref_type_id #=> 1
20
+ # result.ref_types[1].ref_type_name #=> "Player Trading"
21
+ # . . .
22
+ def ref_types
23
+ response = request(:eve, :ref_types)
24
+ result = {}
25
+ response.ref_types.each do |row|
26
+ result[row.ref_type_id] = row.ref_type_name
27
+ end
28
+ result
29
+ end
30
+
31
+ # Character ID to Name conversion. Accepts a list of character names, and returns the name for each name
32
+ # in the form of a Hash. Despite the name, it can also accept corporation and alliance names.
33
+ def character_id(*names)
34
+ response = request(:eve, :character_id, :names => names.flatten.join(','))
35
+ result = {}
36
+ [:characters, :corporations, :alliances].each do |field|
37
+ if response.respond_to?(field)
38
+ response.send(field).each { |row| result[row.name] = row.character_id }
39
+ end
40
+ end
41
+ result
42
+ end
43
+
44
+ # Character ID to Name conversion. Accepts a list of character IDs, and returns the name for each ID
45
+ # in the form of a Hash. Despite the name, it can also accept corporation and alliance IDs.
46
+ def character_name(*ids)
47
+ response = request(:eve, :character_name, :ids => ids.flatten.join(','))
48
+ result = {}
49
+ [:characters, :corporations, :alliances].each do |field|
50
+ if response.respond_to?(field)
51
+ response.send(field).each { |row| result[row.name] = row.name }
52
+ end
53
+ end
54
+ result
55
+ end
56
+
57
+ alias character_ids character_id
58
+ alias corporation_ids character_id
59
+ alias corporation_id character_id
60
+ alias corporation_ids character_id
61
+ alias alliance_ids character_id
62
+ alias alliance_id character_id
63
+
64
+ alias character_names character_name
65
+ alias corporation_names character_names
66
+ alias corporation_name character_name
67
+ alias corporation_names character_names
68
+ alias alliance_names character_names
69
+ alias alliance_name character_name
70
+
71
+ alias factional_warfare_stats fac_war_stats
72
+ alias factional_warfare_top100 fac_war_top_stats
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,45 @@
1
+ module Eve
2
+ class API
3
+ module Services
4
+ module Map
5
+ # Returns the sovereignty status of all solar systems. Warning: This is a lot of data!
6
+ #
7
+ # Returns an object with a single "solar_systems" array. Each element in the array contains:
8
+ # solar_system_id
9
+ # alliance_id
10
+ # faction_id
11
+ # corporation_id
12
+ # solar_system_name
13
+ def sovereignty; request('map', :sovereignty); end
14
+
15
+ # Returns the sovereignty status of all solar systems. Warning: This is a lot of data!
16
+ #
17
+ # Returns an object with a single "solar_systems" array. Each element in the array contains:
18
+ # solar_system_id
19
+ # ship_kills (number)
20
+ # faction_kills (number)
21
+ # pod_kills (number)
22
+ def kills; request('map', :kills); end
23
+
24
+ # Returns the sovereignty status of all solar systems. Warning: This is a lot of data!
25
+ #
26
+ # Returns an object with a single "solar_systems" array. Each element in the array contains:
27
+ # solar_system_id
28
+ # ship_jumps (number)
29
+ def jumps; request('map', :jumps); end
30
+
31
+ # Returns the sovereignty status of all solar systems. Warning: This is a lot of data!
32
+ #
33
+ # Returns an object with a single "solar_systems" array. Each element in the array contains:
34
+ # solar_system_id
35
+ # solar_system_name
36
+ # occupying_faction_id
37
+ # occupying_faction_name
38
+ # contested (boolean)
39
+ def fac_war_systems; request('map', :fac_war_systems); end
40
+
41
+ alias contested_systems fac_war_systems
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,24 @@
1
+ module Eve
2
+ class API
3
+ module Services
4
+ module Misc
5
+ # Returns a binary String representing a JPEG image that is the portrait of the character with
6
+ # the specified ID.
7
+ #
8
+ # Optionally, the :size may be set to 64x64 or 256x256. This defaults to 64x64.
9
+ #
10
+ # Example:
11
+ # api.character_portrait(661196469)
12
+ #
13
+ def character_portrait(character_id, options = { :size => 64 })
14
+ options[:s] ||= options.delete(:size)
15
+ options[:c] ||= character_id
16
+ request('', 'serv', options.reverse_merge(:base_uri => 'http://img.eve.is',
17
+ :extension => 'asp',
18
+ :camelize => false,
19
+ :response_type => :string))
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module Eve
2
+ class API
3
+ module Services
4
+ module Server
5
+ # Returns the current server status.
6
+ #
7
+ # >> puts Eve::API.new.server_status.to_yaml
8
+ # ---
9
+ # current_time: 2010-03-14T04:41:51+00:00
10
+ # cached_until: 2010-03-14T04:44:51+00:00
11
+ # online_players: 30694
12
+ # server_open: true
13
+ # api_version: "2"
14
+ def server_status
15
+ request(:server, :server_status)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,48 @@
1
+ require 'net/http'
2
+ require 'nokogiri'
3
+ require 'yaml'
4
+ require 'sc-core-ext'
5
+ require 'active_support/core_ext'
6
+
7
+ gem_path = File.expand_path(File.dirname(__FILE__), "..")
8
+ $LOAD_PATH.unshift gem_path
9
+
10
+ module Eve
11
+ autoload :Errors, "eve/errors"
12
+ autoload :API, "eve/api"
13
+ autoload :Errors, "eve/errors"
14
+ autoload :JavascriptHelper, "eve/javascript_helper"
15
+ autoload :Trust, "eve/trust"
16
+ autoload :Version, "eve/version"
17
+ autoload :VERSION, "eve/version"
18
+
19
+ require 'eve/deprecation'
20
+
21
+ # Railtie for bootstrapping to Rails
22
+ begin
23
+ require 'rails'
24
+ require 'action_pack'
25
+ require 'action_controller'
26
+ require 'action_view'
27
+
28
+ class Railtie < Rails::Railtie
29
+ config.after_initialize do
30
+ if defined?(Mime::Type)
31
+ # *.igb.erb format
32
+ Mime::Type.register_alias "text/html", :eve
33
+ Mime::Type.register_alias "text/html", :igb
34
+ end
35
+
36
+ # controller extensions
37
+ ActionController::Base.send(:include, Eve::Trust::ControllerHelpers)
38
+
39
+ # view extensions
40
+ ActionView::Base.send(:delegate, :igb, :to => :controller)
41
+ ActionView::Base.send(:delegate, :igb?, :to => :igb)
42
+ ActionView::Base.send(:include, Eve::JavascriptHelper)
43
+ end
44
+ end
45
+ rescue LoadError
46
+ # no rails? no problem.
47
+ end
48
+ end
@@ -0,0 +1,3 @@
1
+ ActiveSupport::Deprecation.deprecate_methods(Eve::Trust::ControllerHelpers, {
2
+ :prefer_trust => "The EVE IGB no longer accepts trust headers. Please use <%=request_trust%> in your view, instead."
3
+ })
data/lib/eve/errors.rb ADDED
@@ -0,0 +1,129 @@
1
+ require 'eve/errors/user_input_errors'
2
+ require 'eve/errors/authentication_errors'
3
+ require 'eve/errors/internal_errors'
4
+ require 'eve/errors/miscellaneous_errors'
5
+
6
+ module Eve
7
+ module Errors
8
+ class << self
9
+ # Returns an error class by its code. If a match cannot be found, the closest match is used instead.
10
+ # For instance, '100' returns WalletNotLoaded; '199' returns UserInputError.
11
+ def find_by_code(code)
12
+ return API_ERROR_MAP[code.to_i] if API_ERROR_MAP.key?(code.to_i)
13
+ # exact match can't be found, look for x's
14
+ code = code.to_s
15
+ while code.length > 0
16
+ generic_code = code + "x"*(3-code.length)
17
+ return API_ERROR_MAP[generic_code] if API_ERROR_MAP.key?(generic_code)
18
+ code = code[0...-1]
19
+ end
20
+ UnknownError
21
+ end
22
+
23
+ def raise(*several_variants)
24
+ options = several_variants.extract_options!
25
+ super if options.empty?
26
+ if options[:code]
27
+ klass = find_by_code(options[:code])
28
+ message = options[:message]
29
+ raise klass, message, caller
30
+ end
31
+ end
32
+ end
33
+
34
+ # Raised when a rowset cannot be processed.
35
+ class InvalidRowset < StandardError; end
36
+
37
+ # Raised when something goes wrong and no other error can be found.
38
+ class UnknownError < StandardError; end
39
+
40
+ unless defined?(API_ERROR_MAP)
41
+ API_ERROR_MAP = {
42
+ '1xx' => Eve::Errors::UserInputError,
43
+ 100 => Eve::Errors::UserInputErrors::WalletNotLoaded,
44
+ 101 => Eve::Errors::UserInputErrors::WalletExhausted,
45
+ 102 => Eve::Errors::UserInputErrors::WalletPreviouslyLoaded,
46
+ 103 => Eve::Errors::UserInputErrors::RetryLater,
47
+ 104 => Eve::Errors::UserInputErrors::KeyNotFound,
48
+ 105 => Eve::Errors::UserInputErrors::InvalidCharacterID,
49
+ 106 => Eve::Errors::UserInputErrors::MissingUserID,
50
+ 107 => Eve::Errors::UserInputErrors::InvalidBeforeRefID,
51
+ 108 => Eve::Errors::UserInputErrors::InvalidAccountKey,
52
+ 109 => Eve::Errors::UserInputErrors::AccountKeyOutOfBounds,
53
+ 110 => Eve::Errors::UserInputErrors::InvalidBeforeTransID,
54
+ 111 => Eve::Errors::UserInputErrors::InvalidInteger,
55
+ 112 => Eve::Errors::UserInputErrors::VersionMismatch,
56
+ 113 => Eve::Errors::UserInputErrors::VersionEscalationNotAllowed,
57
+ 114 => Eve::Errors::UserInputErrors::InvalidItemID,
58
+ 115 => Eve::Errors::UserInputErrors::AssetsAlreadyDownloaded,
59
+ 116 => Eve::Errors::UserInputErrors::IndustryJobsAlreadyDownloaded,
60
+ 117 => Eve::Errors::UserInputErrors::MarketOrdersAlreadyDownloaded,
61
+ 118 => Eve::Errors::UserInputErrors::KillsNotLoaded,
62
+ 119 => Eve::Errors::UserInputErrors::KillsExhausted,
63
+ 120 => Eve::Errors::UserInputErrors::KillsPreviouslyLoaded,
64
+ 121 => Eve::Errors::UserInputErrors::InvalidBeforeKillID,
65
+ 122 => Eve::Errors::UserInputErrors::InvalidNameList,
66
+ 123 => Eve::Errors::UserInputErrors::InvalidIDList,
67
+ 124 => Eve::Errors::UserInputErrors::CharacterNotEnlisted,
68
+ 125 => Eve::Errors::UserInputErrors::CorporationNotEnlisted,
69
+
70
+ '2xx' => Eve::Errors::AuthenticationError,
71
+ 200 => Eve::Errors::AuthenticationErrors::InadequateSecurityLevel,
72
+ 201 => Eve::Errors::AuthenticationErrors::WrongAccount,
73
+ 202 => Eve::Errors::AuthenticationErrors::CachedKeyAuthFailure,
74
+ 203 => Eve::Errors::AuthenticationErrors::AuthenticationFailure,
75
+ 204 => Eve::Errors::AuthenticationErrors::AuthenticationFailure,
76
+ 205 => Eve::Errors::AuthenticationErrors::LastAuthenticationFailure,
77
+ 206 => Eve::Errors::AuthenticationErrors::MissingRoles,
78
+ 207 => Eve::Errors::AuthenticationErrors::NotAvailable,
79
+ 208 => Eve::Errors::AuthenticationErrors::MissingRoles,
80
+ 209 => Eve::Errors::AuthenticationErrors::MissingRoles,
81
+ 210 => Eve::Errors::AuthenticationErrors::AuthenticationFailure,
82
+ 211 => Eve::Errors::AuthenticationErrors::LoginDenied,
83
+ 212 => Eve::Errors::AuthenticationErrors::LastAuthenticationFailure,
84
+ 213 => Eve::Errors::AuthenticationErrors::MissingRoles,
85
+ 214 => Eve::Errors::AuthenticationErrors::NotInAlliance,
86
+
87
+
88
+ '5xx' => Eve::Errors::InternalError,
89
+ 500 => Eve::Errors::InternalErrors::InvalidOrNotLoaded,
90
+ 501 => Eve::Errors::InternalErrors::InvalidOrNotLoaded,
91
+ 502 => Eve::Errors::InternalErrors::CacheUtilMissing,
92
+ 503 => Eve::Errors::InternalErrors::InvalidInput,
93
+ 504 => Eve::Errors::InternalErrors::InvalidRace,
94
+ 505 => Eve::Errors::InternalErrors::InvalidGender,
95
+ 506 => Eve::Errors::InternalErrors::InvalidBloodline,
96
+ 507 => Eve::Errors::InternalErrors::InvalidAttribute,
97
+ 508 => Eve::Errors::InternalErrors::InvalidRefType,
98
+ 509 => Eve::Errors::InternalErrors::NullAttributeID,
99
+ 510 => Eve::Errors::InternalErrors::MissingCorporation,
100
+ 511 => Eve::Errors::InternalErrors::InvalidAccountKey,
101
+ 512 => Eve::Errors::InternalErrors::InvalidCharID,
102
+ 513 => Eve::Errors::InternalErrors::RolesQueryFailure,
103
+ 514 => Eve::Errors::InternalErrors::InvalidCorpID,
104
+ 515 => Eve::Errors::InternalErrors::InvalidUserID,
105
+ 516 => Eve::Errors::InternalErrors::UserInformationFailure,
106
+ 517 => Eve::Errors::InternalErrors::CSVMismatch,
107
+ 518 => Eve::Errors::InternalErrors::TQTimeFailure,
108
+ 519 => Eve::Errors::InternalErrors::StarbaseDetailFailure,
109
+ 520 => Eve::Errors::InternalErrors::UnexpectedDatabaseFailure,
110
+ 521 => Eve::Errors::InternalErrors::InvalidCredentials,
111
+ 522 => Eve::Errors::InternalErrors::CharacterInformationFailure,
112
+ 523 => Eve::Errors::InternalErrors::CorporationInformationFailure,
113
+ 524 => Eve::Errors::InternalErrors::FactionMemberInformationFailure,
114
+ 525 => Eve::Errors::InternalErrors::MedalInformationFailure,
115
+ 526 => Eve::Errors::InternalErrors::NotificationsNotAvailable,
116
+ 527 => Eve::Errors::InternalErrors::MailNotAvailable,
117
+
118
+ '9xx' => Eve::Errors::MiscellaneousError,
119
+ 900 => Eve::Errors::MiscellaneousErrors::BetaInProgress,
120
+ 901 => Eve::Errors::MiscellaneousErrors::SiteDatabaseDisabled,
121
+ 902 => Eve::Errors::MiscellaneousErrors::BackendDatabaseDisabled,
122
+ 903 => Eve::Errors::MiscellaneousErrors::RateLimited,
123
+ 999 => Eve::Errors::MiscellaneousErrors::TestErrorForced,
124
+ }
125
+
126
+ API_ERROR_MAP.freeze
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,33 @@
1
+ module Eve
2
+ module Errors
3
+ # 2xx - authentication/security/credentials error
4
+ class AuthenticationError < StandardError; end
5
+
6
+ module AuthenticationErrors
7
+ # 200 - Security level not high enough.
8
+ class InadequateSecurityLevel < AuthenticationError; end
9
+ # 201 - Character does not belong to account.
10
+ class WrongAccount < AuthenticationError; end
11
+ # 202 - Cached API key authentication failure.
12
+ class CachedKeyAuthFailure < AuthenticationError; end
13
+ # 203 - Authentication failure.
14
+ # 204 - Authentication failure.
15
+ # 210 - Authentication failure.
16
+ class AuthenticationFailure < AuthenticationError; end
17
+ # 205 - Authentication failure (final pass).
18
+ # 212 - Authentication failure (final pass).
19
+ class LastAuthenticationFailure < AuthenticationError; end
20
+ # 207 - Not available for NPC corporations.
21
+ class NotAvailable < AuthenticationError; end
22
+ # 206 - Character must have Accountant or Junior Accountant roles.
23
+ # 208 - Character must have Accountant, Junior Accountant, or Trader roles.
24
+ # 209 - Character must be a Director or CEO.
25
+ # 213 - Character must have Factory Manager role.
26
+ class MissingRoles < AuthenticationError; end
27
+ # 211 - Login denied by account status.
28
+ class LoginDenied < AuthenticationError; end
29
+ # 214 - Corporation is not part of alliance.
30
+ class NotInAlliance < AuthenticationError; end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,64 @@
1
+ module Eve
2
+ module Errors
3
+ # 5xx - Internal error (we did something bad)
4
+ class InternalError < StandardError; end
5
+
6
+ module InternalErrors
7
+ # 500 - GetName(#) is invalid or not loaded.
8
+ # 501 - GetID(#) is invalid or not loaded.
9
+ class InvalidOrNotLoaded < InternalError; end
10
+ # 502 - CacheUtil(#) seems to not be in the configuration.
11
+ class CacheUtilMissing < InternalError; end
12
+ # 503 - GetSkillpointsForLevel(#, #): invalid input.
13
+ class InvalidInput < InternalError; end
14
+ # 504 - GetRace(#): invalid race.
15
+ class InvalidRace < InternalError; end
16
+ # 505 - GetGender(#): invalid gender.
17
+ class InvalidGender < InternalError; end
18
+ # 506 - GetBloodline(#): invalid bloodline.
19
+ class InvalidBloodline < InternalError; end
20
+ # 507 - GetAttribute(#): invalid attribute.
21
+ class InvalidAttribute < InternalError; end
22
+ # 508 - GetRefType(#): invalid reftype.
23
+ class InvalidRefType < InternalError; end
24
+ # 509 - attributeID # has null data components.
25
+ class NullAttributeID < InternalError; end
26
+ # 510 - Character does not appear to have a corporation. Not loaded?
27
+ class MissingCorporation < InternalError; end
28
+ # 511 - AccountCanQuery(#): invalid accountKey.
29
+ class InvalidAccountKey < InternalError; end
30
+ # 512 - Invalid charID passed to CharData.GetCharacter()
31
+ class InvalidCharID < InternalError; end
32
+ # 513 - Failed to get character roles in corporation.
33
+ class RolesQueryFailure < InternalError; end
34
+ # 514 - Invalid corpID passed to CorpData.GetCorporation().
35
+ class InvalidCorpID < InternalError; end
36
+ # 515 - Invalid userID and/or apiKey passed to UserData.GetUser().
37
+ class InvalidUserID < InternalError; end
38
+ # 516 - Failed getting user information.
39
+ class UserInformationFailure < InternalError; end
40
+ # 517 - CSV header/row count mismatch.
41
+ class CSVMismatch < InternalError; end
42
+ # 518 - Unable to get current TQ time.
43
+ class TQTimeFailure < InternalError; end
44
+ # 519 - Failed getting starbase detail information.
45
+ class StarbaseDetailFailure < InternalError; end
46
+ # 520 - Unexpected failure accessing database.
47
+ class UnexpectedDatabaseFailure < InternalError; end
48
+ # 521 - Invalid username and/or password passed to UserData.LoginWebUser().
49
+ class InvalidCredentials < InternalError; end
50
+ # 522 - Failed getting character information.
51
+ class CharacterInformationFailure < InternalError; end
52
+ # 523 - Failed getting corporation information.
53
+ class CorporationInformationFailure < InternalError; end
54
+ # 524 - Failed getting faction member information.
55
+ class FactionMemberInformationFailure < InternalError; end
56
+ # 525 - Failed getting medal information.
57
+ class MedalInformationFailure < InternalError; end
58
+ # 526 - Notifications for this character is not yet accessible.
59
+ class NotificationsNotAvailable < InternalError; end
60
+ # 527 - Mail for this character is not yet accessible.
61
+ class MailNotAvailable < InternalError; end
62
+ end
63
+ end
64
+ end