transmission-rpc-ruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -3
- data/lib/transmission/model/torrent.rb +1 -1
- data/lib/transmission.rb +1 -1
- data/transmission-rpc-ruby.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efdf44a2260c3452e6cb831d4500909d58de5065
|
4
|
+
data.tar.gz: d13509c0535e64e4de343e417d393dcf31b4e799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31ba84133758e97c74d5e25ab7c08ac0b1457ab7fe3e0272c7f440dba1eeab2ea91d6409649a904d9f8dcf60bbdcec665c6700ade82609c8b62577707aa79f00
|
7
|
+
data.tar.gz: d5482d480e85a4b47fd87486a8c8ac8bfb3e8a2c02a443f24bb4e6e20cba13d30c26e5fcb5d1e80980f92834c55c40489cef80f143dbef0f8fbb59c06d8cbd6c
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Introducing the `Transmission::RPC` class, which represent all the raw rpc conne
|
|
34
34
|
|
35
35
|
torrents = Transmission::Model::Torrent.all connector: rpc
|
36
36
|
|
37
|
-
This Object can be passed to the `Transmission::Model` classes. Examples are shown below.
|
37
|
+
This Object can be passed to any of the `Transmission::Model` classes. Examples are shown below.
|
38
38
|
|
39
39
|
### Configuration options
|
40
40
|
|
@@ -73,10 +73,22 @@ If only a few fields are required
|
|
73
73
|
#### Add a torrent
|
74
74
|
|
75
75
|
filename = 'http://example.com/torrent.torrent'
|
76
|
-
torrent = Transmission::Model::Torrent.add filename: filename
|
76
|
+
torrent = Transmission::Model::Torrent.add arguments: {filename: filename}
|
77
77
|
|
78
78
|
__NOTE:__ you can also specify a magnet link instead
|
79
79
|
|
80
|
+
You can also ask for certain fields too
|
81
|
+
|
82
|
+
filename = 'http://example.com/torrent.torrent'
|
83
|
+
torrent = Transmission::Model::Torrent.add arguments: {filename: filename}, fields: ['id']
|
84
|
+
|
85
|
+
Or use an RPC connector instance
|
86
|
+
|
87
|
+
rpc = Transmission::RPC.new host: 'some.host', port: 9091, ssl: false, credentials: {username: 'transmission', password: '********'}
|
88
|
+
|
89
|
+
filename = 'http://example.com/torrent.torrent'
|
90
|
+
torrent = Transmission::Model::Torrent.add arguments: {filename: filename}, fields: ['id'], connector: rpc
|
91
|
+
|
80
92
|
#### Torrent instance methods
|
81
93
|
|
82
94
|
id = 1
|
@@ -162,7 +174,7 @@ If it is not desired to use any of the `Transmission::Model` classes you can use
|
|
162
174
|
ids = [1, 2, 3]
|
163
175
|
|
164
176
|
torrent_bodies = rpc.get_torrent ids
|
165
|
-
rpc.
|
177
|
+
rpc.start_torrent ids
|
166
178
|
|
167
179
|
For more methods check out `lib/transmission/rpc.rb`
|
168
180
|
|
@@ -100,7 +100,7 @@ module Transmission
|
|
100
100
|
rpc = options[:connector] || connector
|
101
101
|
body = rpc.add_torrent options[:arguments]
|
102
102
|
raise DuplicateTorrentError if body['torrent-duplicate']
|
103
|
-
find body['torrent-added']['id']
|
103
|
+
find body['torrent-added']['id'], options
|
104
104
|
end
|
105
105
|
|
106
106
|
def connector
|
data/lib/transmission.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'transmission-rpc-ruby'
|
3
|
-
s.version = '0.2.
|
3
|
+
s.version = '0.2.1'
|
4
4
|
s.date = '2015-03-27'
|
5
5
|
s.summary = "Transmission RPC wrapper in Ruby"
|
6
6
|
s.description = "A new transmission RPC wrapper for Ruby. All object oriented for controlling remote transmission daemons."
|