forked from engineyard/engineyard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
37 lines (32 loc) · 1.12 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
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end
task :default => :spec
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'rake/rdoctask'
require File.expand_path("../lib/engineyard", __FILE__)
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "engineyard #{EY::VERSION}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.exclude('lib/vendor/**/*.rb')
end
desc "Bump version of this gem"
task :bump do
require 'engineyard'
version_file = "module EY\n VERSION = '_VERSION_GOES_HERE_'\nend\n"
new_version = if EY::VERSION =~ /\.pre$/
EY::VERSION.gsub(/\.pre$/, '')
else
digits = EY::VERSION.scan(/(\d+)/).map { |x| x.first.to_i }
digits[-1] += 1
digits.join('.') + ".pre"
end
puts "New version is #{new_version}"
File.open('lib/engineyard/version.rb', 'w') do |f|
f.write version_file.gsub(/_VERSION_GOES_HERE_/, new_version)
end
end