Permalink
Browse files

release 0.1.10 -- provide Hanna::VERSION string

  • Loading branch information...
1 parent 79348d7 commit 028f2dde354bf3ed62c5b0644da6350f871a9b84 @mislav committed Sep 17, 2009
Showing with 28 additions and 35 deletions.
  1. +2 −2 Rakefile
  2. +1 −1 bin/hanna
  3. +2 −2 hanna.gemspec
  4. +0 −21 lib/hanna/rdoc_version.rb
  5. +1 −1 lib/hanna/rdoctask.rb
  6. +19 −0 lib/hanna/version.rb
  7. +3 −8 lib/rubygems_plugin.rb
View
@@ -1,10 +1,10 @@
desc "generates .gemspec file"
task :gemspec do
- require 'lib/hanna/rdoc_version'
+ require 'lib/hanna/version'
spec = Gem::Specification.new do |gem|
gem.name = 'hanna'
- gem.version = '0.1.9'
+ gem.version = Hanna::VERSION
gem.summary = "An RDoc template that scales"
gem.description = "Hanna is an RDoc implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind."
View
@@ -35,7 +35,7 @@ end
$:.unshift(hanna_dir) unless $:.include?(hanna_dir)
require 'rubygems'
-require 'hanna/rdoc_version'
+require 'hanna/version'
Hanna::require_rdoc
require 'rdoc/rdoc'
View
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{hanna}
- s.version = "0.1.9"
+ s.version = "0.1.10"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Mislav Marohni\304\207"]
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.description = %q{Hanna is an RDoc implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind.}
s.email = %q{mislav.marohnic@gmail.com}
s.executables = ["hanna"]
- s.files = ["Rakefile", "bin/hanna", "lib/hanna/hanna.rb", "lib/hanna/rdoc_version.rb", "lib/hanna/rdoctask.rb", "lib/hanna/template_files/class_index.haml", "lib/hanna/template_files/file_index.haml", "lib/hanna/template_files/index.haml", "lib/hanna/template_files/layout.haml", "lib/hanna/template_files/method_index.haml", "lib/hanna/template_files/method_list.haml", "lib/hanna/template_files/method_search.js", "lib/hanna/template_files/page.haml", "lib/hanna/template_files/prototype-1.6.0.3.js", "lib/hanna/template_files/sections.haml", "lib/hanna/template_files/styles.sass", "lib/hanna/template_helpers.rb", "lib/hanna/template_page_patch.rb", "lib/hanna.rb", "lib/rubygems_plugin.rb", "README.markdown"]
+ s.files = ["Rakefile", "bin/hanna", "lib/hanna/hanna.rb", "lib/hanna/rdoctask.rb", "lib/hanna/template_files/class_index.haml", "lib/hanna/template_files/file_index.haml", "lib/hanna/template_files/index.haml", "lib/hanna/template_files/layout.haml", "lib/hanna/template_files/method_index.haml", "lib/hanna/template_files/method_list.haml", "lib/hanna/template_files/method_search.js", "lib/hanna/template_files/page.haml", "lib/hanna/template_files/prototype-1.6.0.3.js", "lib/hanna/template_files/sections.haml", "lib/hanna/template_files/styles.sass", "lib/hanna/template_helpers.rb", "lib/hanna/template_page_patch.rb", "lib/hanna/version.rb", "lib/hanna.rb", "lib/rubygems_plugin.rb", "README.markdown"]
s.homepage = %q{http://github.com/mislav/hanna}
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.5}
View
@@ -1,21 +0,0 @@
-module Hanna
- #
- # The version of RDoc that Hanna should use.
- #
- RDOC_VERSION = '2.3.0'
- RDOC_VERSION_REQUIREMENT = "~> #{RDOC_VERSION}"
-
- #
- # This method loads the correct version of RDoc. If the correct
- # version of RDoc is not present, this method will terminate the
- # program with a helpful error message.
- #
- def self.require_rdoc
- begin
- gem 'rdoc', RDOC_VERSION_REQUIREMENT
- rescue Gem::LoadError
- $stderr.puts "Error: hanna requires the RDoc #{RDOC_VERSION} gem!"
- exit 1
- end
- end
-end
View
@@ -1,4 +1,4 @@
-require 'hanna/rdoc_version'
+require 'hanna/version'
require 'rake'
require 'rake/rdoctask'
View
@@ -0,0 +1,19 @@
+module Hanna
+
+ VERSION = '0.1.10'
+
+ # The version of RDoc that Hanna should use
+ RDOC_VERSION = '2.3.0'
+ RDOC_VERSION_REQUIREMENT = "~> #{RDOC_VERSION}"
+
+ # Load the correct version of RDoc
+ def self.require_rdoc(terminate = true)
+ begin
+ gem 'rdoc', RDOC_VERSION_REQUIREMENT
+ rescue Gem::LoadError
+ $stderr.puts "Hanna requires the RDoc #{RDOC_VERSION} gem"
+ exit 1 if terminate
+ end
+ end
+
+end
View
@@ -1,23 +1,18 @@
unless defined?(Hanna) or defined?(RDoc)
require 'rubygems/doc_manager'
require 'rubygems/requirement'
- require 'hanna/rdoc_version'
+ require 'hanna/version'
class << Gem::DocManager
alias load_rdoc_without_version_constraint load_rdoc
# overwrite load_rdoc to load the exact version of RDoc that Hanna works with
def load_rdoc
- requirement = Gem::Requirement.create Hanna::RDOC_VERSION_REQUIREMENT
-
- begin
- gem 'rdoc', requirement.to_s
- rescue Gem::LoadError
- # ignore
- end
+ Hanna::require_rdoc(false) # don't terminate if failed
# call the original method
load_rdoc_without_version_constraint
+ requirement = Gem::Requirement.create Hanna::RDOC_VERSION_REQUIREMENT
unless requirement.satisfied_by? rdoc_version
raise Gem::DocumentError, "ERROR: RDoc version #{requirement} not installed"

0 comments on commit 028f2dd

Please sign in to comment.