whatcd 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/whatcd.rb +7 -7
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14c1d253387716379840e8430d58e3827c1f6f25
|
4
|
+
data.tar.gz: 0d45e000578d27cbfd41b48a0f35d9d8c752349f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d79204a37b2b183a3042b40c4a4712d82127feb93d1585493c4672bcd447bbc6448c05432997b53934904ddd8d4976fcba782b3998e329ac34106299a8eb76dd
|
7
|
+
data.tar.gz: 4c88341fa0c6a57f6539216ecead7ed3fa11f2f3efce393a6b5065abee3a649c1488bb3e2a0fadf29aaf4b8a36f33c17b28702328662bc24f42469e2ea71b035
|
data/lib/whatcd.rb
CHANGED
@@ -2,15 +2,15 @@ require "faraday"
|
|
2
2
|
require "faraday-cookie_jar"
|
3
3
|
require "json"
|
4
4
|
|
5
|
-
# Public: An API wrapper for
|
5
|
+
# Public: An API wrapper for Gazelle tracker's JSON API.
|
6
6
|
#
|
7
7
|
# Examples
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# client = WhatCD::Client.new 'username', 'password'
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# client.fetch :user, :id => 666
|
12
12
|
# => { ... }
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# client.fetch :browse, :searchstr => 'The Flaming Lips'
|
15
15
|
# => { ... }
|
16
16
|
class WhatCD
|
@@ -20,15 +20,15 @@ class WhatCD
|
|
20
20
|
class Client
|
21
21
|
attr_reader :connection
|
22
22
|
|
23
|
-
def initialize(username = nil, password = nil)
|
24
|
-
@connection = Faraday.new(:url => "https
|
23
|
+
def initialize(username = nil, password = nil, host = 'what.cd')
|
24
|
+
@connection = Faraday.new(:url => "https://#{host}") do |builder|
|
25
25
|
builder.request :url_encoded
|
26
26
|
builder.use :cookie_jar
|
27
27
|
builder.adapter Faraday.default_adapter
|
28
28
|
end
|
29
29
|
|
30
30
|
unless username.nil? || password.nil?
|
31
|
-
authenticate username, password
|
31
|
+
authenticate username, password
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatcd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Brickfeld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -79,9 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.6.13
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: An API wrapper for What.cd's JSON API
|
86
86
|
test_files: []
|
87
|
-
has_rdoc:
|