-
Notifications
You must be signed in to change notification settings - Fork 12
/
Rakefile
32 lines (26 loc) · 853 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
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
require 'rdoc/task'
Rake::RDocTask.new do |rd|
rd.rdoc_dir = 'rdocs'
rd.rdoc_files = FileList["lib/**/*.rb"]
rd.options << '-charset=UTF-8'
end
task :release => :check_version
task :build => :check_version
# Emacs stuffs must have the same version numbers
# with Mhc::VERSION.
task :check_version do
for file in %w(mhc.el mhc-vars.el Cask)
path = File.expand_path("../emacs/#{file}", __FILE__)
raise "File not found #{path}" unless File.exist?(path)
content = File.open(path).read
unless (/^;; Version: (\d+\.\d+\.\d+)$/ =~ content ||
/(\d+\.\d+\.\d+).*MHC_VERSION$/ =~ content) &&
Mhc::VERSION == $1
raise "#{path} does not have valid version number (#{$1})."
end
end
end