utorrent-webapi-ruby 0.0.3.1 → 0.0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64bac2390c6016d08b37b91ea9173b0750a39d6e
4
- data.tar.gz: 0dbeafe21718f8ab7dfe7b2e324a9c11d8c564c5
3
+ metadata.gz: c1c190325bac5bd413fc11b048758c256727901d
4
+ data.tar.gz: 62c596ebcb184011ac1c8c69a10c4a0d72c6ba68
5
5
  SHA512:
6
- metadata.gz: c45bfd09a2a450c8621e5e7041396ad2a6e8fedded98ae22ea051cea2a1860c4af801fcce8c7f4d8ae003bf7f29ba9ecfdce5a1446f9a08548b4baed86265a0a
7
- data.tar.gz: c6d39fdcf8d191a8ef92cd5668c9ab760e9899d939eb54bafaf75ddb231843ccb3422d16250889a1fee57b58ee4c9c51d90a1afa3ec11635b56cf40e79f05993
6
+ metadata.gz: 54646c8df9bde02da91f81662fddd1bdffd2f3ab0fbda4b3bdabed517b3cae7dec10a12300e97602b5bfde7e106666ec80917a99633a071321b028c88ff463c3
7
+ data.tar.gz: 3f93cd83c99d0fc8a93f40656380b0e4bacb759f40e1050810481f8ed509aceea22ab27f7cebaed66e8326ec6fa1f57cc84332c86ccb61a7598e0699cd8902d3
data/README.md CHANGED
@@ -20,6 +20,7 @@ configuration.url = '192.168.2.100'
20
20
  configuration.port = '8085'
21
21
  configuration.username = 'admin'
22
22
  configuration.password = 'password'
23
+ configuration.logger = Logger.new(path)
23
24
  UTorrent.configuration = configuration
24
25
  ```
25
26
 
@@ -24,4 +24,8 @@ module UTorrent
24
24
  def base_uri
25
25
  URI.parse("#{@configuration.protocol}://#{@configuration.url}:#{@configuration.port}/gui/")
26
26
  end
27
+
28
+ def log
29
+ @configuration.logger
30
+ end
27
31
  end
@@ -1,10 +1,16 @@
1
+ require 'logger'
2
+
1
3
  module UTorrent
2
4
  class Configuration
3
5
  attr_accessor :url, :username, :password, :port
4
- attr_writer :protocol
6
+ attr_writer :protocol, :logger
5
7
 
6
8
  def protocol
7
9
  @protocol ||= 'http'
8
10
  end
11
+
12
+ def logger
13
+ @logger ||= Logger.new(STDOUT)
14
+ end
9
15
  end
10
16
  end
@@ -19,6 +19,8 @@ module UTorrent
19
19
 
20
20
  yield request if block_given?
21
21
 
22
+ UTorrent.log.debug "UTorrent::Http.get #{request.path}"
23
+
22
24
  http = Net::HTTP.new(uri.host, uri.port)
23
25
  http.request(request)
24
26
  end
@@ -54,6 +54,7 @@ module UTorrent
54
54
  end
55
55
 
56
56
  return matching_torrent unless matching_torrent.nil?
57
+ sleep 0.1
57
58
  end
58
59
  end
59
60
  end
@@ -1,3 +1,3 @@
1
1
  module UTorrent
2
- VERSION = '0.0.3.1'.freeze
2
+ VERSION = '0.0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utorrent-webapi-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.1
4
+ version: 0.0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Wu