saber 1.0.0 → 1.0.1
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/CHANGELOG.md +3 -2
- data/Gemfile +1 -3
- data/Gemfile.lock +4 -0
- data/Guardfile +1 -1
- data/extconf.rb +3 -2
- data/lib/saber/version.rb +1 -1
- data/spec/data/{bt → remote_bt}/lost.mkv +0 -0
- data/spec/data/{bt → remote_bt}/lost/01.lost.mkv +0 -0
- data/spec/data/{bt → remote_bt}/lost/02.lost.mkv +0 -0
- data/spec/data/{bt → remote_bt}/prison.break.mkv +0 -0
- data/spec/data/{bt → remote_bt}/prison.break/01.prison.break.mkv +0 -0
- data/spec/data/{bt → remote_bt}/prison.break/02.prison.break.mkv +0 -0
- data/spec/data/{bt → remote_bt}/terra.nova.mkv +0 -0
- data/spec/data/{bt → remote_bt}/terra.nova/01.terra.nova.mkv +0 -0
- data/spec/data/{bt → remote_bt}/terra.nova/02.terra.nova.mkv +0 -0
- data/spec/saber/{client_spec.rb → autofetcher/client_spec.rb} +0 -0
- data/spec/saber/{server_spec.rb → autofetcher/server_spec.rb} +3 -7
- data/spec/saber/fetcher_spec.rb +18 -0
- data/spec/saber/task_spec.rb +3 -2
- data/spec/spec_helper.rb +29 -31
- metadata +14 -15
- data/spec/saber/downloader_spec.rb +0 -20
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,11 +2,8 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gem "pd"
|
4
4
|
gem "tagen", "~>2.0.1"
|
5
|
-
#gem "tagen", path: "/home/guten/dev/one/tagen"
|
6
5
|
gem "optimism", "~>3.3.1"
|
7
|
-
#gem "optimism", path: "/home/guten/dev/one/optimism"
|
8
6
|
gem "pa", "~>1.3.2"
|
9
|
-
#gem "pa", path: "/home/guten/dev/one/pa"
|
10
7
|
gem "retort", "~>0.0.6"
|
11
8
|
gem "thor", "~>0.16.0"
|
12
9
|
gem "net-ssh", "~>2.5.2"
|
@@ -21,6 +18,7 @@ group :development do
|
|
21
18
|
gem "webmock"
|
22
19
|
gem "guard"
|
23
20
|
gem "guard-rspec"
|
21
|
+
gem "rb-inotify"
|
24
22
|
#gem "rag", path: "/home/guten/dev/one/rag"
|
25
23
|
end
|
26
24
|
|
data/Gemfile.lock
CHANGED
@@ -9,6 +9,7 @@ GEM
|
|
9
9
|
diff-lcs (1.1.3)
|
10
10
|
domain_name (0.5.3)
|
11
11
|
unf (~> 0.0.3)
|
12
|
+
ffi (1.1.5)
|
12
13
|
guard (1.3.2)
|
13
14
|
listen (>= 0.4.2)
|
14
15
|
thor (>= 0.14.6)
|
@@ -39,6 +40,8 @@ GEM
|
|
39
40
|
pa (1.3.2)
|
40
41
|
pd
|
41
42
|
pd (1.1.0)
|
43
|
+
rb-inotify (0.8.8)
|
44
|
+
ffi (>= 0.5.0)
|
42
45
|
retort (0.0.6)
|
43
46
|
reverse_markdown (0.3.0)
|
44
47
|
nokogiri
|
@@ -76,6 +79,7 @@ DEPENDENCIES
|
|
76
79
|
optimism (~> 3.3.1)
|
77
80
|
pa (~> 1.3.2)
|
78
81
|
pd
|
82
|
+
rb-inotify
|
79
83
|
retort (~> 0.0.6)
|
80
84
|
reverse_markdown (~> 0.3.0)
|
81
85
|
rspec
|
data/Guardfile
CHANGED
data/extconf.rb
CHANGED
@@ -3,8 +3,9 @@ require "fileutils"
|
|
3
3
|
require "mkmf"
|
4
4
|
|
5
5
|
bindir = File.expand_path("../bin", __FILE__)
|
6
|
+
dist_bindir = ENV["GEM_BINDIR"] || Gem.bindir # fix for archlinux package.
|
6
7
|
|
7
|
-
FileUtils.install File.join(bindir, "saber-drb_add"),
|
8
|
-
FileUtils.install File.join(bindir, "saber.bib"),
|
8
|
+
FileUtils.install File.join(bindir, "saber-drb_add"), dist_bindir
|
9
|
+
FileUtils.install File.join(bindir, "saber.bib"), dist_bindir
|
9
10
|
|
10
11
|
create_makefile("saber")
|
data/lib/saber/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
Server = Saber::Server
|
4
|
-
DRbServer = Saber::DRbServer
|
5
|
-
|
6
|
-
public :build_files
|
7
|
-
end
|
3
|
+
Server = Saber::AutoFetcher::Server
|
4
|
+
DRbServer = Saber::AutoFetcher::DRbServer
|
5
|
+
public_all_methods DRbServer
|
8
6
|
|
9
7
|
describe DRbServer do
|
10
8
|
describe "#build_files" do
|
@@ -14,5 +12,3 @@ describe DRbServer do
|
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
17
|
-
|
18
|
-
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
Fetcher = Saber::Fetcher
|
4
|
+
|
5
|
+
uri="a.mkv"
|
6
|
+
|
7
|
+
xdescribe Fetcher do
|
8
|
+
describe "test everyting" do
|
9
|
+
it "works" do
|
10
|
+
XMLRPC::Client.stub(:new2)
|
11
|
+
|
12
|
+
d = Fetcher.new
|
13
|
+
|
14
|
+
d.should_receive(:aria2_add).with(["ftp://seedbox/bt/foo/bar.mkv"], {dir: "#{$spec_data}/download/foo"})
|
15
|
+
d.add("foo/bar.mkv")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/spec/saber/task_spec.rb
CHANGED
@@ -3,7 +3,8 @@ require "spec_helper"
|
|
3
3
|
Task = Saber::Task
|
4
4
|
|
5
5
|
class Task::HelloTest < Task::Base
|
6
|
-
|
6
|
+
desc "hello", "hello"
|
7
|
+
def hello(*args)
|
7
8
|
args
|
8
9
|
end
|
9
10
|
end
|
@@ -11,6 +12,6 @@ end
|
|
11
12
|
describe Task do
|
12
13
|
it "(complete example)" do
|
13
14
|
expect(Task["hello_test"]).to be(Task::HelloTest)
|
14
|
-
expect(Task["hello_test"].invoke(1, 2)).to eq([1, 2])
|
15
|
+
expect(Task["hello_test"].invoke(:hello, [1, 2])).to eq([1, 2])
|
15
16
|
end
|
16
17
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,38 +1,34 @@
|
|
1
|
+
require "pd"
|
1
2
|
require "saber"
|
2
3
|
require "logger"
|
3
4
|
|
4
5
|
$spec_dir = File.expand_path("..", __FILE__)
|
5
|
-
$spec_data = File.
|
6
|
+
$spec_data = File.join($spec_dir, "data")
|
7
|
+
$spec_tmp = File.join($spec_dir, "tmp")
|
6
8
|
|
7
|
-
Saber::Rc
|
9
|
+
Rc = Saber::Rc
|
10
|
+
Rc._merge Optimism <<EOF
|
8
11
|
p:
|
9
12
|
home = Pa("#{$spec_data}/_saber")
|
10
13
|
homerc = Pa("#{$spec_data}/_saberrc")
|
11
|
-
|
14
|
+
watch = nil
|
15
|
+
remote_watch = nil
|
16
|
+
fetcher_download = Pa("#{$spec_data}/download")
|
17
|
+
remote_download = Pa("#{$spec_data}/remote_bt")
|
18
|
+
download = Pa("#{$spec_data}/remote_bt")
|
12
19
|
|
13
20
|
server:
|
14
|
-
download = Pa("#{$spec_data}/bt")
|
15
21
|
ftp = "ftp://seedbox/bt"
|
16
22
|
host = "localhost"
|
17
23
|
user = "foo"
|
18
24
|
|
19
|
-
port = 8914
|
20
|
-
token = "token"
|
21
|
-
drb_uri = "druby://localhost:8915"
|
22
|
-
|
23
25
|
# upload
|
24
26
|
|
25
|
-
p:
|
26
|
-
watch = nil
|
27
|
-
|
28
27
|
username = "username"
|
29
28
|
|
30
29
|
bib:
|
31
30
|
username = "bib-username"
|
32
31
|
announce_url = "bib-announce_url"
|
33
|
-
|
34
|
-
ptp:
|
35
|
-
announce_url = "ptp-announce_url"
|
36
32
|
EOF
|
37
33
|
$log = Logger.new(StringIO.new)
|
38
34
|
|
@@ -46,7 +42,8 @@ VCR.configure do |c|
|
|
46
42
|
end
|
47
43
|
|
48
44
|
RSpec.configure do |config|
|
49
|
-
def capture(stream)
|
45
|
+
def capture(stream=:stdout)
|
46
|
+
require "stringio"
|
50
47
|
begin
|
51
48
|
stream = stream.to_s
|
52
49
|
eval "$#{stream} = StringIO.new"
|
@@ -62,24 +59,25 @@ RSpec.configure do |config|
|
|
62
59
|
alias :silence :capture
|
63
60
|
end
|
64
61
|
|
65
|
-
module
|
66
|
-
|
62
|
+
module RSpec
|
63
|
+
module Core
|
64
|
+
module DSL
|
65
|
+
def xdescribe(*args, &blk)
|
66
|
+
describe *args do
|
67
|
+
pending
|
68
|
+
end
|
69
|
+
end
|
67
70
|
|
68
|
-
|
69
|
-
describe *args do
|
70
|
-
pending "xxxxxxxxx"
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def xcontext(*args, &blk)
|
75
|
-
context *args do
|
76
|
-
pending "xxxxxxxxx"
|
71
|
+
alias xcontext xdescribe
|
77
72
|
end
|
78
73
|
end
|
74
|
+
end
|
79
75
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
76
|
+
def public_all_methods(*klasses)
|
77
|
+
klasses.each {|klass|
|
78
|
+
klass.class_eval {
|
79
|
+
public *(self.protected_instance_methods(false) + self.private_instance_methods(false))
|
80
|
+
public_class_method *(self.protected_methods(false) + self.private_methods(false))
|
81
|
+
}
|
82
|
+
}
|
85
83
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pd
|
@@ -242,18 +242,18 @@ files:
|
|
242
242
|
- rutorrent/plugin.info
|
243
243
|
- saber.gemspec
|
244
244
|
- spec/data/_saber/.gitkeep
|
245
|
-
- spec/data/
|
246
|
-
- spec/data/
|
247
|
-
- spec/data/
|
248
|
-
- spec/data/
|
249
|
-
- spec/data/
|
250
|
-
- spec/data/
|
251
|
-
- spec/data/
|
252
|
-
- spec/data/
|
253
|
-
- spec/data/
|
254
|
-
- spec/saber/client_spec.rb
|
255
|
-
- spec/saber/
|
256
|
-
- spec/saber/
|
245
|
+
- spec/data/remote_bt/lost.mkv
|
246
|
+
- spec/data/remote_bt/lost/01.lost.mkv
|
247
|
+
- spec/data/remote_bt/lost/02.lost.mkv
|
248
|
+
- spec/data/remote_bt/prison.break.mkv
|
249
|
+
- spec/data/remote_bt/prison.break/01.prison.break.mkv
|
250
|
+
- spec/data/remote_bt/prison.break/02.prison.break.mkv
|
251
|
+
- spec/data/remote_bt/terra.nova.mkv
|
252
|
+
- spec/data/remote_bt/terra.nova/01.terra.nova.mkv
|
253
|
+
- spec/data/remote_bt/terra.nova/02.terra.nova.mkv
|
254
|
+
- spec/saber/autofetcher/client_spec.rb
|
255
|
+
- spec/saber/autofetcher/server_spec.rb
|
256
|
+
- spec/saber/fetcher_spec.rb
|
257
257
|
- spec/saber/task_spec.rb
|
258
258
|
- spec/saber/tracker/bib_spec.rb
|
259
259
|
- spec/spec_helper.rb
|
@@ -309,4 +309,3 @@ signing_key:
|
|
309
309
|
specification_version: 3
|
310
310
|
summary: A complete solution for PT users.
|
311
311
|
test_files: []
|
312
|
-
has_rdoc:
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
Downloader = Saber::Downloader
|
4
|
-
|
5
|
-
|
6
|
-
uri="Microsoft Office 2010 Professional Plus (Activator Included)/KMS Activator for Microsoft Office 2010 Applications x86 x64 Multilingual-FIXISO~DiBYA/mini-KMS_Activator_v1.053.exe"
|
7
|
-
|
8
|
-
|
9
|
-
xdescribe Downloader do
|
10
|
-
describe "test everyting" do
|
11
|
-
it "works" do
|
12
|
-
XMLRPC::Client.stub(:new2)
|
13
|
-
|
14
|
-
d = Downloader.new
|
15
|
-
|
16
|
-
d.should_receive(:aria2_add).with(["ftp://seedbox/bt/foo/bar.mkv"], {dir: "#{$spec_data}/download/foo"})
|
17
|
-
d.add("foo/bar.mkv")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|