Of smart folders, Automator and Ruby

Posted by Daniel Fri, 10 Aug 2007 00:15:00 GMT

&tI was working on organizing my computer because I'll be switching machines soon, and it was clearly time for some automation. I built a few smart folders, a couple of burn folders, and some Automator scripts. I was disappointed to see that Automator's shell scripts don't include Ruby out of the box. Easily enough fixed though. Here's what you do: Open /System/Library/Automator/, find the Run Shell Script.action file (it's really a package) control click and select "Show Package Contents" then make your way to /Contents/Resources/Shells.plist and open it with your favorite text editor. Then add
	<key>/usr/bin/ruby</key>
	<dict>
		<key>args</key>
		<array>
			<string>-e</string>
			<string>%</string>
			<string>--</string>
		</array>
		<key>script</key>
		<array>
			<string>$STDIN.each { |arg| puts arg }</string>
			<string>ARGV.each { |arg| puts arg }</string>
		</array>
	</dict>
You can of course create these entries by using the plist editor. When you restart Automator you should be able to choose /usr/bin/ruby from the run shell action. The blocks are just a starting point... then it's up to you...

Posted in  | 2 comments | no trackbacks

Moving to Edge Rails

Posted by Daniel Thu, 09 Aug 2007 01:49:00 GMT

Some of this might be out of date, but the simplest critical path seems to be as follows:
  1. Create a throw away Rails project
  2. Freeze to Edge
  3. Create a new project using Edge to ensure you have the latest environment files etc.
  4. Add the missing ActiveResource gem
  5. Live on the Edge

Command line stuff looked a bit like this.

For the search engines... the error I was getting (under Mongrel) was
Exiting
/Users/daniel/temp/aumeatur/vendor/rails/railties/lib/commands/servers/mongrel.rb:16: warning: already initialized constant OPTIONS
/Users/daniel/temp/aumeatur/vendor/rails/railties/lib/commands/servers/mongrel.rb:19: undefined method `options' for []:Array (NoMethodError)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /Users/daniel/temp/aumeatur/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
        from /Users/daniel/temp/aumeatur/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from /Users/daniel/temp/aumeatur/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
        from /Users/daniel/temp/aumeatur/vendor/rails/railties/lib/commands/server.rb:39
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from script/server:3

Posted in , ,  | no comments | no trackbacks