rootor 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -8
  3. data/lib/rootor.rb +2 -3
  4. data/lib/torrent.rb +1 -3
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 912148c0937e0acd613b737892a70f8b18a8181e
4
- data.tar.gz: 2798192791569c38351114f677d2036e13f1dde7
3
+ metadata.gz: 943d8b87318b6315055848ab62c5c7f4d0824b12
4
+ data.tar.gz: a0ebf048bcda3c9702273b784b7fc092fd03740c
5
5
  SHA512:
6
- metadata.gz: f522eac20a34c45c3bbad8ea19ebe916c179fc283416167c40cff3b82eb4d7a9524b75b83ecb4b2811200a8a7399fb6e4921c7065e43acf9d64b72079d99b34b
7
- data.tar.gz: a8e144ea15b08d1fff9d9b8bb2c20dc721a2e28d044117d937270bfbd99933b8192526998ec4f59453b43268c5ad51e55d1ea0c64f622780b7017b67b9484b54
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. Requires `Filesize` gem and `xmlrpc/client`.
1
+ Rootor is an `XMLRPC` frontend for ruby.
2
2
 
3
- To run:
4
3
  ```
5
- require_realtive 'lib/rootor'
4
+ require 'rootor'
6
5
 
7
- queries = {
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 = Rootor.new('https://<user>:<password>@<server>:<port>/<xmlrpc>', queries)
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 [] unless str.instance_of? String
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.data.any? { |tt| tt.downcase.include? str.downcase }
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rootor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - lightbright