forked from erlehmann/logformat
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
26 lines (24 loc) · 638 Bytes
/
Rakefile
File metadata and controls
26 lines (24 loc) · 638 Bytes
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
namespace :db do
desc "Run migrations"
task :migrate, [:version] do |t, args|
require_relative 'lib/setup'
Sequel.extension :migration
db = Logformat::DB
migs = File.join(File.dirname(__FILE__),'migrations')
if args[:version]
puts "Migrating to version #{args[:version]}"
Sequel::Migrator.run(db, migs, target: args[:version].to_i)
else
puts "Migrating to latest"
Sequel::Migrator.run(db, migs)
end
end
end
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts='--pattern specs/*.rb'
end
rescue LoadError
end
task :default => :spec