xunlei 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,6 +13,8 @@ so please make sure you have Google Chrome installed first.
13
13
  It can automatically dump task file names and urls as well as browser cookies,
14
14
  so that it can delegate to wget to download files for you.
15
15
 
16
+ Compatible with Ruby version 1.8.7 and 1.9+
17
+
16
18
  WARNING:
17
19
  it stores your USERNAME and PASSWORD for
18
20
  lixian.vip.xunlei.com as PLAINTEXT at ~/.xunlei/credentials.yml
@@ -47,7 +49,7 @@ Add ed2k or magnet link as new task
47
49
  Add all ed2k or magnet links on given web page as new tasks
48
50
 
49
51
  xunlei add_page http://page_with_a_chunk_load_of_links/
50
-
52
+
51
53
  Google for ed2k and magnet links
52
54
 
53
55
  xunlei google Repulsion --with 720p
data/bin/xunlei CHANGED
@@ -1,33 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "xunlei"
4
- # require File.expand_path("lib/xunlei/version.rb")
5
- # require File.expand_path("lib/xunlei/engine.rb")
6
- # require File.expand_path("lib/xunlei/search.rb")
7
- require "yaml"
8
4
  require "commander/import"
9
5
 
6
+ require "xunlei/helpers/cli_helper"
7
+ include Xunlei::Helper::CLIHelper
8
+
10
9
  program :name, "Xunlei"
11
10
  program :version, Xunlei::VERSION
12
11
  program :description, "lixian.vip.xunlei.com utility script"
13
12
 
14
- def filter_files(options = nil)
15
- files = []
16
- YAML.load_file(xunlei_tasks_path).each do |file|
17
- if !options.only.nil?
18
- files << file if file[:name] =~ /#{options.only}/i
19
- elsif !options.except.nil?
20
- files << file unless file[:name] =~ /#{options.except}/i
21
- else
22
- files << file
23
- end
24
- end
25
- files
26
- end
27
-
28
13
  def execute_dump_action(args, options)
29
14
  options.default :driver => "chrome"
30
-
15
+
31
16
  check_for_config_files
32
17
  check_for_chromedriver
33
18
  credentials = YAML.load_file(xunlei_credential_file_path)
@@ -51,158 +36,28 @@ def do_dump_cookies(c, &block)
51
36
  end
52
37
  end
53
38
 
54
- def all_downloaded_tasks
55
- system("touch #{xunlei_downloaded_tasks_path}")
56
-
57
- YAML.load_file(xunlei_downloaded_tasks_path) || []
58
- end
59
-
60
- def xunlei_cookies_path
61
- File.join(xunlei_folder_path, "cookies.txt")
62
- end
63
-
64
- def xunlei_tasks_path
65
- File.join(xunlei_folder_path, "all_tasks.yml")
66
- end
67
-
68
- def xunlei_credential_file_path
69
- File.join(xunlei_folder_path, "credentials.yml")
70
- end
71
-
72
- def xunlei_downloaded_tasks_path
73
- File.join(xunlei_folder_path, "downloaded.yml")
74
- end
75
-
76
- def xunlei_folder_name
77
- "~/.xunlei"
78
- end
79
-
80
- def xunlei_folder_path
81
- File.expand_path(xunlei_folder_name)
82
- end
83
-
84
- def xunlei_folder_exists?
85
- Dir.exists?(xunlei_folder_path)
86
- end
87
-
88
- def credential_file_exists?
89
- File.exists?(xunlei_credential_file_path)
90
- end
91
-
92
- def create_xunlei_folder
93
- Dir.mkdir(xunlei_folder_path)
94
- end
95
-
96
- def ask_for_credentials
97
- puts "#{xunlei_credential_file_path} not exists. Now creating one."
98
- puts "*** WARNING: your USERNAME and PASSWORD will be stored as PLAINTEXT at #{xunlei_credential_file_path} ***"
99
-
100
- username = ask("Username: ")
101
- password = ask("Password: ") { |q| q.echo = "*" }
102
- File.open(xunlei_credential_file_path, "w") do |file|
103
- file.write({ :username => username, :password => password }.to_yaml)
104
- end
105
-
106
- puts "#{xunlei_credential_file_path} successfully created."
107
- end
108
-
109
- def check_for_credentials
110
- ask_for_credentials unless credential_file_exists?
111
- end
112
-
113
- def chromedriver_zip_name
114
- "chromedriver_mac.zip"
115
- end
116
-
117
- def check_for_chromedriver
118
- unless system("which chromedriver > /dev/null 2>&1")
119
- puts "chromedriver not found in your PATH"
120
- if agree("Would you like me to try download it for you? (yes or no)")
121
- if system("wget 'http://chromium.googlecode.com/files/chromedriver_mac_16.0.902.0.zip' -O #{chromedriver_zip_name}")
122
- if system("unzip #{chromedriver_zip_name}")
123
- puts "moving chromedriver to /usr/local/bin ..."
124
- system("mv -v chromedriver /usr/local/bin")
125
-
126
- puts "deleting temporary files..."
127
- system("rm -v #{chromedriver_zip_name}")
128
- else
129
- puts "`unzip` not found in your PATH. Try manually unzip #{chromedriver_zip_name} and move it to /usr/local/bin"
130
- exit
131
- end
132
- end
133
- else
134
- puts "OK. You can download it manually here: http://code.google.com/p/chromium/downloads"
135
- exit
136
- end
137
- end
138
- end
139
-
140
- def check_for_config_files
141
- create_xunlei_folder unless xunlei_folder_exists?
142
- check_for_credentials
143
- end
144
-
145
- def move_to_downloaded_file(task)
146
- puts "#{task[:name]} successfully downloaded."
147
-
148
- downloaded = all_downloaded_tasks
149
- downloaded << task[:name]
150
- File.open(xunlei_downloaded_tasks_path, "w") do |file|
151
- file.write(downloaded.to_yaml)
152
- end
153
-
154
- all_tasks = YAML.load_file(xunlei_tasks_path)
155
- all_tasks.delete(task)
156
- File.open(xunlei_tasks_path, "w") do |file|
157
- file.write(all_tasks.to_yaml)
158
- end
159
- end
160
-
161
- def total_size(file_sizes)
162
- total_megabytes = 0
163
-
164
- file_sizes.each do |file_size|
165
- if file_size =~ /G/
166
- total_megabytes += 1000 * file_size.to_f
167
- else
168
- total_megabytes += file_size.to_f
169
- end
170
- end
171
-
172
- total_megabytes
173
- end
174
-
175
- def show_files(files)
176
- files.each do |file|
177
- puts "#{file[:size]}\t#{file[:name]}"
178
- end
179
-
180
- puts
181
- puts "Total: #{files.size} files, #{total_size(files.map { |file| file[:size] })} MB (estimated)"
182
- end
183
-
184
39
  command :dump_tasks do |c|
185
40
  c.syntax= "dump_tasks"
186
41
  c.description = "dump all files to #{xunlei_tasks_path}"
187
-
42
+
188
43
  do_dump_cookies(c) do |engine, args|
189
44
  tasks = engine.dump_tasks
190
-
45
+
191
46
  current_downloaded_tasks = all_downloaded_tasks & tasks.map { |task| task[:name] }
192
47
  tasks.reject! { |task| current_downloaded_tasks.include?(task[:name]) }
193
-
48
+
194
49
  File.open(xunlei_tasks_path, "w") do |file|
195
50
  file.write(tasks.to_yaml)
196
51
  end
197
-
52
+
198
53
  puts "Successfully dumped following tasks:"
199
54
  puts
200
55
  show_files(tasks)
201
-
56
+
202
57
  puts
203
-
58
+
204
59
  unless current_downloaded_tasks.empty?
205
- puts "Finished downloads: (you should delete them on website)"
60
+ puts "#{current_downloaded_tasks.count} finished downloads: (you should delete them on website)"
206
61
  puts
207
62
  current_downloaded_tasks.each do |task_name|
208
63
  puts task_name
@@ -214,7 +69,7 @@ end
214
69
  command :add do |c|
215
70
  c.syntax= "add KEYWORD"
216
71
  c.description = "add new task(s)."
217
-
72
+
218
73
  do_dump_cookies(c) do |engine, args|
219
74
  engine.add_task(args.first)
220
75
  end
@@ -223,7 +78,7 @@ end
223
78
  command :dump_cookies do |c|
224
79
  c.syntax = "dump_cookies"
225
80
  c.description = "dump cookies to #{xunlei_cookies_path}"
226
-
81
+
227
82
  do_dump_cookies(c)
228
83
  end
229
84
 
@@ -233,30 +88,28 @@ command :download do |c|
233
88
  c.option "--only PATTERN", String, "only download files which names include PATTERN"
234
89
  c.option "--except PATTERN", String, "do not download files which names include PATTERN"
235
90
  c.option "--reverse", "download files in reverse order"
236
-
91
+
237
92
  c.action do |args, options|
238
93
  options.default :only => nil, :except => nil
239
-
240
- files = filter_files(options)
241
-
94
+
95
+ files = filter_files(YAML.load_file(xunlei_tasks_path), options)
96
+
242
97
  files.reverse! if options.reverse
243
-
98
+
244
99
  if files.empty?
245
100
  puts "Nothing to do."
246
101
  else
247
102
  puts "\nAbout to download following files:"
248
103
  puts
249
- files.each do |file|
250
- puts file[:name]
251
- end
252
-
104
+ show_files(files)
105
+
253
106
  if agree("\nConfirm? (yes or no)")
254
107
  files.each do |file|
255
108
  cmd = "wget --load-cookies=#{xunlei_cookies_path} '#{file[:url]}' -c -O \"#{file[:name]}\""
256
109
  if system(cmd)
257
- move_to_downloaded_file(file)
110
+ mark_as_downloaded(file)
258
111
  else
259
- break
112
+ raise "Download failed"
260
113
  end
261
114
  end
262
115
  end
@@ -267,12 +120,12 @@ end
267
120
  command :show do |c|
268
121
  c.syntax = "show"
269
122
  c.description = "show files in #{xunlei_tasks_path}"
270
-
123
+
271
124
  c.action do |args, options|
272
125
  options.default :only => nil, :except => nil
273
126
  puts "You have following files in your #{xunlei_tasks_path}:"
274
127
  puts
275
- files = filter_files(options)
128
+ files = filter_files(YAML.load_file(xunlei_tasks_path), options)
276
129
  show_files(files)
277
130
  end
278
131
  end
@@ -327,7 +180,7 @@ command :lucky do |c|
327
180
  links = search.google_simplecd(args, options)
328
181
  puts
329
182
  puts "#{links.count} links found."
330
-
183
+
331
184
  execute_dump_action(args, options) do |engine, args|
332
185
  links.each do |link|
333
186
  engine.add_task(link)
@@ -349,7 +202,7 @@ command :add_page do |c|
349
202
  links = search.add_page(args.first, options)
350
203
  puts
351
204
  puts "#{links.count} links found."
352
-
205
+
353
206
  execute_dump_action(args, options) do |engine, args|
354
207
  links.each do |link|
355
208
  engine.add_task(link)
@@ -0,0 +1,34 @@
1
+ module Xunlei
2
+ module Configurator
3
+
4
+ def xunlei_folder_name
5
+ "~/.xunlei"
6
+ end
7
+
8
+ def xunlei_folder_path
9
+ File.expand_path(xunlei_folder_name)
10
+ end
11
+
12
+ def xunlei_cookies_path
13
+ File.join(xunlei_folder_path, "cookies.txt")
14
+ end
15
+
16
+ def xunlei_tasks_path
17
+ File.join(xunlei_folder_path, "all_tasks.yml")
18
+ end
19
+
20
+ def xunlei_credential_file_path
21
+ File.join(xunlei_folder_path, "credentials.yml")
22
+ end
23
+
24
+ def xunlei_downloaded_tasks_path
25
+ File.join(xunlei_folder_path, "downloaded.yml")
26
+ end
27
+
28
+ def chromedriver_zip_name
29
+ "chromedriver_mac.zip"
30
+ end
31
+ end
32
+
33
+ Config = Configurator
34
+ end
@@ -0,0 +1,121 @@
1
+ require "yaml"
2
+
3
+ module Xunlei
4
+ module Helper
5
+ module CLIHelper
6
+ require "xunlei/configurator"
7
+ include ::Xunlei::Config
8
+
9
+ def filtered?(file, options)
10
+ return false unless options
11
+ return true if !options.only.nil? and !(file[:name] =~ /#{options.only}/i)
12
+ return true if !options.except.nil? and file[:name] =~ /#{options.except}/i
13
+ false
14
+ end
15
+
16
+ def filter_files(files, options=nil)
17
+ files.select{ |file| !filtered?(file, options) }.inject([], :<<)
18
+ end
19
+
20
+ def total_size(file_sizes)
21
+ file_sizes.inject(0) do |total_megabytes, file_size|
22
+ if file_size =~ /G/i
23
+ total_megabytes + 1000 * file_size.to_f
24
+ elsif file_size =~ /M/i
25
+ total_megabytes + file_size.to_f
26
+ else
27
+ total_megabytes + 1
28
+ end
29
+ end
30
+ end
31
+
32
+ def show_files(files)
33
+ files.each do |file|
34
+ puts "#{file[:size]}\t#{file[:name]}"
35
+ end
36
+
37
+ puts
38
+ puts "Total: #{files.size} files, #{total_size(files.map { |file| file[:size] })} MB (estimated)"
39
+ end
40
+
41
+ def mark_as_downloaded(task)
42
+ puts "#{task[:name]} successfully downloaded."
43
+
44
+ downloaded = all_downloaded_tasks
45
+ downloaded << task[:name]
46
+ File.open(xunlei_downloaded_tasks_path, "w") do |file|
47
+ file.write(downloaded.to_yaml)
48
+ end
49
+
50
+ all_tasks = YAML.load_file(xunlei_tasks_path)
51
+ all_tasks.delete(task)
52
+ File.open(xunlei_tasks_path, "w") do |file|
53
+ file.write(all_tasks.to_yaml)
54
+ end
55
+ end
56
+
57
+ def all_downloaded_tasks
58
+ system("touch #{xunlei_downloaded_tasks_path}") # touch it in case it's non-existent
59
+
60
+ YAML.load_file(xunlei_downloaded_tasks_path) || []
61
+ end
62
+
63
+ def ask_for_credentials
64
+ puts "#{xunlei_credential_file_path} not exists. Now creating one."
65
+ puts "*** WARNING: your USERNAME and PASSWORD will be stored as PLAINTEXT at #{xunlei_credential_file_path} ***"
66
+
67
+ username = ask("Username: ")
68
+ password = ask("Password: ") { |q| q.echo = "*" }
69
+ File.open(xunlei_credential_file_path, "w") do |file|
70
+ file.write({ :username => username, :password => password }.to_yaml)
71
+ end
72
+
73
+ puts "#{xunlei_credential_file_path} successfully created."
74
+ end
75
+
76
+ def check_for_credentials
77
+ ask_for_credentials unless credential_file_exists?
78
+ end
79
+
80
+ def create_xunlei_folder
81
+ Dir.mkdir(xunlei_folder_path)
82
+ end
83
+
84
+ def xunlei_folder_exists?
85
+ File.directory?(xunlei_folder_path)
86
+ end
87
+
88
+ def credential_file_exists?
89
+ File.exists?(xunlei_credential_file_path)
90
+ end
91
+
92
+ def check_for_chromedriver
93
+ unless system("which chromedriver > /dev/null 2>&1")
94
+ puts "chromedriver not found in your PATH"
95
+ if agree("Would you like me to try download it for you? (yes or no)")
96
+ if system("wget 'http://chromium.googlecode.com/files/chromedriver_mac_16.0.902.0.zip' -O #{chromedriver_zip_name}")
97
+ if system("unzip #{chromedriver_zip_name}")
98
+ puts "moving chromedriver to /usr/local/bin ..."
99
+ system("mv -v chromedriver /usr/local/bin")
100
+
101
+ puts "deleting temporary files..."
102
+ system("rm -v #{chromedriver_zip_name}")
103
+ else
104
+ puts "`unzip` not found in your PATH. Try manually unzip #{chromedriver_zip_name} and move it to /usr/local/bin"
105
+ exit
106
+ end
107
+ end
108
+ else
109
+ puts "OK. You can download it manually here: http://code.google.com/p/chromium/downloads"
110
+ exit
111
+ end
112
+ end
113
+ end
114
+
115
+ def check_for_config_files
116
+ create_xunlei_folder unless xunlei_folder_exists?
117
+ check_for_credentials
118
+ end
119
+ end
120
+ end
121
+ end
@@ -1,3 +1,3 @@
1
1
  module Xunlei
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  require "simplecov"
2
2
  SimpleCov.start
3
3
 
4
- Dir["./lib/xunlei/*.rb"].each { |file| require file }
4
+ Dir["./lib/xunlei/**/*.rb"].each { |file| require file }
@@ -0,0 +1,56 @@
1
+ require "spec_helper"
2
+ require "ostruct"
3
+
4
+ describe Xunlei::Helper::CLIHelper do
5
+ before(:each) do
6
+ @main = Class.new
7
+ @main.class_eval { extend Xunlei::Helper::CLIHelper }
8
+
9
+ @options_only = OpenStruct.new :only => "matrix"
10
+ @options_except = OpenStruct.new :except => "matrix"
11
+ @options_nil = OpenStruct.new
12
+ end
13
+
14
+ describe "filtered?" do
15
+ before(:each) do
16
+ @file = { :name => "MatRiX" }
17
+ end
18
+
19
+ it "should have a filtered? method" do
20
+ @main.should respond_to(:filtered?)
21
+ end
22
+
23
+ it "should filter correctly" do
24
+ @main.filtered?(@file, nil).should be_false
25
+ @main.filtered?(@file, @options_only).should be_false
26
+ @main.filtered?(@file, @options_except).should be_true
27
+ @main.filtered?(@file, @options_nil).should be_false
28
+ end
29
+ end
30
+
31
+ describe "filter_files" do
32
+ before(:each) do
33
+ @files = [{:name => "LOTR"}, {:name => "MatRix"}, {:name => "Bourne"}]
34
+ end
35
+ it "should have a filter_files method" do
36
+ @main.should respond_to(:filter_files)
37
+ end
38
+
39
+ it "should filter correctly" do
40
+ @main.filter_files(@files, @options_only).count.should == 1
41
+ @main.filter_files(@files, @options_except).count.should == 2
42
+ @main.filter_files(@files, @options_nil).count.should == 3
43
+ @main.filter_files(@files, nil).count.should == 3
44
+ end
45
+ end
46
+
47
+ describe "total_size" do
48
+ it "should have a total_size method" do
49
+ @main.should respond_to(:total_size)
50
+ end
51
+
52
+ it "should calculate total size correctly" do
53
+ @main.total_size(%w{1.1G 300M 512K}).should == 1.1 * 1000 + 300 + 1
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xunlei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-21 00:00:00.000000000Z
12
+ date: 2012-02-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70151191992140 !ruby/object:Gem::Requirement
16
+ requirement: &70294552163660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70151191992140
24
+ version_requirements: *70294552163660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70151191991700 !ruby/object:Gem::Requirement
27
+ requirement: &70294552163200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70151191991700
35
+ version_requirements: *70294552163200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simplecov
38
- requirement: &70151191991240 !ruby/object:Gem::Requirement
38
+ requirement: &70294552162180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70151191991240
46
+ version_requirements: *70294552162180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: watir-webdriver
49
- requirement: &70151191990800 !ruby/object:Gem::Requirement
49
+ requirement: &70294552158400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70151191990800
57
+ version_requirements: *70294552158400
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: commander
60
- requirement: &70151191990360 !ruby/object:Gem::Requirement
60
+ requirement: &70294552157820 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70151191990360
68
+ version_requirements: *70294552157820
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
- requirement: &70151191989900 !ruby/object:Gem::Requirement
71
+ requirement: &70294552157200 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70151191989900
79
+ version_requirements: *70294552157200
80
80
  description: A browser script to access lixian.vip.xunlei.com tasks automatically
81
81
  email:
82
82
  - afu@forresty.com
@@ -89,17 +89,18 @@ files:
89
89
  - .travis.yml
90
90
  - Gemfile
91
91
  - Gemfile.ci
92
- - Guardfile
93
92
  - README.md
94
93
  - Rakefile
95
94
  - bin/xunlei
96
95
  - lib/xunlei.rb
96
+ - lib/xunlei/configurator.rb
97
97
  - lib/xunlei/engine.rb
98
+ - lib/xunlei/helpers/cli_helper.rb
98
99
  - lib/xunlei/search.rb
99
100
  - lib/xunlei/version.rb
100
101
  - spec/spec_helper.rb
101
102
  - spec/xunlei/engine_spec.rb
102
- - spec/xunlei/search_spec.rb
103
+ - spec/xunlei/helpers/cli_helper_spec.rb
103
104
  - xunlei.gemspec
104
105
  homepage: ''
105
106
  licenses: []
@@ -115,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
116
  version: '0'
116
117
  segments:
117
118
  - 0
118
- hash: -893131726371942937
119
+ hash: 2673392163945726222
119
120
  required_rubygems_version: !ruby/object:Gem::Requirement
120
121
  none: false
121
122
  requirements:
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  version: '0'
125
126
  segments:
126
127
  - 0
127
- hash: -893131726371942937
128
+ hash: 2673392163945726222
128
129
  requirements: []
129
130
  rubyforge_project: xunlei
130
131
  rubygems_version: 1.8.11
@@ -134,4 +135,4 @@ summary: A browser script to access lixian.vip.xunlei.com tasks automatically
134
135
  test_files:
135
136
  - spec/spec_helper.rb
136
137
  - spec/xunlei/engine_spec.rb
137
- - spec/xunlei/search_spec.rb
138
+ - spec/xunlei/helpers/cli_helper_spec.rb
data/Guardfile DELETED
@@ -1,5 +0,0 @@
1
- guard 'rspec', :version => 2 do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
5
- end
@@ -1,16 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Xunlei::Search do
4
- before(:each) do
5
- $stdout.stub(:puts)
6
- end
7
-
8
- describe "Google" do
9
- it "should find some ed2k links" do
10
- search = Xunlei::Search.new
11
- links = search.google("Repulsion", "720p")
12
-
13
- links.should_not be_empty
14
- end
15
- end
16
- end