Quickstart Ruby

Ruby

1. Download the bundlet, and place it in your workflow's root directory.

2. Include the bundlet

require_relative 'alfred.bundler.php'

3. Instantiate a Bundler object.

b = Alfred::Bundler.new

Read the implementation page for more advanced ways to initialize the bundler.

Using the Bundler

The Alfred Bundler is implemented, in Ruby, as a class.

Load a Utility
Load an Icon
Load a gem
Load more than one Gem
Do not use the bundler framework to install any gems that require compiling. You can and should expect that some users will not have the tools installed to compile the Gems. Requiring those will result in many errors and bug reports. If you do need to use gems that need to be compiled, then you should compile them on your system and make sure that they work with Ruby 1.9 and Ruby 2.0 at minimum.
Load a Wrapper
Send a Notification
Note: the icon argument defaults to the workflow icon's icon.png if it is available.
Logging

For general information on logging with the Bundler, read the log page.

In order to use the logs, you need to initialize the bundler differently:

The wf_log key will give you access to console logs as well as a default file log located in the workflow’s data directory named {workflow-bundle-id}.log. So, if your workflow’s bundle id is com.spr.bundler.example. The log will be located at ~/Library/Application Support/Alfred 2/Workflow Data/com.spr.bundler.example/com.spr.bundler.example.log.

Questions?

Post on the Alfred Forum thread.

Bug Reports?

Open an issue in the Github queue.