forked from cequel/orm_adapter-cequel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (57 loc) · 1.54 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
60
61
62
63
64
65
66
67
require "rspec/core/rake_task"
require 'rubocop/rake_task'
require File.expand_path('../lib/orm_adapter-cequel/version', __FILE__)
RSpec::Core::RakeTask.new(:spec)
task :default => :release
task :release => [
:rubocop,
:"test:concise",
:build,
:tag,
:update_stable,
:push,
:cleanup
]
desc 'Build gem'
task :build do
system 'gem build orm_adapter-cequel.gemspec'
end
desc 'Create git release tag'
task :tag do
system "git tag -a -m 'Version #{OrmAdapterCequel::VERSION}' #{OrmAdapterCequel::VERSION}"
system "git push origin #{OrmAdapterCequel::VERSION}:#{OrmAdapterCequel::VERSION}"
end
desc 'Update stable branch on GitHub'
task :update_stable do
if OrmAdapterCequel::VERSION =~ /^(\d+\.)+\d+$/ # Don't push for prerelease
system "git push -f origin HEAD:stable"
end
end
desc 'Push gem to repository'
task :push do
system "gem push orm_adapter-cequel-#{OrmAdapterCequel::VERSION}.gem"
end
task 'Remove packaged gems'
task :cleanup do
system "rm -v *.gem"
end
desc 'Check style with Rubocop'
RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = ['lib']
task.formatters = ['files']
task.fail_on_error = true
end
desc 'Run the specs'
RSpec::Core::RakeTask.new(:test) do |t|
t.pattern = './spec/examples/**/*_spec.rb'
t.rspec_opts = '-f d --fail-fast'
t.fail_on_error = true
end
namespace :test do
desc 'Run the specs with progress formatter'
RSpec::Core::RakeTask.new(:concise) do |t|
t.pattern = './spec/examples/**/*_spec.rb'
t.rspec_opts = '--fail-fast --format=progress'
t.fail_on_error = true
end
end