wowapi 0.1.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +65 -120
- data/lib/wowapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 498a20d5dfcfbb3cbd7f5cd44b93f595406b646d
|
4
|
+
data.tar.gz: e97b383b30205d28c63b8db6729f78a767d7fe69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c37e2dfadebc4307fb6d2e26c98a26a7ae2ab49efa3ac9535309a268a7f4da04ca8b5da0ff8db37301f7724444ab540b6ef60b03dada3276818a1c87d8266019
|
7
|
+
data.tar.gz: a6df2db6074ef9bad18eef3b813ec330f7f0119627dc4481f3e7afd0c1092b733cc87539670416f156361de9d1651314cc12e09f80f2904b3de27a9832ae132e
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# WoWapi
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/wowapi.svg)](https://badge.fury.io/rb/wowapi)
|
3
3
|
[![Build Status](https://travis-ci.org/Marahin/wowapi.svg?branch=master)](https://travis-ci.org/Marahin/wowapi)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/Marahin/wowapi/badges/gpa.svg)](https://codeclimate.com/github/Marahin/wowapi)
|
@@ -6,95 +6,61 @@
|
|
6
6
|
[![security](https://hakiri.io/github/Marahin/wowapi/master.svg)](https://hakiri.io/github/Marahin/wowapi/master)
|
7
7
|
[![Inline docs](https://inch-ci.org/github/Marahin/wowapi.svg?branch=master)](https://inch-ci.org/github/Marahin/wowapi)
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# What this is
|
13
|
-
**WoWAPI** project is created by [Jasiek ~marahin Matusz](https://marahin.pl/) with it's source on [git.3lab.re](https://git.3lab.re/marahin/wowapi), licensed under MIT license.
|
9
|
+
World of Warcraft API gem.
|
10
|
+
This gem is intended to help developers easily access [Blizzards' Community API](https://dev.battle.net/) section of World of Warcraft.
|
14
11
|
|
15
|
-
|
12
|
+
## Getting Started
|
16
13
|
|
17
|
-
|
14
|
+
### Prerequisites
|
18
15
|
|
19
|
-
|
16
|
+
A [supported, working version of Ruby](#supported-rubies).
|
20
17
|
|
21
|
-
|
18
|
+
### Installing
|
22
19
|
|
23
|
-
|
20
|
+
You can obtain Wowapi in two ways:
|
24
21
|
|
25
|
-
|
22
|
+
- [using Rubygems](#rubygems),
|
23
|
+
- [building yourself](#build-yourself).
|
26
24
|
|
27
25
|
#### Rubygems
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
####
|
34
|
-
|
35
|
-
* clone the repo:
|
26
|
+
|
27
|
+
```
|
28
|
+
gem install wowapi
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Build yourself
|
32
|
+
|
33
|
+
* clone the repo:
|
36
34
|
```
|
37
35
|
git clone https://git.3lab.re/marahin/wowapi.git
|
38
36
|
```
|
39
|
-
|
37
|
+
|
38
|
+
* enter the directory:
|
40
39
|
```
|
41
40
|
cd wowapi
|
42
41
|
```
|
43
|
-
|
42
|
+
|
43
|
+
* run bundler, so you have everything you need already:
|
44
44
|
```
|
45
45
|
bundle install
|
46
46
|
```
|
47
|
-
|
47
|
+
|
48
|
+
* build gem:
|
48
49
|
```
|
49
50
|
gem build wowapi.gemspec
|
50
51
|
```
|
51
|
-
|
52
|
+
|
53
|
+
* if build passes, install it from your local environment:
|
52
54
|
```
|
53
55
|
gem install --local wowapi**.gem
|
54
56
|
```
|
55
|
-
|
56
|
-
|
57
|
-
### Resources, query fields and fields
|
58
57
|
|
59
|
-
|
58
|
+
## Examples
|
60
59
|
|
61
|
-
|
60
|
+
### Rails
|
62
61
|
|
63
|
-
|
64
|
-
**Query field** can be defined as "what do we exactly want to know about the resource". See following example:
|
65
|
-
|
66
|
-
|
67
|
-
```
|
68
|
-
api.guild('Argent Dawn', 'The Aspects') ## this returns only basic Guild info (guild resource with no query fields)
|
62
|
+
**Bear in mind this is example code.**
|
69
63
|
|
70
|
-
api.guild('Argent Dawn', 'The Aspects', :news, :members) ## whereas this returns guild info AND members array (guild resource with :members, :news query fields)
|
71
|
-
```
|
72
|
-
|
73
|
-
In above example we passed `:news` and `:members` **query fields** for the Guild **resource**. However, `:members` is a special example, because **not only this is a query field, but also a special field**.
|
74
|
-
**Special field** is a **field** that is additionally processed. See, in case of `:members` Blizzard returns JSON array that contains some Character data (an array of Characters that are members of the Guild). However, Wowapi is so cool that every record inside becomes a `CharacterClass` object.
|
75
|
-
In different words, **special fields contain A PROCESSED BLIZZARD RESPONSE**. These are enhanced and can be managed Ruby-way.
|
76
|
-
|
77
|
-
**SPECIAL FIELD DOESN'T NECESSARILY HAVE TO BE A QUERY FIELD. SEE `.avatar` ON `CharacterClass`**
|
78
|
-
**SPECIAL FIELDS ARE MENTIONED ONLY BECAUSE PART OF THE API IS NOT YET FULLY COVERED. SOME "FIELDS" THAT ARE NOT _SPECIAL_ MAY CONTAIN RAW JSON RESPONSE.**
|
79
|
-
|
80
|
-
#### Query fields table
|
81
|
-
|
82
|
-
| Resource(s) | query fields | | | |
|
83
|
-
|:-----------: |:------------: |:-------------: |:----------: |:--------: |
|
84
|
-
| .guild | :news | :achievements | :challenge | :members |
|
85
|
-
| .character |
|
86
|
-
|
87
|
-
#### Special fields table
|
88
|
-
|
89
|
-
| Resource | field | special field?| description |
|
90
|
-
| :-----------: | :-----------: | :-----------: | :-----------: |
|
91
|
-
| guild | .members | yes |Becomes array of `CharacterClass` objects |
|
92
|
-
| character | .avatar | yes |Returns ready-to-render link for avatar image of the character.|
|
93
|
-
|
94
|
-
|
95
|
-
### Examples
|
96
|
-
|
97
|
-
#### Rails
|
98
64
|
* Create initializer called `wowapi.rb` in your Rails app's `config/initializers` directory,
|
99
65
|
* fill it with following:
|
100
66
|
|
@@ -139,9 +105,8 @@ end
|
|
139
105
|
end
|
140
106
|
```
|
141
107
|
|
108
|
+
### Plain Ruby
|
142
109
|
|
143
|
-
#### Plain ruby
|
144
|
-
You can use simple variables. For more advanced usage with global variables and namespaces, see above (Rails usage).
|
145
110
|
```
|
146
111
|
require 'wowapi'
|
147
112
|
|
@@ -163,77 +128,57 @@ guild.news # array of Hashes containing news
|
|
163
128
|
|
164
129
|
# returns character profile
|
165
130
|
character = api.character('Argent Dawn', 'Marahin')
|
166
|
-
|
167
131
|
```
|
132
|
+
## Deployment
|
168
133
|
|
134
|
+
**Nothing additional is required**. Bear in mind that Wowapi only download & interprets data, but it **does not provide any kind of persistent storage**.
|
135
|
+
As an author I use this gem to develop [my guild website](http://aspects.pl), where I use [nginx](https://www.nginx.com/) as an reverse proxy to [puma](https://github.com/puma/puma) instance with [Rails](http://rubyonrails.org/) app. I use [redis](http://redis.io/) to store Wowapi data and [Clockwork](https://rubygems.org/gems/clockwork) queue, that is maintaining work of [Sidekiq](https://github.com/mperham/sidekiq) worker that periodically downloads data using Wowapi.
|
169
136
|
|
170
|
-
|
171
|
-
# Support & requirements
|
137
|
+
### Supported Rubies
|
172
138
|
|
173
|
-
|
174
|
-
In order to access World of Warcraft's API you need your API key. For most actions (guild info for example) you only need the public key. Nonetheless, both of these you can aquire at [Battle.net Developer Portal](https://dev.battle.net/).
|
139
|
+
Everything >= 2.0.0 should work just fine. Below you can see a table with different MRI Ruby versions which we tested the gem on:
|
175
140
|
|
176
|
-
|
177
|
-
|
141
|
+
| Ruby (MRI) | Does it work? |
|
142
|
+
|------------|---------------|
|
143
|
+
| 1.9.3 | **No** |
|
144
|
+
| 2.0.0 | Yes |
|
145
|
+
| 2.2.0 | Yes |
|
146
|
+
| 2.2.3 | Yes |
|
147
|
+
| 2.3.0 | Yes |
|
148
|
+
| 2.3.1 | Yes |
|
149
|
+
| jruby* | Yes |
|
178
150
|
|
179
|
-
|
151
|
+
|
152
|
+
## Built With
|
180
153
|
|
181
|
-
|
182
|
-
|
154
|
+
We are using [Travis CI](./src/master/.travis.yml) to test each commit against [Supported Rubies](#supported-rubies).
|
155
|
+
## Contributing
|
183
156
|
|
184
|
-
|
185
|
-
|
186
|
-
| 1.9.3 | **NO**. Some flow in Object class is different. |
|
187
|
-
| 2.0.0 | Hell **YES**. |
|
188
|
-
| 2.2.3 | Sure, **YES**. |
|
189
|
-
| 2.3.0 | Just fine, **YES**. |
|
190
|
-
| 2.3.1 | **YES**, uh huh. |
|
157
|
+
**Bugs**: either drop an issue [here](https://git.3lab.re/Marahin/wowapi/issues) or see IRC below
|
158
|
+
**IRC**: `#wowapi` on Freenode ([click here to chat now](https://webchat.freenode.net/?nick=WowapiUser&channels=#wowapi))
|
191
159
|
|
192
|
-
|
193
|
-
|
160
|
+
I have a problem / want to help:
|
161
|
+
* contact us through `#wowapi` on Freenode (or creator directly - `me@marahin.pl`),
|
162
|
+
* if your idea / bugfix / change is approved, send a pull request or provide a link to your fork with it fixed,
|
163
|
+
* you will be mentioned below in the [Authors section](#authors)
|
194
164
|
|
195
|
-
##
|
196
|
-
Before you start tinkering, I suggest generating **rDOC** documentation.
|
197
|
-
To do so, run `rdoc` in the root directory of Wowapi. Then navigate to doc/index.html in your browser, and voila - you have your offline documentation with all methods, classes and pretty-displayed README.md.
|
165
|
+
## Versioning
|
198
166
|
|
199
|
-
|
167
|
+
**SINCE 1.0.0** we use [SemVer](http://semver.org/) for versioning. For the versions available, see [Releases](https://git.3lab.re/Marahin/wowapi/releases) or [RubyGems](https://rubygems.org/gems/wowapi/versions).
|
200
168
|
|
201
|
-
|
169
|
+
## Authors
|
202
170
|
|
203
|
-
|
204
|
-
### Region defaults to :eu!
|
205
|
-
List of currently supported regions:
|
206
|
-
- Europe (**_:eu_**)
|
207
|
-
- United States (**_:us_**)
|
171
|
+
* **Jan "marahin" Matusz** - *founder, creator, developer* - [marahin](https://marahin.pl/en/)
|
208
172
|
|
209
|
-
|
173
|
+
## License
|
210
174
|
|
211
|
-
|
212
|
-
## Change through Wowapi class variable,
|
213
|
-
Wowapi.region = :us
|
175
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
214
176
|
|
215
|
-
|
216
|
-
myvar = Wowapi.new{ |c| ... }
|
217
|
-
myvar.region = :us
|
177
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
218
178
|
|
219
|
-
```
|
220
179
|
|
221
|
-
|
180
|
+
## Acknowledgments
|
222
181
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
### IRC
|
227
|
-
`#wowapi` at Freenode
|
228
|
-
### Bugtracking / I have a question / I have a problem
|
229
|
-
Every problem / feature / bug / anything that concerns you should find place in Issues tab up top.
|
230
|
-
As soon as you get your answer, the issue will also be labeled.
|
231
|
-
|
232
|
-
### I want to help
|
233
|
-
If you want to help, make sure you understand how the library works. Ask me, don't feel shy. As a beginner, making me know that someone actually uses it will make my heart warm.
|
234
|
-
If you already know what you're doing, and you know how to fix the bug / make something work better / improve the library, create a pull request.
|
235
|
-
|
236
|
-
Or either create an issue with the code, explaining how it works and why is it better / how does it fix stuff. I don't really care, whatever is easier / friendlier for you.
|
237
|
-
## Games
|
238
|
-
**There is no plan of supporting anything but World of Warcraft. Sorry.**
|
239
|
-
Unless money is involved. :^)
|
182
|
+
* this is a successor of [BinaryMuse's battlenet gem](https://github.com/BinaryMuse/battlenet) - some of the meta-code is his
|
183
|
+
* this is a in-dev project started, maintained and developed by a student
|
184
|
+
* we are using GitHub as a MIRROR. Main source is located at [git.3lab.re/Marahin/wowapi](https://git.3lab.re/Marahin/wowapi)
|
data/lib/wowapi/version.rb
CHANGED