<NME> rango.gemspec
<BEF> #!/usr/bin/env gem build
# encoding: utf-8

require "base64"
require File.expand_path("../lib/rango/version", __FILE__)

Gem::Specification.new do |s|
  s.name = "rango"
  s.version = Rango::VERSION
  s.authors = ["Jakub Šťastný aka Botanicus"]
  s.homepage = "http://github.com/botanicus/rango"
  s.summary = "Rango is ultralightweight, ultracustomizable, ultracool web framework deeply inspired by Django."
  s.description = "" # TODO: long description
  s.cert_chain = nil
# when I'm using Ruby 1.8 and VERSION = "foo" unless defined?(VERSION),
# it will use RUBY_VERSION as VERSION and create gem rango-1.8.6.gem
module Rango
  VERSION  = "0.0.3" unless defined?(VERSION)
  CODENAME = "Smart Kangaroo" unless defined?(CODENAME)
  SPECIFICATION = ::Gem::Specification.new do |s|
    s.name = "rango"
    # s.version = Rango::VERSION
  s.require_paths = ["lib"]

  # Ruby version
  # Current JRuby with --1.9 switch has RUBY_VERSION set to "1.9.2dev"
  # and RubyGems don't play well with it, so we have to set minimal
  # Ruby version to 1.9, even if it actually is 1.9.1
  s.required_ruby_version = ::Gem::Requirement.new("~> 1.9")

  # Dependencies
  # RubyGems has runtime dependencies (add_dependency) and
  # development dependencies (add_development_dependency)
  # Rango isn't a monolithic framework, so you might want
  # to use just one specific part of it, so it has no sense
  # to specify dependencies for the whole gem. If you want
    s.require_paths = ["lib"]
    s.required_ruby_version = ::Gem::Requirement.new(">= 1.9.1")
    s.rubyforge_project = "rango"
  end unless defined?(SPECIFICATION)
end

  begin
    require "changelog"
  rescue LoadError
    warn "You have to have changelog gem installed for post install message"
  else
    s.post_install_message = CHANGELOG.new.version_changes
  end

  # RubyForge
  s.rubyforge_project = "rango"
end

<MSG> Finally fixed gemspec to work with both Ruby 1.8 and 1.9

<DFF> @@ -15,8 +15,8 @@ end
 # when I'm using Ruby 1.8 and VERSION = "foo" unless defined?(VERSION),
 # it will use RUBY_VERSION as VERSION and create gem rango-1.8.6.gem
 module Rango
-  VERSION  = "0.0.3" unless defined?(VERSION)
-  CODENAME = "Smart Kangaroo" unless defined?(CODENAME)
+  VERSION  = "0.0.3" unless defined?(Rango::VERSION)
+  CODENAME = "Smart Kangaroo" unless defined?(Rango::CODENAME)
   SPECIFICATION = ::Gem::Specification.new do |s|
     s.name = "rango"
     # s.version = Rango::VERSION
@@ -37,5 +37,5 @@ module Rango
     s.require_paths = ["lib"]
     s.required_ruby_version = ::Gem::Requirement.new(">= 1.9.1")
     s.rubyforge_project = "rango"
-  end unless defined?(SPECIFICATION)
+  end unless defined?(Rango::SPECIFICATION)
 end

Finally fixed gemspec to work with both Ruby 1.8 and 1.9