Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 52 lines (47 sloc) 1.353 kb
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51
desc 'Build the standalone script'
task :build do
  manifest = %w(
lib/ghi.rb
lib/ghi/json.rb
lib/ghi/formatting/colors.rb
lib/ghi/formatting.rb
lib/ghi/authorization.rb
lib/ghi/client.rb
lib/ghi/editor.rb
lib/ghi/web.rb
lib/ghi/commands.rb
lib/ghi/commands/command.rb
lib/ghi/commands/assign.rb
lib/ghi/commands/close.rb
lib/ghi/commands/comment.rb
lib/ghi/commands/config.rb
lib/ghi/commands/edit.rb
lib/ghi/commands/help.rb
lib/ghi/commands/label.rb
lib/ghi/commands/list.rb
lib/ghi/commands/milestone.rb
lib/ghi/commands/open.rb
lib/ghi/commands/show.rb
lib/ghi/commands/version.rb
bin/ghi
)
  files = FileList[*manifest]
  File.open 'ghi', 'w' do |f|
    f.puts '#!/usr/bin/env ruby'
    f.puts '# encoding: utf-8'
    files.each { |file| f << File.read(file).gsub(/^\s+autoload.+$\n+/, '') }
    f.chmod 0755
  end
end

desc 'Build the manuals'
task :man do
  `ronn man/*.ronn --manual='GHI Manual' --organization='Stephen Celis'`
end

desc 'Install the standalone script'
task :install => [:build, :man] do
  prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'

  FileUtils.mkdir_p "#{prefix}/bin"
  FileUtils.cp 'ghi', "#{prefix}/bin"

  FileUtils.mkdir_p "#{prefix}/share/man/man1"
  FileUtils.cp Dir["man/*.1"], "#{prefix}/share/man/man1"
end
Something went wrong with that request. Please try again.