qbt_client 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 02480b67133ef8c463c04c2b734414497e1f98a5
4
+ data.tar.gz: 9e6287af4b5e9ff231454974ff8ba017ec7d3ea7
5
+ SHA512:
6
+ metadata.gz: 8c52453b44a058de5436aaff5da9fb1592ac2663e49752742751247086bd6b35e6c321d8fafed478c193255413a0b0a92c632b8197842b09c82b5a5fe1639d17
7
+ data.tar.gz: 64a53add284788198d77aec93a73c4039dc5152f3d616e9912e336fe62d4581147ea8b0b0d8c38d4fac25cf729afdaaafc4be1c9eb8e6d270658f060c71a6197
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in qbt_client.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jeff McAffee
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # QbtClient
2
+
3
+ A Ruby gem to access qBittorrent's [WebUI](https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'qbt_client'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install qbt_client
20
+
21
+ ## Usage
22
+
23
+ Instantiate the client
24
+
25
+ ```ruby
26
+ require 'qtb_client'
27
+
28
+ ip = 'http://127.0.0.1' # Protocol is required.
29
+ port = 8083
30
+ user = 'admin'
31
+ pass = 'abc'
32
+
33
+ client = QtbClient::WebUI.new(ip, port, user, pass)
34
+ ```
35
+
36
+ Call methods on the client
37
+
38
+ ```ruby
39
+ # Get list of torrents:
40
+ torrents = client.torrent_list
41
+
42
+
43
+ torrent_properties = {}
44
+
45
+ # Using each torrent's hash, get the torrents properties:
46
+ torrents.each do |t|
47
+ hash = t['hash']
48
+
49
+ torrent_properties[hash] = client.properties hash
50
+
51
+ # Get the torrent's trackers too
52
+ torrent_properties[hash]['trackers'] = client.trackers hash
53
+ end
54
+ ```
55
+
56
+ ## Testing
57
+
58
+ To run the tests, you'll need to have qBittorrent installed locally, WebUI
59
+ turned on, and the credentials set to:
60
+
61
+ - user: admin
62
+ - pass: abc
63
+
64
+ The tests assume that qBittorrent is running at 127.0.0.1, port 8083.
65
+
66
+ From the root project dir, run:
67
+
68
+ $ rspec spec/
69
+
70
+ ## Contributing
71
+
72
+ 1. Fork it ( https://github.com/jmcaffee/qbt_client/fork )
73
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
74
+ 3. Create your tests
75
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
76
+ 5. Push to the branch (`git push origin my-new-feature`)
77
+ 6. Create a new Pull Request
78
+
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
@@ -0,0 +1,3 @@
1
+ module QbtClient
2
+ VERSION = "0.1.0"
3
+ end