-
Notifications
You must be signed in to change notification settings - Fork 487
/
Rakefile
72 lines (57 loc) · 1.63 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
68
69
70
71
72
require "nenv"
require "bundler/gem_tasks"
require "tasks/releaser"
default_tasks = []
require "rspec/core/rake_task"
default_tasks << RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = Nenv.ci?
end
require "guard/rake_task"
unless defined?(JRUBY_VERSION)
Guard::RakeTask.new(:guard, "--plugin ronn")
end
require "cucumber/rake/task"
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
t.profile = Nenv.ci? ? 'guard' : 'travis'
end
default_tasks << Struct.new(:name).new(:features)
unless Nenv.ci?
require "rubocop/rake_task"
default_tasks << RuboCop::RakeTask.new(:rubocop)
end
task default: default_tasks.map(&:name)
# Coveralls:
#
# TODO: uncomment to merge results from RSpec and Cucumber
# require "coveralls/rake/task"
# Coveralls::RakeTask.new
# task :default => [:spec, :features, 'coveralls:push']
#
# TODO: for the above to work, also change Coveralls.wear_merged! instead of
# wear! in spec/spec_helper.rb
PROJECT_NAME = "Guard"
CURRENT_VERSION = Guard::VERSION
class GuardReleaser
def self.releaser
@releaser ||= Releaser.new(
project_name: PROJECT_NAME,
gem_name: "guard",
github_repo: "guard/guard",
version: CURRENT_VERSION
)
end
end
namespace :release do
desc "Push #{PROJECT_NAME} #{CURRENT_VERSION} to RubyGems and publish"\
" its GitHub release"
task full: ["release:gem", "release:github"]
desc "Push #{PROJECT_NAME} #{CURRENT_VERSION} to RubyGems"
task :gem do
GuardReleaser.releaser.rubygems
end
desc "Publish #{PROJECT_NAME} #{CURRENT_VERSION} GitHub release"
task :github do
GuardReleaser.releaser.github
end
end