/
Rakefile
42 lines (33 loc) · 974 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
# frozen_string_literal: true
require "rake"
require File.expand_path(File.dirname(__FILE__) + "/version.rb")
GEM = "sequel-seed"
VERSION = Sequel::Seed::VERSION
desc "Build the sequel-seed gem"
task :build do |p|
sh %{#{FileUtils::RUBY} -S gem build #{GEM}.gemspec}
end
desc "Release the sequel-seed gem to rubygems.org"
task release: :build do
sh %{#{FileUtils::RUBY} -S gem push ./#{GEM}-#{VERSION}.gem}
end
desc "Run the Rubocop code analyzer for the sequel-seed"
task :codeanalyzer do
sh %{#{FileUtils::RUBY} -S bundle exec rubocop}
end
desc "Run the specs for the sequel-seed"
task :test do
sh %{#{FileUtils::RUBY} -S bundle exec rspec}
end
namespace :db do
desc "Create the database"
task :create do
sh %{createdb sequel_seed_test}
end
desc "Destroy the database"
task :destroy do
sh %{dropdb sequel_seed_test}
end
end
task localtest: ["db:create", :codeanalyzer, :test, "db:destroy"]
task default: [:codeanalyzer, :build, :test]