forked from abruehl/environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
40 lines (30 loc) · 1022 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
# frozen_string_literal: true
require 'rubygems'
require 'rake'
namespace 'bundler' do
require 'bundler/gem_tasks'
end
# A subclass of Bundler::GemHelper that allows us to push to Gemfury
# instead of rubygems.org.
class GemfuryGemHelper < Bundler::GemHelper
def release_gem(built_gem_path=nil)
guard_clean
built_gem_path ||= build_gem
tag_version { git_push } unless already_tagged?
gemfury_push(built_gem_path) if gem_push?
end
protected
def gemfury_push(path)
sh("fury push --as=reverbnation '#{path}'")
Bundler.ui.confirm "Pushed #{name} #{version} to gemfury.com."
end
end
spec = Bundler::GemHelper.gemspec
desc "Build #{spec.name}-#{spec.version}.gem into the pkg directory."
task build: 'bundler:build'
task default: :build
desc "Create tag v#{spec.version} and build and push #{spec.name}-#{spec.version}.gem to Gemfury"
task release: 'bundler:build' do
GemfuryGemHelper.new.release_gem
end
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }