-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
60 lines (53 loc) · 1.55 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'rake'
require 'spec/rake/spectask'
desc "Run all specs"
task :default => :spec
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*.rb']
end
desc "Run all specs and generate HTML report"
Spec::Rake::SpecTask.new('spec:html') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.spec_opts = ["--format", "html:spec.html"]
end
desc "Run all specs and dump the result to README"
Spec::Rake::SpecTask.new('spec:readme') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.spec_opts = ["--format", "specdoc:README"]
end
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = 'imdb'
s.summary = 'Internet Movie DataBase'
s.authors = [ 'Sergio Gil' ]
s.email = '[email protected]'
s.add_dependency('hpricot', '>= 0.6')
s.add_dependency('chronic')
s.files = [
"lib/imdb/imdb_movie.rb",
"lib/imdb/imdb_search.rb",
"lib/imdb.rb",
"lib/string_extensions.rb",
"README"
]
end
rescue
end
namespace :spec do
desc "Update page samples"
task :update_samples do
require 'open-uri'
{
"sample_movie" => "http://www.imdb.com/title/tt0097576/",
"sample_search" => "http://www.imdb.com/find?q=indiana+jones",
"sample_incomplete_movie" => "http://www.imdb.com/title/tt0054961/",
"sample_spanish_search" => "http://www.imdb.com/find?q=torrente"
}.each do |file_name, url|
File.open(File.join(File.dirname(__FILE__), 'spec', 'samples', file_name + '.html'), 'w') do |f|
f.write open(url).read
end
end
end
end