-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile
42 lines (34 loc) · 1012 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
require 'rake/gempackagetask'
GEM_NAME = "rfetch"
GEM_VERSION = "0.2.0"
### GEM ###################################################
spec = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = GEM_VERSION
s.author = "Kevin russ"
s.email = "[email protected]"
s.platform = Gem::Platform::RUBY
s.summary = "Manage project-sets for different repositories"
s.files = FileList["{bin,tests,lib,docs}/**/*"].exclude("rdoc").to_a
s.require_path = "lib"
s.has_rdoc = false
s.extra_rdoc_files = ["README"]
s.executables = [GEM_NAME]
end
Rake::GemPackageTask.new(spec) {|pkg|}
desc "Install the gem"
task :install => [:gem] do
run_cmd("gem install pkg/#{spec.name}-#{spec.version}.gem")
end
desc "Uninstall the gem"
task :uninstall do
run_cmd("gem uninstall #{spec.name}")
end
### TOOLS #################################################
def run_cmd(cmd)
if !sh(cmd) then
puts "unable to run: "+cmd
exit(-1)
end
end
###########################################################