eveapi 0.0.4.pre → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.rubocop.yml +6 -0
- data/README.md +24 -21
- data/Rakefile +11 -11
- data/eveapi.gemspec +11 -11
- data/lib/eveapi.rb +26 -17
- data/lib/eveapi/client.rb +13 -30
- data/lib/eveapi/console.rb +2 -2
- data/lib/eveapi/request.rb +6 -5
- data/lib/eveapi/util.rb +39 -8
- data/lib/eveapi/version.rb +2 -1
- data/spec/eveapi_spec.rb +10 -10
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
- data/.gitmodules +0 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NGQ0N2YxMGJkY2I2ODBkMWJiZDRiOWMyOTZhYmM5ZGQwOWIwODU2Nw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MzdiOWFhOTI3ZDRhZDkwYTZkNjBjYzAwOWFlZTMwMzFhY2M2NmZjMA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Y2ZjZDllZGVkNmYzZDAwMWJkM2E1MGRmZjczZGQ3MmZiZmRmODVlNDc0ZmU3
|
|
10
|
+
OWViMmFjMzQwOGQxZjY3OGI2NDUxOGQwYzUzY2YwOWZhM2NjOGM2N2YyY2Qy
|
|
11
|
+
ZTc3ZDUyMWY1YmRmMTU1YWFlMTI5Mjc1OTNmZjlkYmI5ZjgxODU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZmIzYjM1M2IyMDQwY2Q1OWMzZmUyMzIwYzE3ZDkzYTQxMDJiM2MxMzE3OWRh
|
|
14
|
+
MzZjMmMyZjQxN2U1YzhiNDM0YmJjZDJjZTE3MTNkNWY4OTQ0NzU5NWRmOWI0
|
|
15
|
+
MzU4M2EwODYyMzUzYTU2NTYzMjJhM2YwOTRkM2I0ODYzNTNmYTQ=
|
data/.rubocop.yml
ADDED
data/README.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
*EVE API for ruby*
|
|
4
4
|
|
|
5
|
+
[](http://badge.fury.io/rb/eveapi)
|
|
5
6
|
[](https://travis-ci.org/aladac/eveapi)
|
|
6
7
|
[](https://codeclimate.com/github/aladac/eveapi)
|
|
7
8
|
[](https://codeclimate.com/github/aladac/eveapi/coverage)
|
|
9
|
+
[](https://rubygems.org/gems/eveapi)
|
|
10
|
+
|
|
8
11
|
|
|
9
12
|
## Disclaimer!
|
|
10
13
|
This work in progress in a very early stage. Not documented. Only a couple of methods are tested.
|
|
@@ -29,27 +32,27 @@ Because of the way the paths are being built from the method names - some method
|
|
|
29
32
|
|
|
30
33
|
| Method Name | Requires | Output Class |
|
|
31
34
|
| ------------- | ------------- | ------------- |
|
|
32
|
-
| [account_api_key_info](account_api_key_info) |
|
|
33
|
-
| [account_account_status](account_account_status) | `key_id`, `vcode` | `Hash` |
|
|
34
|
-
| [account_characters](account_characters) | `key_id`, `vcode` | `Array` |
|
|
35
|
-
| [server_server_status](server_server_status) | - | `Hash` |
|
|
36
|
-
| [char_wallet_transactions](char_wallet_transactions) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
37
|
-
| [char_wallet_journal](char_wallet_journal) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
38
|
-
| [char_standings](char_standings) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
39
|
-
| [char_skill_queue](char_skill_queue) | | |
|
|
40
|
-
| [char_skill_in_training](char_skill_in_training) | | |
|
|
41
|
-
| [char_research](char_research) | | |
|
|
42
|
-
| [char_notifications](char_notifications) | | |
|
|
43
|
-
| [char_medals](char_medals) | | |
|
|
44
|
-
| [char_market_orders](char_market_orders)
|
|
45
|
-
| [char_mail_messages](char_mail_messages) | | |
|
|
46
|
-
| [char_mailing_lists](char_mailing_lists) | | |
|
|
47
|
-
| [char_industry_jobs](char_industry_jobs)
|
|
48
|
-
| [char_contact_notifications](char_contact_notifications)
|
|
49
|
-
| [char_contact_list](char_contact_list) | | |
|
|
50
|
-
| [char_character_sheet](char_character_sheet) | | |
|
|
51
|
-
| [char_asset_list](char_asset_list) | | |
|
|
52
|
-
| [char_account_balance](char_account_balance)
|
|
35
|
+
| [account_api_key_info](https://github.com/aladac/eveapi/wiki/account_api_key_info) | `key_id`, `vcode` | `Hash` |
|
|
36
|
+
| [account_account_status](https://github.com/aladac/eveapi/wiki/account_account_status) | `key_id`, `vcode` | `Hash` |
|
|
37
|
+
| [account_characters](https://github.com/aladac/eveapi/wiki/account_characters) | `key_id`, `vcode` | `Array` |
|
|
38
|
+
| [server_server_status](https://github.com/aladac/eveapi/wiki/server_server_status) | - | `Hash` |
|
|
39
|
+
| [char_wallet_transactions](https://github.com/aladac/eveapi/wiki/char_wallet_transactions) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
40
|
+
| [char_wallet_journal](https://github.com/aladac/eveapi/wiki/char_wallet_journal) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
41
|
+
| [char_standings](https://github.com/aladac/eveapi/wiki/char_standings) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
42
|
+
| [char_skill_queue](https://github.com/aladac/eveapi/wiki/char_skill_queue) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
43
|
+
| [char_skill_in_training](https://github.com/aladac/eveapi/wiki/char_skill_in_training) | `key_id`, `vcode`, `character_id` | `Hash` |
|
|
44
|
+
| [char_research](https://github.com/aladac/eveapi/wiki/char_research) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
45
|
+
| [char_notifications](https://github.com/aladac/eveapi/wiki/char_notifications) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
46
|
+
| [char_medals](https://github.com/aladac/eveapi/wiki/char_medals) | `key_id`, `vcode`, `character_id` | `Hash` |
|
|
47
|
+
| [char_market_orders](https://github.com/aladac/eveapi/wiki/char_market_orders) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
48
|
+
| [char_mail_messages](https://github.com/aladac/eveapi/wiki/char_mail_messages) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
49
|
+
| [char_mailing_lists](https://github.com/aladac/eveapi/wiki/char_mailing_lists) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
50
|
+
| [char_industry_jobs](https://github.com/aladac/eveapi/wiki/char_industry_jobs) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
51
|
+
| [char_contact_notifications](https://github.com/aladac/eveapi/wiki/char_contact_notifications) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
52
|
+
| [char_contact_list](https://github.com/aladac/eveapi/wiki/char_contact_list) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
53
|
+
| [char_character_sheet](https://github.com/aladac/eveapi/wiki/char_character_sheet) | `key_id`, `vcode`, `character_id` | `Hash` |
|
|
54
|
+
| [char_asset_list](https://github.com/aladac/eveapi/wiki/char_asset_list) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
55
|
+
| [char_account_balance](https://github.com/aladac/eveapi/wiki/char_account_balance) | `key_id`, `vcode`, `character_id` | `Array` |
|
|
53
56
|
|
|
54
57
|
## Description
|
|
55
58
|
|
data/Rakefile
CHANGED
|
@@ -14,7 +14,7 @@ require 'bundler/gem_tasks'
|
|
|
14
14
|
|
|
15
15
|
require 'rdoc/task'
|
|
16
16
|
RDoc::Task.new
|
|
17
|
-
task :
|
|
17
|
+
task doc: :rdoc
|
|
18
18
|
|
|
19
19
|
require 'rspec/core/rake_task'
|
|
20
20
|
RSpec::Core::RakeTask.new
|
|
@@ -35,12 +35,12 @@ task :methods do
|
|
|
35
35
|
EVEApi::Client.new.working_methods.each do |m|
|
|
36
36
|
p m
|
|
37
37
|
@client = EVEApi::Client.new
|
|
38
|
-
@client.key_id =
|
|
39
|
-
@client.vcode =
|
|
38
|
+
@client.key_id = 4_278_167
|
|
39
|
+
@client.vcode = 'supersecretstuff'
|
|
40
40
|
@client.character_id = '95512059'
|
|
41
|
-
out =
|
|
41
|
+
out = ''
|
|
42
42
|
begin
|
|
43
|
-
out << @client.api_methods_hash.
|
|
43
|
+
out << @client.api_methods_hash.find { |me| me[:name] == m }[:desc]
|
|
44
44
|
rescue
|
|
45
45
|
out << "TODO Description (#{m})"
|
|
46
46
|
end
|
|
@@ -52,15 +52,15 @@ task :methods do
|
|
|
52
52
|
begin
|
|
53
53
|
out << @client.send(m).pretty_inspect
|
|
54
54
|
out << '```'
|
|
55
|
-
f = File.new("
|
|
55
|
+
f = File.new("./doc/wiki/#{m}.md", 'w')
|
|
56
56
|
f.puts out
|
|
57
57
|
f.close
|
|
58
|
-
rescue
|
|
58
|
+
rescue => e
|
|
59
|
+
puts e.message
|
|
59
60
|
end
|
|
60
61
|
end
|
|
61
62
|
end
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
task :
|
|
65
|
-
task :
|
|
66
|
-
task :default => :spec
|
|
64
|
+
task c: :console
|
|
65
|
+
task test: :spec
|
|
66
|
+
task default: :spec
|
data/eveapi.gemspec
CHANGED
|
@@ -7,12 +7,12 @@ Gem::Specification.new do |gem|
|
|
|
7
7
|
|
|
8
8
|
gem.name = gemspec.fetch('name')
|
|
9
9
|
gem.version = gemspec.fetch('version') do
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
lib_dir = File.join(File.dirname(__FILE__), 'lib')
|
|
11
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
require 'eveapi/version'
|
|
14
|
+
EVEApi::VERSION
|
|
15
|
+
end
|
|
16
16
|
|
|
17
17
|
gem.summary = gemspec['summary']
|
|
18
18
|
gem.description = gemspec['description']
|
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
|
23
23
|
|
|
24
24
|
glob = lambda { |patterns| gem.files & Dir[*patterns] }
|
|
25
25
|
|
|
26
|
-
gem.files = `git ls-files`.split(
|
|
26
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
27
27
|
gem.files = glob[gemspec['files']] if gemspec['files']
|
|
28
28
|
|
|
29
29
|
gem.executables = gemspec.fetch('executables') do
|
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |gem|
|
|
|
36
36
|
gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
|
|
37
37
|
|
|
38
38
|
gem.require_paths = Array(gemspec.fetch('require_paths') {
|
|
39
|
-
%w
|
|
39
|
+
%w(ext lib).select { |dir| File.directory?(dir) }
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
gem.requirements = Array(gemspec['requirements'])
|
|
@@ -47,14 +47,14 @@ Gem::Specification.new do |gem|
|
|
|
47
47
|
split = lambda { |string| string.split(/,\s*/) }
|
|
48
48
|
|
|
49
49
|
if gemspec['dependencies']
|
|
50
|
-
gemspec['dependencies'].each do |name,versions|
|
|
51
|
-
gem.add_dependency(name,split[versions])
|
|
50
|
+
gemspec['dependencies'].each do |name, versions|
|
|
51
|
+
gem.add_dependency(name, split[versions])
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
if gemspec['development_dependencies']
|
|
56
|
-
gemspec['development_dependencies'].each do |name,versions|
|
|
57
|
-
gem.add_development_dependency(name,split[versions])
|
|
56
|
+
gemspec['development_dependencies'].each do |name, versions|
|
|
57
|
+
gem.add_development_dependency(name, split[versions])
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
end
|
data/lib/eveapi.rb
CHANGED
|
@@ -10,23 +10,32 @@ require 'crack'
|
|
|
10
10
|
|
|
11
11
|
include EVEApi::Util
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
def camelize
|
|
15
|
-
self.split("_").each {|s| s.capitalize! }.join("")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Stolen from ActiveSupport::Inflector
|
|
19
|
-
def underscore
|
|
20
|
-
return self unless self =~ /[A-Z-]|::/
|
|
21
|
-
word = self.to_s.gsub(/::/, '/')
|
|
22
|
-
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
|
23
|
-
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
|
24
|
-
word.tr!("-", "_")
|
|
25
|
-
word.downcase!
|
|
26
|
-
word
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
13
|
+
# EVEApi namespace
|
|
30
14
|
module EVEApi
|
|
31
15
|
API_ENDPOINT = 'https://api.eveonline.com'
|
|
16
|
+
WORKING_METHODS = [
|
|
17
|
+
:account_api_key_info,
|
|
18
|
+
:account_account_status,
|
|
19
|
+
:account_characters,
|
|
20
|
+
:server_server_status,
|
|
21
|
+
:char_contracts,
|
|
22
|
+
:char_wallet_transactions,
|
|
23
|
+
:char_wallet_journal,
|
|
24
|
+
:char_upcoming_calendar_events,
|
|
25
|
+
:char_standings,
|
|
26
|
+
:char_skill_queue,
|
|
27
|
+
:char_skill_in_training,
|
|
28
|
+
:char_research,
|
|
29
|
+
:char_notifications,
|
|
30
|
+
:char_medals,
|
|
31
|
+
:char_market_orders,
|
|
32
|
+
:char_mail_messages,
|
|
33
|
+
:char_mailing_lists,
|
|
34
|
+
:char_industry_jobs,
|
|
35
|
+
:char_contact_notifications,
|
|
36
|
+
:char_contact_list,
|
|
37
|
+
:char_character_sheet,
|
|
38
|
+
:char_asset_list,
|
|
39
|
+
:char_account_balance
|
|
40
|
+
]
|
|
32
41
|
end
|
data/lib/eveapi/client.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module EVEApi
|
|
2
|
+
# Client instance and HTTP method handling
|
|
2
3
|
class Client
|
|
3
4
|
attr_accessor :connection
|
|
4
5
|
attr_accessor :key_id
|
|
@@ -6,7 +7,7 @@ module EVEApi
|
|
|
6
7
|
attr_accessor :character_id
|
|
7
8
|
attr_accessor :row_count
|
|
8
9
|
|
|
9
|
-
def initialize(key_id=nil, vcode=nil, character_id=nil)
|
|
10
|
+
def initialize(key_id = nil, vcode = nil, character_id = nil)
|
|
10
11
|
@connection ||= Excon.new(API_ENDPOINT)
|
|
11
12
|
@key_id = key_id
|
|
12
13
|
@character_id = character_id
|
|
@@ -20,7 +21,12 @@ module EVEApi
|
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def params
|
|
23
|
-
{
|
|
24
|
+
{
|
|
25
|
+
'rowCount' => row_count,
|
|
26
|
+
'keyID' => key_id,
|
|
27
|
+
'vCode' => vcode,
|
|
28
|
+
'characterID' => character_id
|
|
29
|
+
}.select { |_k, v| v }
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
def api_methods
|
|
@@ -28,45 +34,22 @@ module EVEApi
|
|
|
28
34
|
end
|
|
29
35
|
|
|
30
36
|
def ruby_method_name(m)
|
|
31
|
-
(
|
|
37
|
+
(m[:type][0..3].downcase + '_' + m[:name].underscore).to_sym
|
|
32
38
|
end
|
|
33
39
|
|
|
34
40
|
def api_methods_hash
|
|
35
41
|
api_call_list[:calls].map { |m| { name: ruby_method_name(m), desc: m[:description] } }
|
|
36
42
|
end
|
|
37
43
|
|
|
38
|
-
def method_missing(name, *
|
|
39
|
-
|
|
44
|
+
def method_missing(name, *_args, &_block)
|
|
45
|
+
fail 'Invalid Method Name' if check_path(name).empty?
|
|
40
46
|
check_path(name)
|
|
41
47
|
request = EVEApi::Request.new @connection.get(path: check_path(name), query: params)
|
|
42
48
|
request.result
|
|
43
49
|
end
|
|
50
|
+
|
|
44
51
|
def working_methods
|
|
45
|
-
|
|
46
|
-
:account_api_key_info,
|
|
47
|
-
:account_account_status,
|
|
48
|
-
:account_characters,
|
|
49
|
-
:server_server_status,
|
|
50
|
-
:char_contracts,
|
|
51
|
-
:char_wallet_transactions,
|
|
52
|
-
:char_wallet_journal,
|
|
53
|
-
:char_upcoming_calendar_events,
|
|
54
|
-
:char_standings,
|
|
55
|
-
:char_skill_queue,
|
|
56
|
-
:char_skill_in_training,
|
|
57
|
-
:char_research,
|
|
58
|
-
:char_notifications,
|
|
59
|
-
:char_medals,
|
|
60
|
-
:char_market_orders,
|
|
61
|
-
:char_mail_messages,
|
|
62
|
-
:char_mailing_lists,
|
|
63
|
-
:char_industry_jobs,
|
|
64
|
-
:char_contact_notifications,
|
|
65
|
-
:char_contact_list,
|
|
66
|
-
:char_character_sheet,
|
|
67
|
-
:char_asset_list,
|
|
68
|
-
:char_account_balance,
|
|
69
|
-
]
|
|
52
|
+
EVEApi::WORKING_METHODS
|
|
70
53
|
end
|
|
71
54
|
end
|
|
72
55
|
end
|
data/lib/eveapi/console.rb
CHANGED
data/lib/eveapi/request.rb
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
module EVEApi
|
|
2
|
+
# Handling of requests and response from the EVE Online API
|
|
2
3
|
class Request
|
|
3
4
|
attr_accessor :data
|
|
4
5
|
attr_accessor :result
|
|
5
6
|
attr_accessor :response
|
|
6
7
|
|
|
7
|
-
def initialize(response=nil)
|
|
8
|
+
def initialize(response = nil)
|
|
8
9
|
@response = response
|
|
9
|
-
|
|
10
|
+
fail "HTTP: #{response.status}" unless response.status == 200
|
|
10
11
|
@data = parse_xml
|
|
11
|
-
@result = convert_hash_keys(
|
|
12
|
-
|
|
12
|
+
@result = convert_hash_keys(parse_result)
|
|
13
|
+
fail error if error
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def error
|
|
16
|
-
data['eveapi'].
|
|
17
|
+
data['eveapi'].key?('error') ? data['eveapi']['error'] : false
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def parse_xml
|
data/lib/eveapi/util.rb
CHANGED
|
@@ -1,21 +1,52 @@
|
|
|
1
|
+
# Utility Hash methods
|
|
1
2
|
class Hash
|
|
2
3
|
def process_rows
|
|
3
4
|
case self['rowset']
|
|
4
5
|
when Hash
|
|
5
|
-
|
|
6
|
-
self.delete('rowset')
|
|
6
|
+
normalize_hash_rowset
|
|
7
7
|
when Array
|
|
8
|
-
|
|
9
|
-
self[rowset['name']] = rowset['row']
|
|
10
|
-
end
|
|
11
|
-
self.delete('rowset')
|
|
8
|
+
normalize_array_rowset
|
|
12
9
|
end
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
collapse_key
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def collapse_key
|
|
14
|
+
length == 1 ? self.merge!(delete(keys.first)) : self
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def normalize_hash_rowset
|
|
18
|
+
self.merge!(self['rowset']['name'] => self['rowset']['row'])
|
|
19
|
+
delete('rowset')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def normalize_array_rowset
|
|
23
|
+
self['rowset'].each do |rowset|
|
|
24
|
+
self[rowset['name']] = rowset['row']
|
|
25
|
+
end
|
|
26
|
+
delete('rowset')
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Utility String methods
|
|
31
|
+
class String
|
|
32
|
+
def camelize
|
|
33
|
+
split('_').each(&:capitalize!).join('')
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Stolen from ActiveSupport::Inflector
|
|
37
|
+
def underscore
|
|
38
|
+
return self unless self =~ /[A-Z-]|::/
|
|
39
|
+
word = to_s.gsub(/::/, '/')
|
|
40
|
+
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
|
41
|
+
word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
|
|
42
|
+
word.tr!('-', '_')
|
|
43
|
+
word.downcase!
|
|
44
|
+
word
|
|
15
45
|
end
|
|
16
46
|
end
|
|
17
47
|
|
|
18
48
|
module EVEApi
|
|
49
|
+
# Utility methods
|
|
19
50
|
module Util
|
|
20
51
|
def underscore_key(k)
|
|
21
52
|
k.to_s.underscore.to_sym
|
data/lib/eveapi/version.rb
CHANGED
data/spec/eveapi_spec.rb
CHANGED
|
@@ -5,44 +5,44 @@ describe EVEApi, :vcr do
|
|
|
5
5
|
before :each do
|
|
6
6
|
@client = Client.new
|
|
7
7
|
end
|
|
8
|
-
it
|
|
8
|
+
it 'there should be a connection class' do
|
|
9
9
|
expect { @client }.not_to raise_error
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
it
|
|
12
|
+
it 'connection instance variable should be of class Excon::Connection' do
|
|
13
13
|
expect(@client.connection).to be_a(Excon::Connection)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
it
|
|
16
|
+
it 'check_path method should return an empty string when name contains of 1 part' do
|
|
17
17
|
expect(@client.check_path('name')).to eq('')
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
it
|
|
20
|
+
it 'check_path method should return a path string when name contains of 2 or more parts' do
|
|
21
21
|
expect(@client.check_path('name_name')).to be_a(String)
|
|
22
22
|
expect(@client.check_path('name_name')).not_to be_empty
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
it
|
|
25
|
+
it 'params should return an empty hash when no param variables present' do
|
|
26
26
|
expect(Client.new.params).to be_a(Hash)
|
|
27
27
|
expect(Client.new.params).to be_empty
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
it
|
|
30
|
+
it 'calling a method present in the EVEApi should success' do
|
|
31
31
|
expect { @client.server_server_status }.not_to raise_error
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
it
|
|
34
|
+
it 'calling a method not present in the EVEApi should fail' do
|
|
35
35
|
expect { @client.some_bs_method }.to raise_error(RuntimeError)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
it
|
|
38
|
+
it 'calling api_methods should return an Array of method symobls' do
|
|
39
39
|
expect(@client.api_methods).to be_an(Array)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
Client.new.working_methods.each do |m|
|
|
43
43
|
before :each do
|
|
44
|
-
@client.key_id =
|
|
45
|
-
@client.vcode =
|
|
44
|
+
@client.key_id = '4278167'
|
|
45
|
+
@client.vcode = 'supersecretstuff'
|
|
46
46
|
@client.character_id = '95512059'
|
|
47
47
|
end
|
|
48
48
|
it "calling api method #{m}" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eveapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Ladachowski
|
|
@@ -175,9 +175,9 @@ extra_rdoc_files:
|
|
|
175
175
|
files:
|
|
176
176
|
- .document
|
|
177
177
|
- .gitignore
|
|
178
|
-
- .gitmodules
|
|
179
178
|
- .rdoc_options
|
|
180
179
|
- .rspec
|
|
180
|
+
- .rubocop.yml
|
|
181
181
|
- .travis.yml
|
|
182
182
|
- ChangeLog.md
|
|
183
183
|
- Gemfile
|
data/.gitmodules
DELETED