File: Rakefile

package info (click to toggle)
mhc 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,424 kB
  • sloc: ruby: 12,718; lisp: 7,570; makefile: 70; sh: 68
file content (32 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (4)
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.exists?(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