tag:blogger.com,1999:blog-822738186956251465.post6456828332762780062..comments2023-11-09T00:23:18.101-05:00Comments on Brent's Tech Ramblings: Formatting Ruby and HTML code for blog postingBrenthttp://www.blogger.com/profile/17023647333704400692noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-822738186956251465.post-35743937088512444812011-11-11T09:44:19.299-05:002011-11-11T09:44:19.299-05:00I found a better way to post code to blogs. See m...I found a better way to post code to blogs. See my post <a href="http://rails.brentsowers.com/2011/11/better-way-to-format-code-for-blogger.html" rel="nofollow">Better way to format code for blog posts</a> to see how.Brenthttp://www.blogger.com/profile/17023647333704400692noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-19329194865423894332011-06-11T18:03:23.646-04:002011-06-11T18:03:23.646-04:00I just tried the example Windows code again and no...I just tried the example Windows code again and noticed that with the latest Ruby 1.8.7 and Ruby 1.9.2 install packages, the Win32 gems are not installed. You'll get an error that it couldn't load win32/clipboard. To fix this run "gem install win32-clipboard".Brenthttp://www.blogger.com/profile/17023647333704400692noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-78642578172863635702010-08-26T09:53:19.092-04:002010-08-26T09:53:19.092-04:00I just updated the post to include code for readin...I just updated the post to include code for reading the input from a file and outputting to another file - useful for OSes other than Windows.Brenthttp://www.blogger.com/profile/17023647333704400692noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-46645711795544273932009-11-11T20:02:05.034-05:002009-11-11T20:02:05.034-05:00The error is NOT a Ruby version error, the error m...The error is NOT a Ruby version error, the error message reported by Ashish is clear, it was on line 25 of clipboard.rb, in the package: win32-clipboard-0.4.3 so; The need to "require 'WIN32API'" must have been a typo in win32-clipboard-0.4.3.<br><br>Try making the code, more like:<br><br>require 'syntax/convertors/html'<br>require 'win32/clipboard'<br>include Win32<br><b>require 'Win32API' if Clipboard::VERSION == '0.4.3'</b><br>(then the rest of your code, in each sample.)<br><br>Ideally it would be nice to know when the error was removed; it is NOT in ver 0.5.2, so the conditional version line could also read:<br><br><b>require 'Win32API' if Clipboard::VERSION < '0.5.2'</b>Danhttp://www.blogger.com/profile/13410793725214236118noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-92200440075961851382009-07-24T01:33:27.750-04:002009-07-24T01:33:27.750-04:00Nice. Thanks for taking the effort to post this.Nice. Thanks for taking the effort to post this.Gishuhttp://www.blogger.com/profile/17616896114730114577noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-31598525052355774262009-02-12T06:12:00.000-05:002009-02-12T06:12:00.000-05:00Thanks for the Win32API tip AshishThanks for the Win32API tip AshishDugeennoreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-70539707343558007902008-06-20T08:20:00.000-04:002008-06-20T08:20:00.000-04:00Good Job! :)Good Job! :)Stefanhttp://www.mylovetoy.denoreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-37164108815009968982008-04-15T07:23:00.000-04:002008-04-15T07:23:00.000-04:00why not use the XMP tag for XML => HTML?why not use the XMP tag for XML => HTML?AgileTesterhttp://www.blogger.com/profile/15992781868662434695noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-89162235238868316582008-04-01T22:53:00.000-04:002008-04-01T22:53:00.000-04:00Thanks for catching that Ashish! It works fine fo...Thanks for catching that Ashish! It works fine for me without Win32API, you must have different version of Ruby that me. I'm running 1.8.5. Adding the require Win32API for me works the same, so I've updated the code in the posting to have this require.Brenthttp://www.blogger.com/profile/17023647333704400692noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-79079205486676288012008-03-20T10:29:00.000-04:002008-03-20T10:29:00.000-04:00Thank you for this good help :-)Thank you for this good help :-)xiaobozzhttp://www.blogger.com/profile/16186658461111693141noreply@blogger.comtag:blogger.com,1999:blog-822738186956251465.post-86833643863867456672008-01-21T08:00:00.000-05:002008-01-21T08:00:00.000-05:00thanks, brent! works like a charm :)thanks, brent! works like a charm :)bryanhttp://bryanallott.net/noreply@blogger.com