-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
44 lines (33 loc) · 886 Bytes
/
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
require 'rake/testtask'
task :default => [:test]
Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/*_test.rb']
end
namespace :tagbetter do
desc "Install gem dependencies"
task :gems do
gem_deps = %w{couchrest json rest-client sinatra nokogiri}
sh "gem install --no-ri --no-rdoc #{gem_deps.join(' ')}"
end
end
begin
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
require 'tag_better'
namespace :couchdb do
desc "Create the database"
task :create do
TagBetter.server.create_db('tagbetter')
end
desc "Drop the database"
task :drop do
if ENV['SRSLY']
TagBetter.database.delete!
else
puts "Do you SRSLY want to drop the database?"
end
end
end
rescue LoadError => e
puts "Missing dependencies. `rake tagbetter:gems` to install them."
end