Lackie enables automation of remote applications using an HTTP middleman:
Ruby Client -> Lackie Service <- Remote App
Lackie automates applications running in environments that are difficult to control remotely. Lackie requires minimal support in target environments: scheduling (e.g. window.setInterval) and HTTP client capabilities (e.g. ajax).
Where it's difficult to programmatically launch the remote application, it can be started manually before the automation begins. Lackie effectively “attaches” itself to the running “zombie” application.
Lackie uses an HTTP service as a proxy for application automation commands:
1. application surrenders control to automation 2. the surrendered application polls Lackie for commands 3. the automator sends a command to Lackie 4. the application executes the command and sends the result to Lackie 5. the automator polls Lackie and receives the result (or error)
Lackie is implemented as rack middleware, so:
require 'rack' require 'lackie' require 'lackie/rack' Rack::Builder.app do use Lackie::Rack::Middleware run MyApp end
It will intercept all requests where the path starts with /lackie/
Lackie expects remote applications to:
1. poll the middleware for commands expressed as strings 2. execute those commands when they appear 3. send string results back to the middleware
The source code includes an example rack app:
Open this URL in your browser of choice:
Now you can execute commands in the remote application:
require 'rubygems' require 'lackie' Lackie::RemoteControl.new("localhost", 9292).exec("1 + 2") # => "3"