Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
require 'celluloid/autostart' | |
class Manager | |
include Celluloid | |
trap_exit :processor_died | |
def initialize | |
@ready = 2.times.map { Processor.new_link } | |
end |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
class WTF | |
attr_reader :color | |
def initialize | |
@color = 'red' | |
end | |
def color_with_self | |
color = self.color | |
color |
foo | |
D, [2013-05-11T00:39:46.596057 #48493] DEBUG -- : Terminating 2 actors... | |
D, [2013-05-11T00:39:46.596526 #48493] DEBUG -- : Shutdown completed cleanly |
source 'https://rubygems.org' | |
gem 'celluloid-io', :git => 'https://github.com/celluloid/celluloid-io.git' | |
gem 'celluloid', :git => 'https://github.com/celluloid/celluloid.git' | |
gem 'reel',:git => 'https://github.com/celluloid/reel.git' |
require 'rubygems' | |
require "bundler/setup" | |
require 'reel/app' | |
Celluloid.task_class = Celluloid::TaskThread | |
class Wu | |
include Reel::App | |
get '/' do |request| | |
puts "Request came in //" |
require 'celluloid' | |
class Something | |
class RemoteScriptError < RuntimeError; end | |
include Celluloid | |
def ssh_command(*) | |
[false, Struct.new(:stdout, :stderr).new("out", "err")] | |
end |
#!/usr/bin/env ruby -wKU | |
@actions = Hash.new {|h,k| h[k] = []} | |
def tell_program(name, &block) | |
@actions['songstart'] << lambda do |*args| | |
IO.popen("osascript", "w") do |f| | |
f.puts %Q{ | |
tell application "System Events" | |
if exists process "#{name}" then |
# Example of how to use multiple Routes in external files/modules | |
require 'rubygems' | |
require 'sinatra/base' | |
# set the root of the whole app | |
APP_ROOT = File.dirname(File.expand_path(__FILE__)) unless defined?(APP_ROOT) | |
require "sinatra-external_routes_example" |