diff --git a/bin/sdoc b/bin/sdoc index 78640fee..1cdbd854 100755 --- a/bin/sdoc +++ b/bin/sdoc @@ -1,6 +1,11 @@ #!/usr/bin/env ruby -KU require 'sdoc' +if ARGV.include?("--version") + puts "sdoc #{SDoc::VERSION}" + exit 0 +end + begin ARGV.push('--format=sdoc') if ARGV.grep(/\A(-f|--fmt|--format|-r|-R|--ri|--ri-site)\b/).empty? r = RDoc::RDoc.new diff --git a/lib/sdoc.rb b/lib/sdoc.rb index 8aef0116..eeefa23c 100644 --- a/lib/sdoc.rb +++ b/lib/sdoc.rb @@ -2,6 +2,8 @@ require "rubygems" gem 'rdoc' -module SDoc end +module SDoc + VERSION = '0.4.0.rc.1' +end require 'sdoc/generator' diff --git a/sdoc.gemspec b/sdoc.gemspec index 9664e702..bae88101 100644 --- a/sdoc.gemspec +++ b/sdoc.gemspec @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- +require_relative 'lib/sdoc.rb' Gem::Specification.new do |s| s.name = "sdoc" - s.version = "0.4.0.rc.1" + s.version = SDoc::VERSION s.authors = ["Vladimir Kolesnikov", "Nathan Broadbent", "Jean Mertz", "Zachary Scott"] s.description = %q{rdoc generator html with javascript search index.}