From 4f4140e6f49936677b13e69abcabeeae000700e3 Mon Sep 17 00:00:00 2001 From: Josef Stribny Date: Wed, 6 Nov 2013 16:40:30 +0100 Subject: [PATCH 1/3] Fix: Show sdoc version rather than rdoc version --- bin/sdoc | 5 +++++ lib/sdoc.rb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/sdoc b/bin/sdoc index 78640fee..58789974 100755 --- a/bin/sdoc +++ b/bin/sdoc @@ -1,6 +1,11 @@ #!/usr/bin/env ruby -KU require 'sdoc' +if (ARGV[0] == '--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' From ee92316bb7d22fe9d2d794eb1928b9f73791c2da Mon Sep 17 00:00:00 2001 From: Josef Strzibny Date: Fri, 27 Dec 2013 17:54:24 +0100 Subject: [PATCH 2/3] Always accept --version as an argument --- bin/sdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sdoc b/bin/sdoc index 58789974..1cdbd854 100755 --- a/bin/sdoc +++ b/bin/sdoc @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -KU require 'sdoc' -if (ARGV[0] == '--version') +if ARGV.include?("--version") puts "sdoc #{SDoc::VERSION}" exit 0 end From f452daa010aa0d8e5f57b74cca1c3c4f272a9be1 Mon Sep 17 00:00:00 2001 From: Josef Strzibny Date: Fri, 27 Dec 2013 18:01:26 +0100 Subject: [PATCH 3/3] Keep just one source for version --- sdoc.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.}