Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 96 lines (80 sloc) 2.459 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
require 'rake'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'grancher/task'
require 'fileutils'
include FileUtils

NAME = "hobix"
VERS = "0.6"
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
RDOC_OPTS = [ '--quiet', '--title', "The Book of Hobix",
              # "--template", "extras/flipbook_rdoc.rb",
              "--opname", "index.html",
              "--line-numbers",
              "--main", "README",
              "--inline-source" ]

desc "Packages up Hobix."
task :default => [:package]
task :package => [:clean]

task :doc => [:rdoc, :after_doc]

Rake::RDocTask.new do |rdoc|
  rdoc.rdoc_dir = 'doc/rdoc'
  rdoc.options += RDOC_OPTS
  # rdoc.template = "extras/flipbook_rdoc.rb"
  rdoc.main = "README"
  rdoc.title = "The Book of Hobix"
  rdoc.rdoc_files.add ['README', 'doc/CHANGELOG', 'COPYING', 'lib/hobix.rb', 'lib/hobix/*.rb']
end

task :after_doc do
  # cp "extras/Camping.gif", "doc/rdoc/"
  # cp "extras/permalink.gif", "doc/rdoc/"
  sh %{scp -r doc/rdoc/* #{ENV['USER']}@rubyforge.org:/var/www/gforge-projects/hobix/}
end

spec =
Gem::Specification.new do |s|
  s.name = NAME
  s.version = VERS
  s.platform = Gem::Platform::RUBY
  s.has_rdoc = true
  s.extra_rdoc_files = ["README", "doc/CHANGELOG", "COPYING"]
  s.rdoc_options += RDOC_OPTS + ['--exclude', '^(contrib)\/']
  s.summary = "the white pantsuit of weblahhing"
  s.description = s.summary
  s.author = "why the lucky stiff"
  s.email = 'why@ruby-lang.org'
  s.homepage = 'http://hobix.com'
  s.executables = ['hobix']

  s.add_dependency('RedCloth')
  s.required_ruby_version = '>= 1.8.2'

  s.files = %w(COPYING README Rakefile git_hobix_update.php) +
  Dir.glob("{bin,doc,test,share,lib,contrib}/**/*") +
  Dir.glob("ext/**/*.{h,c,rb}") +
  Dir.glob("examples/**/*.rb")

  s.require_path = "lib"
  # s.extensions = FileList["ext/**/extconf.rb"].to_a
  s.bindir = "bin"
end

Rake::GemPackageTask.new(spec) do |p|
  p.need_tar = true
  p.need_zip = true
  p.gem_spec = spec
end

task :install do
  sh %{rake gem}
  sh %{gem install pkg/#{NAME}-#{VERS}}
end

task :uninstall => [:clean] do
  sh %{gem uninstall #{NAME}}
end

Grancher::Task.new do |g|
  g.branch = 'gh-pages'
  g.push_to = 'origin'
  g.message = 'Updated website' # defaults to 'Updated files.'

  # Put the website-directory in the root
  g.directory 'school/htdocs'

  # doc -> doc
  g.directory 'doc', 'doc'

  # README -> README
  g.file 'README', 'README.txt'
end
Something went wrong with that request. Please try again.