#26 ✓resolved
Stephen Bannasch

RedCloth::VERSION not working

Reported by Stephen Bannasch | July 27th, 2008 @ 08:40 PM

Versions 4 and 4.0.1 don't return a version number.

$ sudo gem update RedCloth
Updating installed gems
Updating RedCloth
Building native extensions.  This could take a while...
Successfully installed RedCloth-4.0.1
Gems updated: RedCloth
[dev]$ irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'redcloth'
=> true
irb(main):003:0> RedCloth::VERSION
=> RedCloth::VERSION

Version 3.0.4 does return a version number.

[dev]$ irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> gem 'RedCloth', '=3.0.4'
=> true
irb(main):004:0> require 'redcloth'
=> true
irb(main):005:0> RedCloth::VERSION
=> "3.0.4"

Comments and changes to this ticket

  • Jason Garber

    Jason Garber July 28th, 2008 @ 03:54 PM

    That's correct. It's now RedCloth::VERSION::STRING like many other ruby libraries.

    What may be misleading is you can type RedCloth::VERSION in the textile input to get the version.

    Any suggestions to make this work as you expect? I can't very well go back to RedCloth::VERSION being a string itself, unfortunately.

  • Stephen Bannasch

    Stephen Bannasch July 28th, 2008 @ 05:10 PM

    I'm including RedCloth v3.0.4 in an app because it is pure Ruby and when the app starts up if a newer RedCloth is installed using that instead. It seems to be a good (though small) thing to be able to use the same code to get the version number in different versions.

    I just looked through about 20 gems a majority of them do this:

    module MyGem
      VERSION = '0.63'

    The biggest gems however, Rails, RSpec use the form you are using now.

    This code looks like it would work both ways:

    module MyGem
      class VERSION #:nodoc:
        MAJOR = 4
        MINOR = 0
        TINY  = 3
        STRING = [MAJOR, MINOR, TINY].join('.')
        class << self
          def to_s
    puts MyGem::VERSION          # => 4.0.3
    puts MyGem::VERSION::STRING  # => 4.0.3
    puts MyGem::VERSION::MAJOR   # => 4
    puts MyGem::VERSION::MINOR   # => 0
    puts MyGem::VERSION::TINY    # => 3
  • Jason Garber

    Jason Garber July 29th, 2008 @ 10:24 AM

    • State changed from “new” to “resolved”

    (from [b098bdbaa3eefbc6060e36b95208ef9dc3391a63]) Added a RedCloth::VERSION.to_s and .== methods so you can puts and compare RedCloth::VERSION just like in previous RedCloth releases. [#26 state:resolved]


  • Stephen Bannasch

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

RedCloth is a Ruby library for converting Textile into HTML

Shared Ticket Bins

People watching this ticket