bungie_client 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -12
- data/.travis.yml +0 -0
- data/CHANGELOG.md +21 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +5 -3
- data/LICENSE.txt +0 -0
- data/README.md +5 -18
- data/Rakefile +2 -0
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/bungie_client.gemspec +4 -1
- data/lib/bungie_client.rb +2 -1
- data/lib/bungie_client/client.rb +80 -132
- data/lib/bungie_client/service.rb +30 -10
- data/lib/bungie_client/services.yml +384 -356
- data/lib/bungie_client/version.rb +3 -3
- data/lib/bungie_client/wrappers/default.rb +65 -84
- data/lib/bungie_client/wrappers/user.rb +56 -56
- data/lib/tasks/parse_services.rake +35 -0
- data/lib/underscore.rb +9 -9
- metadata +47 -12
- data/examples/client_usage.rb +0 -16
- data/examples/wrapper_usage.rb +0 -12
- data/services_parser.rb +0 -33
data/examples/wrapper_usage.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
-
|
3
|
-
require 'bungie_client'
|
4
|
-
|
5
|
-
# init client
|
6
|
-
@user = BungieClient::Wrappers::User.new(
|
7
|
-
:api_key => 'YOUR_API_KEY',
|
8
|
-
:display_name => 'RuBAN-GT',
|
9
|
-
:membership_type => '2'
|
10
|
-
)
|
11
|
-
|
12
|
-
p @user.get_bungie_account.keys
|
data/services_parser.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# This script can parse the list of bungie services from *destinydevs.github.io* for client.
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
require 'hashie'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'underscore'
|
7
|
-
|
8
|
-
# preset
|
9
|
-
client = Mechanize.new
|
10
|
-
url = 'http://destinydevs.github.io/BungieNetPlatform/docs/Endpoints'
|
11
|
-
services = {}
|
12
|
-
|
13
|
-
# get services
|
14
|
-
client.get url do |page|
|
15
|
-
trs = page.parser.search '.container .table tbody tr'
|
16
|
-
|
17
|
-
trs.each do |tr|
|
18
|
-
tds = tr.search 'td'
|
19
|
-
|
20
|
-
next if tds.nil? || tds[1].nil?
|
21
|
-
|
22
|
-
services[tds[1].text.underscore] = {
|
23
|
-
:name => tds[1].text,
|
24
|
-
:method => (tds[0]&.text.downcase || 'get'),
|
25
|
-
:endpoint => (tds[2]&.text || '')
|
26
|
-
}
|
27
|
-
end unless trs.nil?
|
28
|
-
end
|
29
|
-
|
30
|
-
# save yaml
|
31
|
-
File.open "#{File.dirname(__FILE__)}/lib/bungie_client/services.yml", 'w' do |f|
|
32
|
-
f.write services.to_yaml
|
33
|
-
end
|