This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
66 lines (52 loc) · 1.58 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
require 'rubygems'
require 'rake/clean'
require 'rake/gempackagetask'
require 'date'
CLEAN.include("pkg")
CLEAN.include("doc")
GEMSPEC = Gem::Specification.new do |gem|
gem.name = "capistrano_winrm"
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 = "[email protected]"
gem.homepage = "http://github.com/zenchild/capistrano_winrm"
gem.summary = 'WinRM extensions for Capistrano'
gem.description = <<-EOF
WinRM extensions for Capistrano
EOF
gem.files = %w{ lib/capistrano_winrm.rb lib/capistrano_winrm/command.rb lib/capistrano_winrm/configuration/connections.rb lib/winrm_connection.rb }
gem.require_path = "lib"
gem.rdoc_options = %w(-x test/ -x examples/)
gem.extra_rdoc_files = %w(README)
gem.required_ruby_version = '>= 1.8.7'
gem.add_runtime_dependency 'capistrano'
gem.add_runtime_dependency 'winrm', '>=0.0.4'
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
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