eveapi 0.0.2.pre → 0.0.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +38 -8
- data/doc/eveapi.png +0 -0
- data/lib/eveapi.rb +9 -1
- data/lib/eveapi/client.rb +1 -1
- data/lib/eveapi/request.rb +5 -4
- data/lib/eveapi/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yzc3MDRlZTIwNjE5MWQ0YzcxN2YyMTE2MTA3NTcyNTY0NGJlNWFlNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmIyZjYwMjhiYjBkNzBlNGU4NjI2Njg2M2QwMWY0YmQ2Y2ZmODIyMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Nzk1YmMyMjBhZmY2NGNiM2I5ZjRmM2RkMGQ4MjEwYTdiOWFlZjg5NjVmMzRj
|
10
|
+
MTI3NDkwY2VkMGJmYjlhNGJlN2U1N2QyMzRlY2E0YzY4NjE3MjNiZmE2NGMw
|
11
|
+
MDBkOGUyYTBiOWQ4MTAzMDk1OTkxZTM3YzgyYTdjNWFmYjUzZTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGY3YWI0MDQ1N2MyMDZiYTE0Y2I3NWFhMmM5NDIwMGU3ZjcyMmUzYjYzYzE1
|
14
|
+
MzI5OThmYmI4NWVjMzNmZGVmODg0MDA1ZDk0NWEzZDU4MjkzMzM1OWJiZWZl
|
15
|
+
YzA4Yzg3Mjg0ZWJjZGFiODQ5MzE3YjkwODM3YjRmMmRiNTlhM2I=
|
data/README.md
CHANGED
@@ -1,24 +1,56 @@
|
|
1
|
-
|
1
|
+
![EVEApi for ruby](https://github.com/aladac/eveapi/raw/master/doc/eveapi.png)
|
2
2
|
|
3
|
-
*
|
4
|
-
* [Documentation](http://rubydoc.info/gems/eveapi/frames)
|
5
|
-
* [Email](mailto:adam at saiden.pl)
|
3
|
+
*EVE API for ruby*
|
6
4
|
|
7
5
|
[![Build Status](https://secure.travis-ci.org/aladac/eveapi.svg?branch=master)](https://travis-ci.org/aladac/eveapi)
|
8
6
|
[![Code Climate](https://codeclimate.com/github/aladac/eveapi/badges/gpa.svg)](https://codeclimate.com/github/aladac/eveapi)
|
9
7
|
[![Test Coverage](https://codeclimate.com/github/aladac/eveapi/badges/coverage.svg)](https://codeclimate.com/github/aladac/eveapi/coverage)
|
10
8
|
|
9
|
+
## Disclaimer!
|
10
|
+
This work in progress in a very early stage. Not documented. Only a couple of methods are tested.
|
11
|
+
|
12
|
+
Most methods names can be listed by calling `EVEApi::Client#api_methods`
|
13
|
+
```ruby
|
14
|
+
pry(main)> EVEApi::Client.new.api_methods[0..5]
|
15
|
+
=> [
|
16
|
+
[0] :char_chat_channels,
|
17
|
+
[1] :char_bookmarks,
|
18
|
+
[2] :char_locations,
|
19
|
+
[3] :char_contracts,
|
20
|
+
[4] :char_account_status,
|
21
|
+
[5] :char_character_info
|
22
|
+
]
|
23
|
+
```
|
24
|
+
Most methods requiring arguments other than `character_id`, `key_id`, `vcode` and `row_count` probably will not function correctly.
|
25
|
+
|
26
|
+
Because of the way the paths are being built from the method names - some methods may look funky eq. `server_server_status`.
|
27
|
+
|
28
|
+
`account_characters`, `char_character_sheet`, `char_wallet_journal`, `server_server_status`, `account_api_key_info`, `api_call_list` should work.
|
29
|
+
|
11
30
|
## Description
|
12
31
|
|
13
|
-
|
32
|
+
EVE Online API Client for ruby
|
14
33
|
|
15
34
|
## Features
|
16
35
|
|
36
|
+
Uses [excon](https://github.com/excon/excon), [crack](https://github.com/jnunemaker/crack), `method_missing` and a couple of rescue blocks to automate access to EVE Online API.
|
37
|
+
- returns results as `Hash` or `Array`
|
38
|
+
- raises exceptions with messages from the API itself
|
39
|
+
- converts ruby methods like `account_api_info` to an EVE Online API request like `GET /account/APIKeyInfo.xml.aspx` along with query params.
|
40
|
+
|
17
41
|
## Examples
|
18
42
|
|
19
|
-
|
43
|
+
```ruby
|
44
|
+
require 'eveapi'
|
45
|
+
client = EVEApi::Client.new
|
46
|
+
client.key_id = YOUR_API_KEY_ID
|
47
|
+
client.vcode = YOUR_API_VCODE
|
48
|
+
client.account_characters
|
49
|
+
# [{"name"=>"CHARACTER_NAME1", "characterID"=>"CHARACTER_ID1", "corporationName"=>"CORPORATION_NAME1", "corporationID"=>"CORPORATION_ID1", "allianceID"=>"0", "allianceName"=>"", "factionID"=>"0", "factionName"=>""}, {"name"=>"CHARACTER_NAME2", "characterID"=>"CHARACTER_ID2", "corporationName"=>"CORPORATION_NAME2", "corporationID"=>"CORPORATION_ID2", "allianceID"=>"0", "allianceName"=>"", "factionID"=>"0", "factionName"=>""}]
|
50
|
+
```
|
20
51
|
|
21
52
|
## Requirements
|
53
|
+
`excon` and `crack` automatically installed as dependencies during `gem install`, or `bundle install` in development.
|
22
54
|
|
23
55
|
## Install
|
24
56
|
|
@@ -29,5 +61,3 @@ TODO: Description
|
|
29
61
|
Copyright (c) 2015 Adam Ladachowski
|
30
62
|
|
31
63
|
See LICENSE.txt for details.
|
32
|
-
|
33
|
-
foobar
|
data/doc/eveapi.png
ADDED
Binary file
|
data/lib/eveapi.rb
CHANGED
@@ -11,8 +11,16 @@ class String
|
|
11
11
|
def camelize
|
12
12
|
self.split("_").each {|s| s.capitalize! }.join("")
|
13
13
|
end
|
14
|
+
|
15
|
+
# Stolen from ActiveSupport::Inflector
|
14
16
|
def underscore
|
15
|
-
self
|
17
|
+
return self unless self =~ /[A-Z-]|::/
|
18
|
+
word = self.to_s.gsub(/::/, '/')
|
19
|
+
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
20
|
+
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
21
|
+
word.tr!("-", "_")
|
22
|
+
word.downcase!
|
23
|
+
word
|
16
24
|
end
|
17
25
|
end
|
18
26
|
|
data/lib/eveapi/client.rb
CHANGED
@@ -24,7 +24,7 @@ module EVEApi
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def api_methods
|
27
|
-
api_call_list[:
|
27
|
+
api_call_list[:calls].map { |m| ( m['type'][0..3].downcase + '_' + m['name'].underscore ).to_sym }
|
28
28
|
end
|
29
29
|
|
30
30
|
def method_missing(name, *args, &block)
|
data/lib/eveapi/request.rb
CHANGED
@@ -26,10 +26,11 @@ module EVEApi
|
|
26
26
|
rescue NoMethodError
|
27
27
|
data['eveapi']['result']
|
28
28
|
rescue TypeError
|
29
|
-
{
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
output = {}
|
30
|
+
data['eveapi']['result']['rowset'].each do |r|
|
31
|
+
output.merge!({ r['name'].underscore.to_sym => r['row'] })
|
32
|
+
end
|
33
|
+
output
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
data/lib/eveapi/version.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.0.3.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Ladachowski
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- LICENSE.txt
|
128
128
|
- README.md
|
129
129
|
- Rakefile
|
130
|
+
- doc/eveapi.png
|
130
131
|
- eveapi.gemspec
|
131
132
|
- gemspec.yml
|
132
133
|
- lib/eveapi.rb
|