Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix RbConfig / Config warning in Ruby 1.9.3. #11

Merged
merged 1 commit into from
@purcell

"Config" is deprecated in Ruby 1.9.3, in favor of "RbConfig". This
patch uses whichever is available, preventing Ruby 1.9.3 from printing
a deprecation warning when redcloth is loaded.

This patch is similar to #10, but retains backwards compatibility with Ruby 1.9.2.

@purcell purcell Fix RbConfig / Config warning in Ruby 1.9.3.
"Config" is deprecated in Ruby 1.9.3, in favor of "RbConfig". This
patch uses whichever is available, preventing Ruby 1.9.3 from printing
a deprecation warning when redcloth is loaded.
3f58b37
@thibaudgg

+1 :)

@unclaimedbaggage

Yep, +1. My bad, thought RbConfig was older than it is.

@unclaimedbaggage unclaimedbaggage referenced this pull request
Closed

1.9.3/config update #10

@bgetting

+1

@ghost Unknown referenced this pull request
Closed

Use 'Rbconfig' on 1.9 #12

@ghost

RbConfig is present since 1.9.1, as far as I can tell, but not present on 1.8.

@purcell

Yeah, I guess just the deprecation warning is new to 1.9.3.

@trans

Is there any reason this hasn't been pulled yet?

@eagleas

@jgarber update gem, please! :)

@rasmusrn

+1 Looking forward to a version bump :)

@meduza

+1

@deepj

+1

@skyeagle

It looks like gem needs new maintainer :) No response at all, amazing :)

@jgarber
Owner

Hi folks! :) I've been working 12 hours a day, no weekend, for the last two weeks on a site that needed to be up in advance of a nationally-televised event on Dec 1. It launched the day before Thanksgiving, then proceeded to go down around noon on Thanksgiving day while I was driving to relatives' house. Fun times. :-)

I'll be the first to admit, I've been a poor maintainer of RedCloth. It's gotten un-maintainable because Ragel is obscure and the parsing rules are complex. Nobody submits patches to the actual parsing code. Thus, I'm the bottleneck.

I want to change that with a "total rewrite":https://github.com/jgarber/redcloth-parslet in Parslet, but that takes time, which is difficult to make when there are long-time clients making requests. I'm going to Philly.rb hack nights to try and have a dedicated space to work on it. I'd love to have some collaborators!

Well, that came off a lot more defensive than I meant it to be! Here are a few more smileys to let you know I'm not a bad guy, just over-worked and under-rested. :-) :-) :-) :-)

I'll try to inspect the patch, test it on various Ruby versions and platforms, and push a version while my wife's getting ready to go this morning. Worst case, it will be sometime this weekend. I just want to do my due diligence so I don't have the back-and-forth flipping of a compiler flag that occurred with RedCloth on 1.9.2. I just merged the pull requests as they came, which resulted in several versions of "turn it on," "turn it off," "turn it on"...

Thanks! And seriously, collaborators are most welcome!

@jgarber jgarber merged commit 3242fde into jgarber:master
@jgarber
Owner

Trying to release... Got a new MacBook Air since the last release of RedCloth, so I have to rebuild my cross-compile tool chain...

@jgarber
Owner

Okay, I released RedCloth 4.2.9!

Never could get my cross-compile toolchain set up on Lion, so after several hours of trying, I went back to my old MacBook, which of course had somehow rotted w/r/t JRuby. Anyway, I got MRI and JRuby compiled on one computer and the Windows binaries on another, separately pushed to RubyGems.org for a complete release. Can't go on this way much longer! I really need to get the rewrite done, but it's sooo much code...the Textile spec is huge!

Thanks, everyone, for your patches and +1s! I appreciate the encouragement to get it done.

@purcell

Thanks, Jason, on behalf of all the +1 folk. :-)

@skyeagle

Yeah, you're the man! Thank you!

@trans

Appreciating the hard work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2011
  1. @purcell

    Fix RbConfig / Config warning in Ruby 1.9.3.

    purcell authored
    "Config" is deprecated in Ruby 1.9.3, in favor of "RbConfig". This
    patch uses whichever is available, preventing Ruby 1.9.3 from printing
    a deprecation warning when redcloth is loaded.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/redcloth.rb
View
5 lib/redcloth.rb
@@ -7,7 +7,8 @@
require 'rbconfig'
begin
- prefix = Config::CONFIG['arch'] =~ /mswin|mingw/ ? "#{Config::CONFIG['MAJOR']}.#{Config::CONFIG['MINOR']}/" : ''
+ conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
+ prefix = conf['arch'] =~ /mswin|mingw/ ? "#{conf['MAJOR']}.#{conf['MINOR']}/" : ''
lib = "#{prefix}redcloth_scan"
require lib
rescue LoadError => e
@@ -41,4 +42,4 @@ def self.include(*args)
require 'redcloth/erb_extension'
include ERB::Util
rescue LoadError
-end
+end
Something went wrong with that request. Please try again.