Apr 232009
 

You’ll notice, if you follow those screencasts (around now, anyway, as the plugin’s code is likely to change, or maybe the screencasts themselves) that when you add in_place_editing, you suddenly get broken HTML..

The fix is thankfully easy!

vendors > plugins > in_place_editing > lib > in_place_macros_helper.rb
Line 79:
tag = content_tag(tag_options.delete(:tag), h(instance_tag.value(instance_tag.object)), tag_options)

Change to :
tag = content_tag(tag_options.delete(:tag), instance_tag.value(instance_tag.object), tag_options)

And you’re set!

Apr 212009
 

This tutorial may be incomplete – I set this up from my system, which already has a lot of libraries and packages installed. The readme recommends glib, gtk, gtksourceview2 and such – YMMV.. This is what -I- had to do.
# eselect ruby set ruby18
# layman -S
# layman -a gnome

(if you are running on amd64)
# echo “dev-libs/libgee ~amd64″ >> /etc/portage/package.keywords/common
# echo “dev-lang/vala ~amd64″ >> /etc/portage/package.keywords/common

# emerge dev-libs/oniguruma dev-libs/libgee ruby-gnome2

AND HERE’S WHERE IT BIT IT. I couldn’t build ruby-gdkpixbuf2 against Ruby19 and I didn’t feel like uninstall Ruby19.

# gem install oniguruma activesupport rspec cucumber hoe open4 zerenity

I guess I’ll have to wait a little longer for this machine. I do have an old laptop running Ubuntu – and redcar gives detailed Ubuntu installation instructions.

Apr 172009
 

Taken straight from this blog

in a terminal.. First do a ‘locate mysql_config’ and then replace the path in the following command with where that file is.

$ sudo gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while…
Successfully installed mysql-2.7
1 gem installed

Apr 062009
 

UPDATE!
Cowlibob did a fix, find it at : http://github.com/cowlibob/rubyscript2exe

Untested!
From ‘The Higgs bozo’ on the ruby newsgroup. Apply change to both rubyscript2exe and tar2rubyscript. As far as I know that makes it work with newer versions of Ruby but I didn’t get to play with it yet.

— rubyscript2exe.rb.orig 2009-04-03 10:28:41.140806000 -0400
+++ rubyscript2exe.rb 2009-04-03 10:29:40.108423800 -0400
@@ -618,7 +618,7 @@

newlocation do
if __FILE__ == $0
- $0.replace(File.expand_path(“./init.rb”))
+ $0 = File.expand_path(“./init.rb”)

TAR2RUBYSCRIPT = true unless defined?(TAR2RUBYSCRIPT)

Mar 302009
 

This is good for 1.8.6
In your ruby\bin directory, there should be an ‘irb.bat’ and an ‘irb’ file. Edit that ‘irb’ file.
all you have to do is add :
require “irb/completion”
under ‘require “irb” ‘ and you’re set.

If you have 1.8.7, it looks like that’s in the irb.bat file instead..

And if you have 1.9, it looks like the tab completion is automatically enabled, lucky us! (unless I made a change and forgot about it).

Jan 272009
 

As is, this code will create an array of arrays – Directories with the same 6 first characters will be grouped in the same sub-array. I am using this for log directories, name format 20081125 for instance – you can just replace the logic to be whatever you need, of course.

dirs = []
Dir['*'].each do |item|
  if File.directory?(item)
    if dirs.empty?
      dirs << [item]
      next
    end
    inserted = false
    dirs.each_with_index do |list_of_folders, index|
      if list_of_folders[0].to_s[0..5] == item[0..5]
        dirs[index] << item
        inserted = true
      end
    end
    dirs << [item] if !inserted
  end
end
Jan 232009
 

Erik Veenstra created two scripts, tar2rubyscript and rubyscript2exe, which essentially grab what you wrote, wrap it up with some other code, bundle it with the ruby executable, and spit out a finished, executable package – which will run on that same OS — so compile it on Windows, get a Windows executable, compile on Linux, get Linux executable, etc.
tar2rubyscript
rubyscript2exe

As I’m a newb, it took me a while to figure out that I need .. ‘stuff’ in the init.rb file. Since I’m writing scripts, I just stuffed the whole simple script in init.rb.. This also means I don’t really understand how to do bigger programs, but I think that with more knowledge than mine, these pages are worth their weight in pixels. Made of gold.

Jan 232009
 
require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
ie.Visible = 1
ie.navigate "www.google.com"

That’s the basics for it. I found another basic intro from Ruby on Windows blog .. And don’t forget you can instantiate an object and then do something like..

properties = ie.ole_get_methods

to get more information. This comes in very handy :)