Burke

Synopsis

Burke provides a bunch of helpers to make creating Rake files a little more pleasant. There are many subjective elements to this project, particularly when it comes to sensible defaults, but popular Ruby conventions are adhered to where possible. The project is named after Don Burke, host of an Australian gardening and home improvement show named Burke’s Backyard (www.burkesbackyard.com.au).

Features

  • DRY definition of Gem packages for multiple platforms

  • Recovery from missing libraries like Yard and RSpec

Example

Here is a sample Rakefile using Burke.

require 'rubygems'
require 'burke'
require 'fileutils'

# Enable all tasks possible
Burke.enable_all

# Give Burke some data about the project
Burke.setup do |s|
  s.name = 'foo'
  s.version = '1.2.3'
  s.summary = 'an example Ruby library with extra foo'
  s.files = FileList['lib/**/*.rb']

  s.docs do |d|
    d.readme = 'README'
    d.markup = 'rdoc'
  end

  s.gems do |g|
    g.platform 'ruby'

    g.platform 'x86-linux' do |p|
      p.before do |s|
        FileUtils.copy 'native/libfoo-x86-linux.so', 'lib/libfoo.so'
        s.add_dependency 'ffi'
        s.files += ['lib/libfoo.so']
      end

      p.after do
        FileUtils.remove 'lib/libfoo.so'
      end
    end
  end
end

Default attributes

  • version inferred from contents of ‘VERSION’ file

  • files all files in ‘lib’ and ‘spec’ plus detected ‘README’, ‘VERSION’, ‘LICENSE’, ‘COPYING’ and/or ‘Rakefile’

  • docs.readme inferred from files matching ‘README?’, case ignored

  • docs.markup inferred from extension of detected README file

  • rspec.spec_files ‘spec/*/_spec.rb’

  • rspec.color true