forked from RubyOpenSource/zenoss_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
79 lines (63 loc) · 1.94 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
require 'rubygems'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/testtask'
CLEAN.include("pkg")
CLEAN.include("doc")
GEMSPEC = Gem::Specification.new do |gem|
gem.name = "zenoss_client"
gem.version = File.open('VERSION').readline.chomp
gem.date = Date.today.to_s
gem.platform = Gem::Platform::RUBY
gem.rubyforge_project = nil
gem.author = "Dan Wanek"
gem.email = "dan.wanek@gmail.com"
gem.homepage = "http://github.com/zenchild/zenoss_client"
gem.summary = "A Ruby API for accessing Zenoss via REST"
gem.description = <<-EOF
This is a Ruby library for accessing Zenoss through its REST interface. It is a work in progress and as functionality is testing
it will be added. For documentation on what the method calls do see the official Zenoss API docs.
EOF
gem.files = `git ls-files`.split(/\n/)
gem.require_path = "lib"
gem.rdoc_options = %w(-x wsdl/ -x test/ -x examples/)
gem.extra_rdoc_files = %w(README.rdoc COPYING.txt)
gem.required_ruby_version = '>= 1.8.7'
gem.add_runtime_dependency 'tzinfo'
gem.post_install_message = "See README.rdoc"
end
Rake::GemPackageTask.new(GEMSPEC) do |pkg|
pkg.need_tar = true
end
task :default => [:buildgem]
desc "Build the gem without a version change"
task :buildgem => [:clean, :repackage]
desc "Build the gem, but increment the version first"
task :newrelease => [:versionup, :clean, :repackage]
desc "Increment the version by 1 minor release"
task :versionup do
ver = up_min_version
puts "New version: #{ver}"
end
Rake::RDocTask.new do |rd|
rd.main = 'README.rdoc'
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
end
def up_min_version
f = File.open('VERSION', 'r+')
ver = f.readline.chomp
v_arr = ver.split(/\./).map do |v|
v.to_i
end
v_arr[2] += 1
ver = v_arr.join('.')
f.rewind
f.write(ver)
ver
end
Rake::TestTask.new do |t|
t.libs.push "lib"
t.test_files = FileList['test/*_test.rb']
t.verbose = true
end