Archive for the ‘Airake’ Category

popen’ing part 2

Friday, November 9th, 2007

I guess I should rtfm before blogging about something. This is my new IO.popen block which allows you to run a process which wants input, like the adt (Adobe Debug Tool) package task (which asks for your certificate password):

IO.popen(@cmd) do |f|                        
  while s = f.read(1)
    printf s
    STDOUT.flush
  end
end
@process = $?

View the airake/runner.rb. The IO.read call if not given args will block until EOF. This means we can’t output anything until the process ends which makes it appear hung if its asking for input. The waitpid call in the previous version just picks up the Process::Status since the read was the blocking call, but you can get that from $? after the popen block returns. I needed to add the STDOUT flush since printf isn’t guaranteed to (and wasn’t) outputing on the adt password input since I think it waits for a newline. Also this totally works on windows, although the whole read char + printf + flush makes it feel like a typewriter. This might be solved by using the IO.read_nonblock method. I’ll need to look into that.

Also, I updated the blog css, which I was told was depressing. Now its a total ripoff of coudal.com instead of danwebb.net

popen’ing

Wednesday, November 7th, 2007

I updated airake to work on windows (thanks Todd). Instead of using system (or %x), I am trying IO.popen:

IO.popen(@cmd) do |f|
  @output = f.read
  @process = Process.waitpid2(f.pid)[1]
end

and in windows you’ll need to cmd.exe /c it:

@cmd = RUBY_PLATFORM =~ /win32/ ? "cmd.exe /c #{cmd}" : cmd

This thread was helpful and I popened a new airake/runner.rb version. The FCSH daemon still doesn’t work in windows yet.

browsair – Letting sites live in your dock

Saturday, October 13th, 2007

I wrote an AIR project generator for airake called browsair. It will build you a AIR webkit browser app targeted at a web site, so you can let it live in you dock (or tray whatever), instead of that 4th tab on the 2nd firefox window.

Theoretically someone could make a packaged browser + greasemonkey + stylish AIR app for particular web sites that growl notifies and lives in the dock and be more in your face; but this scaffold right now is pretty basic.

I should also mention there is a website called airifier which does this as well, except I think they give you a packaged app only, without the source.

I also got a bunch of fixes into this version of airake; packaging is fixed, and there is a task for creating certificates, among other things. I just deployed version 0.2.4 to rubyforge so it should be up by the time you read this.

The usage:

browsair GReader http://reader.google.com path/to/rss_icon_128x128.png

Creates an AIR project for a google reader AIR app. In the GReader project, run:

rake air:package CERTIFICATE=path/to/cert.pfx

If you need to generate a certificate:

rake air:certificate CERTIFICATE=../ducktyper.pfx

I built a couple already if you want to bypass all that compiling:

(If you don’t have the AIR runtime installed, get it here)

Updated airake to support AIR/Flex Beta 2

Friday, October 5th, 2007

I updated airake to support new AIR/Flex beta 2 build.

sudo gem update airake

I changed the fcsh tasks to:

rake fcsh:start
rake fcsh:stop
rake fcsh:restart

airake – Rake tasks and generators for adobe AIR apps

Tuesday, September 11th, 2007

airake gives you tasks for compiling, debugging, testing and packaging Adobe AIR applications. It also has a basic project generator/scaffold. All this was made possible because of the prolific newgem and rubigen gems.

To get started, checkout airake.rubyforge.org

The tasks and project might be a little Flex specific (cause of the particular project we are working on), so feel free to poke around or contribute back. Also I only tested it on MacOSX.

Some of the FCSH (flex compiler shell) daemon and wrappers are from the Sprout project, so be sure to check them out.