Skip to Content

Free TUAW iPhone app -- try it now!
AOL Tech

ruby posts

Filed under: Cool tools, Snow Leopard

Snow Leopard Services in practice: Amazon S3 uploader

I stumbled upon a great example of the Snow Leopard Services that I've been drooling over. The S3 Upload Service by August Lilleaas is available as a workflow which can be opened in Automator, so you can examine its inner workings. It uses AppleScript and Ruby, easily passed back and forth thanks to Automator's building-block-style workflow. It lets you upload a publicly-accessible file to an S3 bucket, and copies the URL into your clipboard upon successful upload.

The workflow requires that you at least have RubyGems installed, and have an Amazon S3 account set up, but it will handle the rest. It asks for your S3 credentials with an AppleScript popup, which has the unfortunate side effect of not being able to be forced to the front very easily and tends to get lost behind other windows. There are workarounds to that, but no way to keep it on top once it's up. It looks possible to build custom nibs for your services, so I might play around with making a general-purpose utility panel popup to fill the void in my own projects.

In the process of rolling my own Services in Snow Leopard, I've definitely found some limitations, but I'm having fun working around them. This one is a great example of passing results -- returned from different languages -- and processing them, all within Automator. It's not super-polished -- your mileage may vary -- but a big thanks to August for putting it out there for the rest of us to play with!

Filed under: Software, Cool tools, Productivity

Friday Favorite: Dropzone

One of my favorite new tools is Dropzone from Aptonic Software. Cory mentioned it back in early beta, but it's come a long way since then. Dropzone lets you set up "destinations," and when you click its icon in the dock it pops up a HUD-style window with icons for each destination. You can drop files and text onto each icon, or have them launch apps and run scripts with a click. It comes with ready-made destinations for everything from Flickr uploading of dropped images to zipping and emailing a collection of dropped files. The beauty of Dropzone is that the average user can set up all of the destinations they would normally launch other apps for, but users in more advanced stages of geekery can construct their own destinations using the Ruby-based Dropzone API.


My personal Dropzone setup includes destinations for creating projects or opening files in TextMate, opening a folder in GitX, sending files to my Amazon S3 account (puts a publicly-accessible url in my clipboard), filing based on OpenMeta tags, mounting and unmounting FireWire drives, making quick Backpack reminders, and the list goes on. I've even got one that scans dropped text for "http://" links and creates a linkbun.ch for me. Some of these scripts I've written, some were just a matter of customizing the existing destinations. Either way, I've got all of these capabilities no more than a click or drag away.

Creating your own destinations just requires a little Ruby-fu. "But I'm the farthest thing from a level 12 Ruby Mage," you say. Don't sweat it, let the community do it for you. Several scripts from my personal setup, along with a great selection of others, are available in the user-contributed actions section of the Aptonic Software website. Additionally, included actions like the application launcher allow full customization just by selecting the application to trigger.

Dropzone is available for a free trial, and can be had for $10US. Give it a try and see if it doesn't speed up your workflow. If you create any scripts you'd like to share, be sure to let the author know!

Filed under: How-tos, Developer

Apple Tutorial: Developing with MacRuby

Apple has posted an interesting new tutorial on developing OS X applications with MacRuby. MacRuby is an implementation of the Ruby programming language "ported to run directly on top of Mac OS X core technologies such as the Objective-C common runtime and garbage collector, and the CoreFoundation framework."

What this means is that applications written with MacRuby can be a full-fledged Cocoa application with all the advantages that entails. The tutorial will take you through the process of installing MacRuby as well as building a sample application with Xcode. So if you've ever wanted to get started thinking about developing for the Mac, but have always been intimidated by Objective-C (which pretty much describes me), playing around with MacRuby might be just the ticket to get you started.

[via MacVolPlace]

Filed under: Cool tools, WWDC

WWDC schedule: Ajax to PDF

Developers and other WWDC attendees looking for a simple printout of the sessions and labs at the conference may be disappointed with the results when printing out Apple's (very slick) Ajax calendars. You could save the pages to PDFs and have a calendar format, but for the purposes of a nice, list-format printout, I can't find a printable version. It's entirely possible I'm not looking hard enough, but at least one other person had the same problem ... and was resourceful enough to come up with a solution. Johannes Fahrenkrug is making available a Ruby script that will make a PDF with a nicely formatted table of all the sessions and labs offered at WWDC.

You can grab the script at his blog and running it is a simple matter of unzipping and executing the wwdcpdf.rb file from Terminal (or wherever you like to do such things). The output is a simple table format with some classic Helvetica action. Those familiar with FPDF may be able to get more artistic with it, or simply build off of the existing code to output in other print or screen-friendly ways. Given that it's based off of an XML file, you can even do some sorting and filtering with a little bit of Ruby magic. Johannes states that he'd be happy to see the script enhanced!

Filed under: Analysis / Opinion, OS, Software, Open Source, Leopard, Developer

24 Hours of Leopard: Ruby on Rails built-in

Feature: The most awesome, easy, groovy, Web 2.0 development platform ever is now built-in to OS X.

How it works: Like buttah. Ruby, the language that powers RoR, has actually been built-in to OS X for a while (don't believe me? type "irb" in your terminal right now to access interactive Ruby), but Ruby on Rails has been mostly a pain to install around OS X. Packages need to be downloaded, settings need to be tweaked, and servers need to be config'd. No more. Ruby on Rails, free and installed on every new Mac. Developers, start your developing.

Who will use it: Mostly people who develop applications for the web. But even though I personally don't code much, if you've ever done any coding, once you dive into Ruby and RoR, you'll probably have the same reaction that I do: wow this thing is neat! For a start in Ruby, check out the classic Why's Poignant Guide, and for a tutorial on RoR, hit up Curt Hibbs (he's from St. Louis, so you know he's a good guy).

You can check out all our 24 Hours of Leopard posts here.

Filed under: Software, Odds and ends, Internet Tools

BBEdit version 8.7 released


BBEdit 8.7, the latest version of the triple-A HTML editor, has been released.

Update: OK, so the reason I originally thought that all the "new" 8.7 features sounded familiar is because I actually was looking at the release list for version 8.5. The 8.7 release notice is here, and it includes Lua programming support, an option to remember which documents and browsers are open after closing BBEdit, and a Python language module and lots of other fixes and improvements. Sorry about the mistake, and thanks to all our commenters (and to Bare Bones Software themselves) for the heads up.

8.7 is a free update for 8.5 and 8.6 customers. If you haven't picked up BBEdit yet, you can try out the free demo here.

Filed under: Developer

RubyCocoa 0.11.0 released

RubyCocoa is a nifty "bridge" between Ruby and Objective-C (the language of Cocoa), that allows developers to "write full-stack Cocoa applications in Ruby" or a "Cocoa application that mixes Ruby and Objective-C code." It has just received a major update to version 0.11.0. The release notes list the considerable changes; these include compatibility with Ruby 1.9, support for Quartz Composer, support for 64-bit applications and much more. As it happens, I've been slowly learning Ruby, so I'm looking forward to learning how to use RubyCocoa to build Mac applications with Ruby on the back-end.

RubyCocoa is free and open source; it's a free download from SourceForge.

[via MacResearch]

Filed under: Software, Open Source, Developer

Platypus: create Mac applications from Ruby, Perl, shell scripts, etc.

MacResearch has posted a nice two part tutorial on using Platypus, a neat utility that allows you to "create native, flawlessly integrated Mac OS X applications from interpreted scripts." This include shell scripts, Perl, Ruby, Python, etc. With Platypus you can turn command-line only tools into full fledged, free-standing Mac applications that support drag and drop and even basic graphical feedback. Obviously this isn't going to make for a full GUI application, but it will allow you easily to create self-contained OS X applications that you can double-click to run. Especially for those in the science fields, and even for beginning (Ruby) script programmers like myself, Platypus makes it possible to get basic (and even not so basic) Mac app up and running very quickly.

Platypus is a free download from Sveinbjorn Thordarson, and donations are requested.

[Via MacResearch]

Update: fixed headline

Filed under: How-tos, Developer

Skip the AppleScript with Ruby

For a long time now I have been working on learning AppleScript, where "working on" means I bought an AppleScript book that sits on my table accusingly, but I've never actually picked it up and read through it. AppleScript is clearly a powerful and relatively easy way to get somewhat complex tasks accomplished on your Mac; heck with AppleScript Studio you can even write stand-alone applications of a sort. This story on MacDevCenter, however, has given me pause. AppleScript guru Matt Neuburg (who literally wrote, if not the, at least a book on AppleScript) has put up a nice tutorial on replacing AppleScript with rb-appscript, which is "a high-level, user-friendly Apple event bridge that allows you to control scriptable Mac OS X applications using ordinary Ruby scripts." Now everybody and his brother has been going on of late about how wonderful Ruby is for web development, particularly with Rails using TextMate, so now I have a dilemma. Should I actually try to learn Ruby instead and double my return, as it were? While I think that over, go check out Matt's tutorial and see for yourself how Ruby and Apple events can make beautiful music together.

[Via MacVolPlace]

Filed under: OS, Software, Developer

Ruby + AppleScript = RubyOSA

Our friends at Download Squad have discovered a melding of two scripting worlds: AppleScript and Ruby. RubyOSA is the darling scriptenstein of these two languages, and while I don't know a lick of either, I'm willing to bet this could be a popular amongst the code ninjas in the audience. Ruby is a popular language (the 13th most popular, by their numbers), and it's the foundation of the Ruby on Rails framework which has given us such handy web 2.0 apps as Backpack, Odeo, Strongspace and many more.

This is about the line, however, that I reach where I would need to start pretending I know more about any of these languages, so I'll let you check out RubyOSA for yourself to see if it gets your coding gears turning.

Filed under: Software

ActiveState releases Komodo 3.5.2 for OS X

Komodo, a powerful IDE for various scripting languages and the like, has been released for OS X by ActiveState.

Any time a company releases an IDE for OS X I do a little dance on the inside because it means that people are noticing the developer community that OS X has built up around it. More developers means more software for the Mac and that can't be a bad thing.

Tip of the Day

Use Spotlight as a reference tool. Type any word in the Spotlight box and one of the top entries will be a definition. Click on it, and it will bring up the dictionary application to check the word in either the dictionary, thesaurus, Apple database, or Wikipedia.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher