Created
July 16, 2009 13:47
-
-
Save ayucat/148413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ayucat 2009-07-16 | |
# add to rakefile.rb as follows: | |
# RSTRING/RARRAY for Ruby 1.9.x | |
edit_file "xxx.c_or_h" do |line| | |
case line | |
when /RSTRING\(([^\)]+)\)->(ptr|len)/ | |
line.sub(/RSTRING\(([^\)]+)\)->ptr/, 'RSTRING_PTR(\1)').sub(/RSTRING\(([^\)]+)\)->len/, 'RSTRING_LEN(\1)') | |
when /RARRAY\(([^\)]+)\)->ptr/ | |
line.sub(/RARRAY\(([^\)]+)\)->ptr/, 'RARRAY_PTR(\1)') | |
else | |
nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment