-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
33 lines (27 loc) · 855 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
# Rakefile for creating a gem file locally and for publishing this gem itself
require 'rake'
require 'rake/tasklib'
require 'bundler/gem_tasks'
require 'rubygems/package_task'
include Rake::DSL if defined? Rake::DSL
class Package < ::Rake::TaskLib
desc 'Build the gem file'
task :build do
Dir.chdir(Rake.application.original_dir)
CLEAN.include('pkg/*')
filename = Dir.glob('*.gemspec')
raise! 'No gemspec found, pack:gem aborted!' if filename.nil? || filename.empty?
gemspec = Kernel.eval(File.read(filename.first))
Gem::PackageTask.new(gemspec) do |t|
t.name = gemspec.name
t.version = gemspec.version
t.package_dir = 'pkg'
t.package_files = gemspec.files
end
Rake::Task['build'].invoke
end
desc 'Build and install'
task :install do
Rake::Task['install:local'].invoke
end
end