gw2-api 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd0845be116bde90bdf5c52ce92827833310d34c8c368f8e1ac4fe0dc6fb2ddf
4
- data.tar.gz: ea61dca98bacef0ba9503b42d9e9a4e2ff0898858dcb365325bdd69e0bec6519
3
+ metadata.gz: f198243765f41634a816d7166765ec1aa3a6a00ca8f412aa95eba3c7bf6184e6
4
+ data.tar.gz: c8cd0d99e64a8c02b0d7efc8606baecc8391ec11d42a465631494580fae57486
5
5
  SHA512:
6
- metadata.gz: 066cc3d59251faa55cbb00da14089cb06dd040fca9086d769f163c4f22d5502d4522575e96371b61fd258bd8723a85934c9137f42500cb0ce15068dd6e91413b
7
- data.tar.gz: 68f89fbf24773c971ff221c184ca2b81337c534bcde6597f9f38496a36e951f0fc5f4cdac53e8ea1c90ce7c533200066312a3e0d464027f0a94f28742c45c81f
6
+ metadata.gz: cda7de20f5503be233658fde82b8997cc59deca16fc614156d046e797a471eaa8ccad255b98e268ef74d032180671feabc1a420265a802bd58f1cb0e2643d371
7
+ data.tar.gz: ffe09ebd0b6689526e043b13929144602b8581ab918091d925cbe13cfae046bb474985030cf29effaadd697976c05391cbe9744c41c4eb7f07ef829019ea7a9a
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  Exclude:
3
4
  - 'gw2-api.gemspec'
4
5
  TargetRubyVersion: 2.6
@@ -6,6 +7,9 @@ AllCops:
6
7
  Metrics/BlockLength:
7
8
  Enabled: false
8
9
 
10
+ Metrics/ModuleLength:
11
+ Enabled: false
12
+
9
13
  Style/StringLiterals:
10
14
  Enabled: true
11
15
  EnforcedStyle: double_quotes
data/Gemfile.lock CHANGED
@@ -1,16 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gw2-api (0.5.0)
4
+ gw2-api (0.6.0)
5
5
  rake (~> 13.0)
6
6
  rspec (~> 3.0)
7
7
  rubocop (~> 1.21)
8
+ simplecov (~> 0.21.2)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
13
  ast (2.4.2)
13
14
  diff-lcs (1.5.1)
15
+ docile (1.4.0)
14
16
  json (2.7.2)
15
17
  language_server-protocol (3.17.0.3)
16
18
  parallel (1.25.1)
@@ -50,6 +52,12 @@ GEM
50
52
  rubocop-ast (1.31.3)
51
53
  parser (>= 3.3.1.0)
52
54
  ruby-progressbar (1.13.0)
55
+ simplecov (0.21.2)
56
+ docile (~> 1.1)
57
+ simplecov-html (~> 0.11)
58
+ simplecov_json_formatter (~> 0.1)
59
+ simplecov-html (0.12.3)
60
+ simplecov_json_formatter (0.1.4)
53
61
  strscan (3.1.0)
54
62
  unicode-display_width (2.5.0)
55
63
 
data/gw2-api.gemspec CHANGED
@@ -34,5 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "rake", "~> 13.0"
35
35
  spec.add_dependency "rspec", "~> 3.0"
36
36
  spec.add_dependency "rubocop", "~> 1.21"
37
+ spec.add_dependency "simplecov", "~> 0.21.2"
37
38
 
38
39
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gw2
4
4
  module Api
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
data/lib/gw2/api.rb CHANGED
@@ -22,7 +22,7 @@ module Gw2
22
22
  include Gw2::Api::Account
23
23
 
24
24
  def initialize(args)
25
- @api_key = args[:api_key] || ENV["GW2_API_KEY"]
25
+ @api_key = args[:api_key] || ENV.fetch("GW2_API_KEY", nil)
26
26
  @base_url = "https://api.guildwars2.com/v2"
27
27
  end
28
28
 
@@ -29,6 +29,11 @@ module Gw2
29
29
  execute_request(request_string)
30
30
  end
31
31
 
32
+ # Returns the account daily crafting
33
+ def account_daily_crafting
34
+ execute_request("account/dailycrafting")
35
+ end
36
+
32
37
  # Returns the daily dungeons for the account
33
38
  def account_dungeons
34
39
  execute_request("account/dungeons")
@@ -71,6 +76,21 @@ module Gw2
71
76
  execute_request("account/inventory")
72
77
  end
73
78
 
79
+ # Returns the account jadebot skin id unlocks
80
+ def account_jadebots
81
+ execute_request("account/jadebots")
82
+ end
83
+
84
+ # Returns the account luck
85
+ def account_luck
86
+ execute_request("account/luck")
87
+ end
88
+
89
+ # Returns the account legendary armory unlocks
90
+ def account_legendary_armory
91
+ execute_request("account/legendaryarmory")
92
+ end
93
+
74
94
  # Returns the mail carrier ids unlocked on the account
75
95
  def account_mail_carriers
76
96
  execute_request("account/mailcarriers")
@@ -101,11 +121,41 @@ module Gw2
101
121
  execute_request("account/minis")
102
122
  end
103
123
 
124
+ # Alias to account_mounts_skins
125
+ def account_mount_skins
126
+ account_mounts_skins
127
+ end
128
+
129
+ # Returns the account mount skins unlocked
130
+ def account_mounts_skins
131
+ execute_request("account/mounts/skins")
132
+ end
133
+
134
+ # Alias to account_mounts_types
135
+ def account_mount_types
136
+ account_mounts_types
137
+ end
138
+
139
+ # Returns the account mount types unlocked
140
+ def account_mounts_types
141
+ execute_request("account/mounts/types")
142
+ end
143
+
144
+ # Returns the account novelties unlocked
145
+ def account_novelties
146
+ execute_request("account/novelties")
147
+ end
148
+
104
149
  # Returns the account outfit ids unlocked
105
150
  def account_outfits
106
151
  execute_request("account/outfits")
107
152
  end
108
153
 
154
+ # Returns the account progression
155
+ def account_progression
156
+ execute_request("account/progression")
157
+ end
158
+
109
159
  # Returns the account pvp hero ids unlocked
110
160
  def account_pvp_heroes
111
161
  execute_request("account/pvp/heroes")
@@ -121,6 +171,11 @@ module Gw2
121
171
  execute_request("account/recipes")
122
172
  end
123
173
 
174
+ # Returns the account skiff skin unlocked ids
175
+ def account_skiffs
176
+ execute_request("account/skiffs")
177
+ end
178
+
124
179
  # Returns the account skin ids unlocked
125
180
  def account_skins
126
181
  execute_request("account/skins")
@@ -135,6 +190,53 @@ module Gw2
135
190
  def account_wallet
136
191
  execute_request("account/wallet")
137
192
  end
193
+
194
+ # Returns the wizard vault daily objectives and progress
195
+ def account_wizardsvault_daily
196
+ execute_request("account/wizardsvault/daily")
197
+ end
198
+
199
+ # Returns the astral rewards for the account
200
+ def account_wizardsvault_listings
201
+ execute_request("account/wizardsvault/listings")
202
+ end
203
+
204
+ # Returnst he wizard vault weekly objectives and progress
205
+ def account_wizardsvault_weekly
206
+ execute_request("account/wizardsvault/weekly")
207
+ end
208
+
209
+ # Returns the daily world boss clears for the account
210
+ def account_worldbosses
211
+ execute_request("account/worldbosses")
212
+ end
213
+
214
+ # Returns the account trading post transactions
215
+ def commerce_transactions
216
+ execute_request("commerce/transactions")
217
+ end
218
+
219
+ # Returns the account characters
220
+ def account_characters(params = {})
221
+ execute_with_params("characters", params)
222
+ end
223
+
224
+ # Creates a subtoken of the current api token
225
+ # @param [Hash] params the options to create the subtoken
226
+ # Valid Parameters
227
+ # expires: [String] An ISO-8601 datetime specifing when the generated Subtoken will expire.
228
+ # The token expiry date may not exceed one year from creation.
229
+ # Attempting to specify a longer expiry date will result in the expiry being clamped at one year.
230
+ # permissions: [String] A comma separated list of permissions to grant to the Subtoken.
231
+ # urls: [String] A comma separated list of URLs that the Subtoken will be restricted to.
232
+ def create_subtoken(params = {})
233
+ execute_with_params("createsubtoken", params)
234
+ end
235
+
236
+ # Returns info about the supplied token
237
+ def token_info(params = {})
238
+ execute_with_params("tokeninfo", params)
239
+ end
138
240
  end
139
241
  end
140
242
  end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gw2
4
+ module Api
5
+ # achievements.rb
6
+ module Characters
7
+ # Returns the account characters
8
+ def characters(params = {})
9
+ execute_with_params("characters", params)
10
+ end
11
+
12
+ def character_backstory(character_id, params = {})
13
+ execute_with_params("characters/#{character_id}/backstory", params)
14
+ end
15
+
16
+ def character_buildtabs(character_id, params = {})
17
+ execute_with_params("characters/#{character_id}/buildtabs", params)
18
+ end
19
+
20
+ def character_core(character_id, params = {})
21
+ execute_with_params("characters/#{character_id}/core", params)
22
+ end
23
+
24
+ def character_crafting(character_id, params = {})
25
+ execute_with_params("characters/#{character_id}/crafting", params)
26
+ end
27
+
28
+ def character_equipment(character_id, params = {})
29
+ execute_with_params("characters/#{character_id}/equipment", params)
30
+ end
31
+
32
+ def character_equipmenttabs(character_id, params = {})
33
+ execute_with_params("characters/#{character_id}/equipmenttabs", params)
34
+ end
35
+
36
+ def character_inventory(character_id, params = {})
37
+ execute_with_params("characters/#{character_id}/inventory", params)
38
+ end
39
+
40
+ def character_recipes(character_id, params = {})
41
+ execute_with_params("characters/#{character_id}/recipes", params)
42
+ end
43
+
44
+ def character_skills(character_id, params = {})
45
+ execute_with_params("characters/#{character_id}/skills", params)
46
+ end
47
+
48
+ def character_specializations(character_id, params = {})
49
+ execute_with_params("characters/#{character_id}/specializations", params)
50
+ end
51
+
52
+ def character_active_buildtabs(character_id, params = {})
53
+ execute_with_params("characters/#{character_id}/buildtabs/active", params)
54
+ end
55
+
56
+ def character_active_equipmenttabs(character_id, params = {})
57
+ execute_with_params("characters/#{character_id}/equipmenttabs/active", params)
58
+ end
59
+
60
+ def character_dungeons(character_id, params = {})
61
+ execute_with_params("characters/#{character_id}/dungeons", params)
62
+ end
63
+
64
+ def character_hero_points(character_id, params = {})
65
+ execute_with_params("characters/#{character_id}/heropoints", params)
66
+ end
67
+
68
+ def character_quests(character_id, params = {})
69
+ execute_with_params("characters/#{character_id}/quests", params)
70
+ end
71
+
72
+ def character_sab(character_id, params = {})
73
+ execute_with_params("characters/#{character_id}/sab", params)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gw2
4
+ module Api
5
+ # achievements.rb
6
+ module Pvp
7
+ # Returns the account characters
8
+ def pvp_stats(params = {})
9
+ execute_with_params("pvp/stats", params)
10
+ end
11
+
12
+ # Returns detailed info about recent player games
13
+ def pvp_games(params = {})
14
+ execute_with_params("pvp/games", params)
15
+ end
16
+
17
+ # Returns the best and current standing of a player in sPVP
18
+ def pvp_standings(params = {})
19
+ execute_with_params("pvp/standings", params)
20
+ end
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gw2-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Nicholas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-14 00:00:00.000000000 Z
11
+ date: 2024-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.21'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.21.2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.21.2
55
69
  description: This is a wrapper to the Guild Wars 2 API. It is designed to make it
56
70
  easier to interact with the API and to provide a more Ruby-like interface to the
57
71
  data provided by the API.
@@ -74,6 +88,8 @@ files:
74
88
  - lib/gw2/api/version.rb
75
89
  - lib/gw2/modules/account.rb
76
90
  - lib/gw2/modules/achievements.rb
91
+ - lib/gw2/modules/character.rb
92
+ - lib/gw2/modules/pvp.rb
77
93
  - sig/gw2/api.rbs
78
94
  - sig/gw2/api/account.rbs
79
95
  - sig/gw2/api/achievements.rbs
@@ -101,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
117
  - !ruby/object:Gem::Version
102
118
  version: '0'
103
119
  requirements: []
104
- rubygems_version: 3.1.6
120
+ rubygems_version: 3.5.3
105
121
  signing_key:
106
122
  specification_version: 4
107
123
  summary: This is an API wrapper for the Guild Wars 2 API.