Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix RbConfig / Config warning in Ruby 1.9.3. #11

Merged
merged 1 commit into from

15 participants

Steve Purcell Thibaud Guillaume-Gentil https://github.com/settings/admin Brian Getting Robby Colvin Sean Tan 7rans Alexander Oryol Rasmus Rønn Nielsen Alexey Medvedev Benoît Werner RON VRON CLAWS deepj Anton Orel Jason Garber
Steve 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.

Steve 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
Thibaud Guillaume-Gentil

+1 :)

https://github.com/settings/admin

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

https://github.com/settings/admin unclaimedbaggage referenced this pull request
Closed

1.9.3/config update #10

Brian Getting

+1

Sean Tan

+1

Deleted user Unknown referenced this pull request
Closed

Use 'Rbconfig' on 1.9 #12

Deleted user

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

Steve Purcell

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

7rans

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

Alexander Oryol

@jgarber update gem, please! :)

Rasmus Rønn Nielsen

+1 Looking forward to a version bump :)

Alexey Medvedev

+1

deepj

+1

Anton Orel

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

Jason Garber
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!

Jason Garber jgarber merged commit 3242fde into from
Jason Garber
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...

Jason Garber
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.

Steve Purcell

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

Anton Orel

Yeah, you're the man! Thank you!

7rans

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. Steve 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
5 lib/redcloth.rb
View
@@ -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.