Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
release 0.1.10 -- provide Hanna::VERSION string
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Sep 17, 2009
1 parent 79348d7 commit 028f2dd
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Rakefile
@@ -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."
Expand Down
2 changes: 1 addition & 1 deletion bin/hanna
Expand Up @@ -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'

Expand Down
4 changes: 2 additions & 2 deletions hanna.gemspec
Expand Up @@ -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"]
Expand All @@ -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}
Expand Down
21 changes: 0 additions & 21 deletions lib/hanna/rdoc_version.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/hanna/rdoctask.rb
@@ -1,4 +1,4 @@
require 'hanna/rdoc_version'
require 'hanna/version'
require 'rake'
require 'rake/rdoctask'

Expand Down
19 changes: 19 additions & 0 deletions lib/hanna/version.rb
@@ -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
11 changes: 3 additions & 8 deletions lib/rubygems_plugin.rb
@@ -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"
Expand Down

0 comments on commit 028f2dd

Please sign in to comment.