wowapi 0.1.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -120
  3. data/lib/wowapi/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcae56eca8c4f6297183d2d54f18c55cc9090651
4
- data.tar.gz: e74f5a3f6f0975835697a1d3479ef48ecbcfd1e1
3
+ metadata.gz: 498a20d5dfcfbb3cbd7f5cd44b93f595406b646d
4
+ data.tar.gz: e97b383b30205d28c63b8db6729f78a767d7fe69
5
5
  SHA512:
6
- metadata.gz: b6a3cbfb689c93bfd9f0efa1dd7adf367c6d3aaa2d1da525125b1cd7e82b7b9cf17043e321da3c62bff3ac81dda697d2df99fc5f45649ee203d8e2296b05eb0e
7
- data.tar.gz: 85c4342b5018a21b6102370561c7627df9dffc0367dd6a3d0821c983d67a0858411dcc16ce88ae52a8288d2478991a1e8a15065011d1f670967a8bb4093ae52c
6
+ metadata.gz: c37e2dfadebc4307fb6d2e26c98a26a7ae2ab49efa3ac9535309a268a7f4da04ca8b5da0ff8db37301f7724444ab540b6ef60b03dada3276818a1c87d8266019
7
+ data.tar.gz: a6df2db6074ef9bad18eef3b813ec330f7f0119627dc4481f3e7afd0c1092b733cc87539670416f156361de9d1651314cc12e09f80f2904b3de27a9832ae132e
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # WoWAPI
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
- **EARLY STAGE DEVELOPMENT. HERE BE DRAGONS**
10
- However, you are welcome to contribute and/or criticise (and/or) show me the way to handle things.
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
- This is a Ruby library, so called _gem_. It is targetted to be used in Ruby scripts, [Rails](http://rubyonrails.org/), [Sinatra](http://www.sinatrarb.com/) or anything that uses Ruby.
12
+ ## Getting Started
16
13
 
17
- This project began during a search for an easy-to-use gem that allows to access Blizzard's World of Warcraft Community API with ease. It is based on (now deprecated) [Battlenet GEM](https://github.com/BinaryMuse/battlenet) by [BinaryMuse](https://github.com/BinaryMuse), however it focuses purely on World of Warcraft.
14
+ ### Prerequisites
18
15
 
19
- ## What does it do?
16
+ A [supported, working version of Ruby](#supported-rubies).
20
17
 
21
- It gives you a pretty interface to Blizzard's Community API.
18
+ ### Installing
22
19
 
23
- ## How do I use this?
20
+ You can obtain Wowapi in two ways:
24
21
 
25
- ### Installation
22
+ - [using Rubygems](#rubygems),
23
+ - [building yourself](#build-yourself).
26
24
 
27
25
  #### Rubygems
28
- This gem is available on Rubygems: https://rubygems.org/gems/wowapi
29
- ```
30
- gem install wowapi
31
- ```
32
- And everything should work just fine. For a list of compatible (tested) Rubies, see 'Support' at the bottom.
33
- #### Download & build yourself
34
- You can also build it from scratch.
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
- * enter the directory:
37
+
38
+ * enter the directory:
40
39
  ```
41
40
  cd wowapi
42
41
  ```
43
- * run bundler, so you have everything you need already:
42
+
43
+ * run bundler, so you have everything you need already:
44
44
  ```
45
45
  bundle install
46
46
  ```
47
- * build gem:
47
+
48
+ * build gem:
48
49
  ```
49
50
  gem build wowapi.gemspec
50
51
  ```
51
- * if build passes, install it from your local environment:
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
- **<< DUE TO FAST DEVELOPMENT CYCLE THIS PART OF DOCUMENTATION IS LACKING. >>**
58
+ ## Examples
60
59
 
61
- We have different **resources** for different parts of the API. Each **resource** can be queried with **query fields**, and after being queried, object has **fields**.
60
+ ### Rails
62
61
 
63
- Every **resource** is called as a method on `Wowapi` Object. Please note that resource is **not** a field.
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
- You can easily combine fields.
171
- # Support & requirements
137
+ ### Supported Rubies
172
138
 
173
- ## API authentication
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
- If you do not provide public (and/or private key) you will most likely step upon `Wowapi::NoCredentialsException` error.
177
- Make sure your Wowapi instance contains `public_key` (and/or, if necessary - `secret_key`).
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
- If you fail to authenticate, you will most likely step upon `Wowapi::AuthException` error. This means either your credentials are invalid, or something is wrong with Blizzard services. Nonetheless, you have a problem.
151
+
152
+ ## Built With
180
153
 
181
- ## Ruby
182
- 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:
154
+ We are using [Travis CI](./src/master/.travis.yml) to test each commit against [Supported Rubies](#supported-rubies).
155
+ ## Contributing
183
156
 
184
- | Ruby (MRI) | Does it work? |
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
- As it's early stage development, and as it's stated in the LICENSE, I do not guarantee that any other Rubies will make allow you to use this library.
193
- Hell, I do not guarantee _anything_.
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
- ## Documentation
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
- You may also browse **ri** documentation which installs by default when you install the gem. Just type `ri Wowapi`.
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
- **But it should work just fine on Rubies >= 2.0.0.**
169
+ ## Authors
202
170
 
203
- ## Regions
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
- API region can be changed by passing proper symbol:
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
- ## Change through Wowapi object
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
- Keep in mind that this is completely optional, and default is **_:eu_**.
180
+ ## Acknowledgments
222
181
 
223
- ## Contributing
224
- I'm a single developer here. I'm working student. This is an introduction.
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)
@@ -1,4 +1,4 @@
1
1
  class Wowapi
2
- VERSION = '0.1.9'
2
+ VERSION = '1.0.0'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wowapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Matusz