rootor 0.0.0 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -8
- data/lib/rootor.rb +2 -3
- data/lib/torrent.rb +1 -3
- 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: 943d8b87318b6315055848ab62c5c7f4d0824b12
|
4
|
+
data.tar.gz: a0ebf048bcda3c9702273b784b7fc092fd03740c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2933a686393636e0c2f6efd4ed4d7d2e9aafcd54d3bf06c69242c81137c890d8519ef52b58cf33073d70c09cf9baa7f84b18b3f87838fa21f065e90149bcc974
|
7
|
+
data.tar.gz: 29091f519ed00c637ae9aa165da46a0f2d274822bd3076aef9f42da5420766ed90bbc31236e958d827e479ca0a718cbcb75c3c7a72cfb033c467d72ce0c9f205
|
data/README.md
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
-
Rootor is an `XMLRPC` frontend for ruby.
|
1
|
+
Rootor is an `XMLRPC` frontend for ruby.
|
2
2
|
|
3
|
-
To run:
|
4
3
|
```
|
5
|
-
|
4
|
+
require 'rootor'
|
6
5
|
|
7
|
-
|
8
|
-
id: { call: 'hash', kind: :str },
|
9
|
-
name: { call: 'name', kind: :str }
|
10
|
-
} # optional
|
6
|
+
r = Rootor.new('https://<user>:<password>@<server>:<port>/<xmlrpc>')
|
11
7
|
|
12
|
-
r
|
8
|
+
r.torrents
|
13
9
|
```
|
data/lib/rootor.rb
CHANGED
@@ -38,11 +38,10 @@ class Rootor
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def find(str)
|
41
|
-
return []
|
42
|
-
return [] if str.empty?
|
41
|
+
return [] if (str.empty? || !str.instance_of?(String))
|
43
42
|
@torrents.map do |t|
|
44
43
|
begin
|
45
|
-
t if t.
|
44
|
+
t if t.serialize.values.any? { |tt| tt.downcase.include? str.downcase }
|
46
45
|
rescue
|
47
46
|
nil
|
48
47
|
end
|
data/lib/torrent.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
class Torrent
|
2
|
-
attr_accessor :data
|
3
|
-
|
4
2
|
def initialize(data, queries)
|
5
3
|
@data = data
|
6
4
|
@queries = queries
|
@@ -12,7 +10,7 @@ class Torrent
|
|
12
10
|
|
13
11
|
def serialize
|
14
12
|
Hash[
|
15
|
-
data.each_with_index.map do |value, index|
|
13
|
+
@data.each_with_index.map do |value, index|
|
16
14
|
[
|
17
15
|
@queries.keys[index],
|
18
16
|
mutate(@queries[@queries.keys[index]][:kind], value)
|