This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "set" | |
module RakeTask | |
CALLED = Set.new | |
NAMESPACES = [] | |
TASKS = Hash.new { |h, k| h[k] = Struct.new(:blocks, :deps).new([], []) } | |
class << self | |
def call(name) | |
return if CALLED.include?(name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "johnson" | |
require "./visitor.rb" | |
js =<<-END | |
function top() { | |
"top docstring", { command: true } | |
doSomething(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Pivotal Tracker API client (note: super-not-ready) | |
USAGE | |
Finding a project: | |
project = PivotalTracker::Projet.find(1) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
class Nokogiri::XML::Node | |
def method_missing name, *args, &block | |
if args.empty? | |
list = xpath("./#{name}") | |
elsif args.first.is_a? Hash | |
hash = args.first | |
if hash[:css] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Nokogiri | |
module XML | |
class Builder | |
def insert_html(html) | |
Nokogiri::HTML.fragment(html).each do |child| | |
insert child | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "nokogiri" | |
require "eventmachine" | |
## | |
# This is the XML SAX Parser that accepts "pushed" content used by Babylon Gem. | |
class XmppParser < Nokogiri::XML::SAX::Document | |
## | |
# Initialize the parser and adds the callback that will be called upen stanza completion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "nokogiri" | |
require 'dike' | |
Dike.logfactory '/tmp/dikelogfactory/' | |
class ZipZap | |
attr_reader :zip, :zap | |
def initialize | |
@zip = "zip" | |
@zap = "zap" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Require slash | |
# by Aaron Patterson | |
# inspired by Josh Susser | |
# use to require files relative to the current file: | |
# | |
# require __FILE__/"lib"/"foo" | |
# require __FILE__/%{lib foo} | |
class String |
OlderNewer