Skip to content

Instantly share code, notes, and snippets.

View dje's full-sized avatar
😀
Playing

Darrin Eden dje

😀
Playing
View GitHub Profile
-- Mac #1 (works) --
$ macruby --version
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]
$ file test.rbo
test.rbo: Mach-O universal binary with 2 architectures
test.rbo (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
test.rbo (for architecture i386): Mach-O dynamically linked shared library i386
irb(main):001:0> framework 'Cocoa'
=> true
irb(main):002:0> NSOpenPanel.openPanel
Sun Jan 24 15:17:49 imac.local macruby[13149] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
Sun Jan 24 15:17:49 imac.local macruby[13149] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sun Jan 24 15:17:49 imac.local macruby[13149] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
=> #<NSOpenPanel:0x200274540>
irb(main):003:0> NSOpenPanel.openPanel
=> #<NSOpenPanel:0x2002fa220>
irb(main):004:0>
framework 'Cocoa'
NSApplication.sharedApplication
class Request
def get( url, &block )
@buffer = NSMutableData.new
@block = block
request = NSMutableURLRequest.requestWithURL NSURL.URLWithString( url )
NSURLConnection.alloc.initWithRequest( request, delegate:self )
require File.dirname(__FILE__) + '/helper'
class UriEncodeTest < Test::Unit::TestCase
it "responds with a percent-encoded encoded slash" do
mock_app {
get '/:encoded' do
params[:encoded]
end
}
#! /usr/bin/env ruby
=begin
backshot.rb is a Ruby program driving
Amazon EBS <http://aws.amazon.com/ebs/>
to generate snapshots for backup purposes.
Hourly, daily, weekly, and monthly snapshots
are generated by default.