forked from AaronH/RubyHue
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRakefile
45 lines (37 loc) · 856 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
43
44
45
require 'rake'
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec') do |t|
t.rspec_opts = ["-fd", "-c"]
t.ruby_opts = ["-Ispec,lib"]
t.pattern = 'spec/**/*_spec.rb'
end
rescue LoadError
desc 'Spec rake task not available'
task :spec do
abort 'Spec rake task is not available. Be sure to install rspec as a gem or plugin'
end
end
namespace :gem do
desc 'Build the gem'
task :build do
`mkdir -p pkg`
`gem build hue-lib.gemspec`
`mv *.gem pkg/`
end
desc 'Publish the gem'
task :publish do
gem = `ls pkg | sort | tail -n 1`
exec("gem push pkg/#{gem}")
end
desc 'Install the gem locally'
task :install do
gem = `ls pkg`.split.sort
`gem install pkg/#{gem.last}`
end
end
desc 'Remove generated files'
task :clean do
`rm -rf pkg`
end
task :default => [:spec]