-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
38 lines (31 loc) · 821 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
#!/usr/bin/env ruby
# Thanks, fhsjaagshs!
s = eval(File.read(Dir.glob('*.gemspec').first))
app_name = s.name
gem_name = "#{s.name}-#{s.version}.gem"
desc 'Cleanup gem files'
task :clean do
`[ -f #{gem_name} ] && rm #{gem_name}`
end
desc 'Build gem'
task :build do
puts "Building '#{app_name}'..."
`gem build -q #{app_name}.gemspec`
end
desc 'Install gem'
task :install do
puts "Uninstalling currently installed '#{app_name}'..."
`gem uninstall -q --force #{gem_name}`
puts "Installing '#{app_name}'..."
`gem install -q --ignore-dependencies --local #{gem_name}`
end
desc 'Upload gem to rubyforge'
task :push do
Rake::Task['clean'].invoke
Rake::Task['build'].invoke
puts "Pushing '#{app_name}' to rubygems..."
exec("gem push #{gem_name}")
end
task :default do
Rake::Task['build'].invoke
end