Sha256: 2282aeee152494189c0aa659e8db983a4d00d486c6390e9074633e27d2496aea

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

#!/usr/bin/env rake
# -*- Ruby -*-
#
# For the `release` task
#
require 'bundler/gem_tasks'

require 'rake/testtask'
require 'fileutils'

ROOT_DIR = File.dirname(__FILE__)
require File.join %W(#{ROOT_DIR} lib linecache2)

Gemspec_path = 'linecache2.gemspec'
def gemspec
  @gemspec ||= eval(File.read(Gemspec_path), binding,
                    'lineche2.gemspec')
end

require 'rubygems/package_task'
desc "Build the gem"
task :package=>:gem
task :gem=>:gemspec do
  Dir.chdir(ROOT_DIR) do
    sh "gem build #{Gemspec_path}"
    FileUtils.mkdir_p 'pkg'
    FileUtils.mv("#{gemspec.file_name}", "pkg/")
  end
end

desc "Install the gem locally"
task :install => :gem do
  Dir.chdir(ROOT_DIR) do
    sh %{gem install --local pkg/#{gemspec.file_name}}
  end
end

desc "Test everything"
Rake::TestTask.new(:test) do |t|
  t.libs << './lib'
  t.pattern = 'test/test-*.rb'
  t.options = '--verbose' if $VERBOSE
end
task :test => :lib

desc "same as test"
task :check => :test

desc "Create a GNU-style ChangeLog via svn2cl"
task :ChangeLog do
  system('git log --pretty --numstat --summary | git2cl > ChangeLog')
end

task :default => [:test]

desc "Remove built files"
task :clean => [:clobber_package, :clobber_rdoc]

desc "Generate the gemspec"
task :generate do
  puts gemspec.to_ruby
end

desc "Validate the gemspec"
task :gemspec do
  gemspec.validate
end

# ---------  RDoc Documentation ------
require 'rdoc/task'
desc "Generate rdoc documentation"
Rake::RDocTask.new("rdoc") do |rdoc|
  rdoc.rdoc_dir = 'doc'
  rdoc.title    = "LineCache #{LineCache::VERSION} Documentation"

  # Show source inline with line numbers
  rdoc.options += %w(--inline-source --line-numbers)

  # Make the README file the start page for the generated html
  rdoc.options += %w(--main README)

  rdoc.rdoc_files.include('lib/*.rb', 'README', 'COPYING')
end
desc "Same as rdoc"
task :doc => :rdoc

task :clobber_package do
  FileUtils.rm_rf File.join(ROOT_DIR, 'pkg')
end

task :clobber_rdoc do
  FileUtils.rm_rf File.join(ROOT_DIR, 'doc')
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linecache2-1.4.0 Rakefile