Michael Granger ged

View show.html.erb
1 2 3 4 5 6 7 8 9 10
class OrganizationalUnitsController < ApplicationController
 
def show
@organizational_unit = @directory.search( params[:id], :base )
end
 
end
 
require 'treequel/model'
require 'treequel/model/objectclass'
View sheen.rb
1 2 3 4 5 6 7 8 9 10
class Sheen
include Celluloid::Actor
 
def initialize(name)
@name = name
end
 
def current_status
"#{@name} is winning!"
end
View modinheritance.rb
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
 
class A
def initialize
puts "Initializing an A"
super
end
end
 
module B
View parasite.rb
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby -wKU
 
### A parasitic class
class Parasite
 
### Make all future instances of the Parasite actually call
### methods of the +victim+ instead.
def self.infest( victim )
victim.methods.each do |m|
meth = victim.method( m )
View copyfrom.rb
1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env ruby
 
require 'pg'
require 'stringio'
 
$stderr.puts "Opening database connection ..."
conn = PGconn.connect( :dbname => 'test' )
 
conn.exec( <<END_SQL )
DROP TABLE IF EXISTS logs;
DROP TABLE IF EXISTS logs;
View gist:77645
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
 
class A
def a; end
def b; end
end
 
class B < A
def a; end
end
Something went wrong with that request. Please try again.