hornairs-transmission-client 0.0.1 → 0.0.2
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.
- data/.gitignore +3 -0
- data/README.markdown +4 -4
- data/VERSION +1 -1
- data/examples/connection-example.rb +3 -0
- data/hornairs-transmission-client.gemspec +62 -0
- data/lib/transmission-client/connection.rb +0 -3
- metadata +21 -10
- data/examples/connection.rb +0 -5
data/.gitignore
CHANGED
data/README.markdown
CHANGED
@@ -14,9 +14,9 @@ or
|
|
14
14
|
|
15
15
|
To install transmission-client:
|
16
16
|
|
17
|
-
sudo gem install transmission-client
|
17
|
+
sudo gem install hornairs-transmission-client
|
18
18
|
|
19
|
-
If you want to use EventMachine (optional) you need to install the eventmachine gem and igrigorik's em-http-request:
|
19
|
+
If you want to use EventMachine (optional) you need to install the eventmachine gem and igrigorik's em-http-request. Right now this is a bad idea because it doesn't support authentication for the transmission-rpc or a few of the request types:
|
20
20
|
|
21
21
|
sudo gem install eventmachine
|
22
22
|
sudo gem install em-http-request
|
@@ -25,12 +25,12 @@ If you want to use EventMachine (optional) you need to install the eventmachine
|
|
25
25
|
Get a list of torrents and print its file names:
|
26
26
|
|
27
27
|
require 'transmission-client'
|
28
|
-
t = Transmission::Client.new('127.0.0.1', 9091)
|
28
|
+
t = Transmission::Client.new('127.0.0.1', 9091, 'transmission', 'secretpassword')
|
29
29
|
t.torrents.each do |torrent|
|
30
30
|
puts torrent.name
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
Currently the event EventMachine driven interface doesn't support all the goodness the regular one does.
|
34
34
|
|
35
35
|
require 'eventmachine'
|
36
36
|
require 'transmission-client'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{hornairs-transmission-client}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Dominik Sander"]
|
12
|
+
s.date = %q{2010-03-03}
|
13
|
+
s.email = %q{git@dsander.de}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE",
|
16
|
+
"README.markdown",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.markdown",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"examples/connection-example.rb",
|
28
|
+
"hornairs-transmission-client.gemspec",
|
29
|
+
"lib/transmission-client.rb",
|
30
|
+
"lib/transmission-client/client.rb",
|
31
|
+
"lib/transmission-client/connection.rb",
|
32
|
+
"lib/transmission-client/em-connection.rb",
|
33
|
+
"lib/transmission-client/session.rb",
|
34
|
+
"lib/transmission-client/torrent.rb",
|
35
|
+
"test/helper.rb",
|
36
|
+
"test/test_transmission-rpc.rb"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://github.com/hornairs/transmission-client}
|
39
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
40
|
+
s.require_paths = ["lib"]
|
41
|
+
s.rubygems_version = %q{1.3.6}
|
42
|
+
s.summary = %q{A Transmission RPC Client}
|
43
|
+
s.test_files = [
|
44
|
+
"test/helper.rb",
|
45
|
+
"test/test_transmission-rpc.rb",
|
46
|
+
"examples/connection-example.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
57
|
+
end
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -43,20 +43,17 @@ module Transmission
|
|
43
43
|
elsif res.class == Net::HTTPOK
|
44
44
|
resp = JSON.parse(res.body)
|
45
45
|
if resp["result"] == 'success'
|
46
|
-
#pp resp
|
47
46
|
resp['arguments']
|
48
47
|
else
|
49
48
|
resp
|
50
49
|
end
|
51
50
|
else
|
52
|
-
pp res
|
53
51
|
raise RuntimeError, 'Reponse received from the daemon was something transmission-client cant deal with! Panic!'
|
54
52
|
end
|
55
53
|
end
|
56
54
|
|
57
55
|
def send(method, attributes={})
|
58
56
|
data = request(method, attributes)['result']
|
59
|
-
pp data
|
60
57
|
data.nil?
|
61
58
|
end
|
62
59
|
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hornairs-transmission-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Dominik Sander
|
@@ -9,19 +14,21 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-03-03 00:00:00 -05:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: thoughtbot-shoulda
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
25
32
|
description:
|
26
33
|
email: git@dsander.de
|
27
34
|
executables: []
|
@@ -40,6 +47,8 @@ files:
|
|
40
47
|
- README.rdoc
|
41
48
|
- Rakefile
|
42
49
|
- VERSION
|
50
|
+
- examples/connection-example.rb
|
51
|
+
- hornairs-transmission-client.gemspec
|
43
52
|
- lib/transmission-client.rb
|
44
53
|
- lib/transmission-client/client.rb
|
45
54
|
- lib/transmission-client/connection.rb
|
@@ -61,22 +70,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
61
70
|
requirements:
|
62
71
|
- - ">="
|
63
72
|
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 0
|
64
75
|
version: "0"
|
65
|
-
version:
|
66
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
77
|
requirements:
|
68
78
|
- - ">="
|
69
79
|
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
70
82
|
version: "0"
|
71
|
-
version:
|
72
83
|
requirements: []
|
73
84
|
|
74
85
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.3.
|
86
|
+
rubygems_version: 1.3.6
|
76
87
|
signing_key:
|
77
88
|
specification_version: 3
|
78
89
|
summary: A Transmission RPC Client
|
79
90
|
test_files:
|
80
91
|
- test/helper.rb
|
81
92
|
- test/test_transmission-rpc.rb
|
82
|
-
- examples/connection.rb
|
93
|
+
- examples/connection-example.rb
|
data/examples/connection.rb
DELETED