Skip to content

Commit

Permalink
Use YARD
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Feb 3, 2012
1 parent 31bd0f4 commit e82a0cf
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions Rakefile
Expand Up @@ -2,7 +2,6 @@ require 'rubygems'
require 'rubygems/package_task'
require 'bundler'
require 'rake/testtask'
require 'rdoc/task'

$:.unshift(File.dirname(__FILE__) + '/lib')
require 'tabs_on_rails/version'
Expand All @@ -15,11 +14,6 @@ PKG_VERSION = ENV['PKG_VERSION'] || TabsOnRails::VERSION
# Run test by default.
task :default => :test

# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
# http://rubygems.org/read/chapter/20
#
spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
Expand All @@ -30,19 +24,15 @@ spec = Gem::Specification.new do |s|
s.email = "weppos@weppos.net"
s.homepage = "http://www.simonecarletti.com/code/tabs_on_rails"

# You should probably have a README of some kind. Change the filename
# as appropriate
s.extra_rdoc_files = Dir.glob("*.rdoc")
s.rdoc_options = %w(--main README.rdoc)

# Add any extra files to include in the gem (like your README)
s.files = %w( Rakefile LICENSE init.rb .gemtest ) + Dir.glob("*.{rdoc,gemspec}") + Dir.glob("{lib,test,rails}/**/*")
s.require_paths = %w( lib )

s.add_development_dependency("bundler")
s.add_development_dependency("hanna-nouveau")
s.add_development_dependency("rails", "~> 3.0.6")
s.add_development_dependency("mocha", "~> 0.9.10")
s.add_development_dependency "rake"
s.add_development_dependency "bundler"
s.add_development_dependency "rails", "~> 3.0.6"
s.add_development_dependency "mocha", "~> 0.9.10"
s.add_development_dependency "yard"
end

# This task actually builds the gem. We also regenerate a static
Expand Down Expand Up @@ -78,17 +68,19 @@ Rake::TestTask.new do |t|
t.verbose = true
end

# Generate documentation
RDoc::Task.new do |rdoc|
rdoc.main = "README.rdoc"
rdoc.rdoc_files.include("*.rdoc", "lib/**/*.rb")
rdoc.rdoc_dir = "rdoc"
rdoc.generator = 'hanna'
end

require 'yard'
require 'yard/rake/yardoc_task'

desc "Publish documentation to the site"
task :publish_rdoc => [:clobber_rdoc, :rdoc] do
ENV["username"] || raise(ArgumentError, "Missing ssh username")
sh "rsync -avz --delete rdoc/ #{ENV["username"]}@code:/var/www/apps/code/#{PKG_NAME}/api"
YARD::Rake::YardocTask.new(:yardoc) do |y|
y.options = ["--output-dir", "yardoc"]
end

namespace :yardoc do
desc "Remove YARD products"
task :clobber do
rm_r "yardoc" rescue nil
end
end

task :clobber => "yardoc:clobber"

0 comments on commit e82a0cf

Please sign in to comment.