gw2-api 0.1.0 → 0.2.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 +4 -4
- data/README.md +29 -7
- data/lib/gw2/api/version.rb +1 -1
- data/lib/gw2/api.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bff8b7a236713ec7ab718626fc956da6d1063e59efa52fce48ff8b864500993f
|
4
|
+
data.tar.gz: ddb30ca1c16e8aeb6b7c146910743d43ec2d6c61881bd57458164749261c1517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97efa70f1ce3643a02fb937be1e8fa7f918351893a1a10a539c15179967f8a036108c43419998e275a49aaf0523d6cec5bf8c47d04a420a3ebfe2395b708241d
|
7
|
+
data.tar.gz: b63f4448a59fbbb5cf538442d30226f4e4732753e846250353b9886885fdf50afda5e62618b5d445c77a11525a50c5ac7942914a3c3feb76473fa2f99326cf06
|
data/README.md
CHANGED
@@ -4,19 +4,41 @@ This is a gem used to make calls to the Guild Wars 2 API.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
8
|
-
|
9
7
|
Install the gem and add to the application's Gemfile by executing:
|
10
8
|
|
11
|
-
$ bundle add
|
9
|
+
$ bundle add gw2-api
|
12
10
|
|
13
11
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
12
|
|
15
|
-
$ gem install
|
13
|
+
$ gem install gw2-api
|
16
14
|
|
17
15
|
## Usage
|
18
16
|
|
19
|
-
|
17
|
+
To use the gem, first require it in the application, then create a new instance of the `Gw2::Api::Client` class:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'gw2-api'
|
21
|
+
|
22
|
+
client = Gw2::Api::Client.new(api_key: ENV["GW2_API_KEY"])
|
23
|
+
|
24
|
+
puts client.account.body
|
25
|
+
puts client.achievements(ids: "1840,910")
|
26
|
+
```
|
27
|
+
|
28
|
+
You can replace `ENV["GW2_API_KEY"]` with your own API Key, or set the env variable
|
29
|
+
|
30
|
+
A list of available functions can be found `lib/gw2/modules`.
|
31
|
+
|
32
|
+
You can find valid parameters for each function in the [Guild Wars 2 API documentation](https://wiki.guildwars2.com/wiki/API:Main) or from the public [API-CDI](https://github.com/arenanet/api-cdi) repo.
|
33
|
+
|
34
|
+
## Tests
|
35
|
+
|
36
|
+
To run the tests, execute:
|
37
|
+
|
38
|
+
$ bundle exec rspec
|
39
|
+
|
40
|
+
Note that you need to set a valid API key in the environment variable `GW2_API_KEY` to run the tests.
|
41
|
+
GW2's API Availability can affect the result of the tests (if it's down, the tests will fail).
|
20
42
|
|
21
43
|
## Development
|
22
44
|
|
@@ -26,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
26
48
|
|
27
49
|
## Contributing
|
28
50
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nicholasrobertm/gw2-api.
|
30
52
|
|
31
53
|
## License
|
32
54
|
|
@@ -34,4 +56,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
34
56
|
|
35
57
|
## Code of Conduct
|
36
58
|
|
37
|
-
|
59
|
+
Be a decent person, and don't be a jerk, it's that simple!
|
data/lib/gw2/api/version.rb
CHANGED
data/lib/gw2/api.rb
CHANGED