This file contains 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
# José Valim <[email protected]> | |
# http://josevalim.blogspot.com/ | |
# http://www.pagestacker.com/ | |
module RenderSiblingHelper | |
# What? | |
# | |
# Since render_component was deprecated in Rails 2.2, this helper is a | |
# lightweight implementation of "components", being used in Pagestacker. | |
# |
This file contains 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
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
This file contains 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
#!/usr/bin/env macruby | |
# From: http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/ | |
# Expanded from here: http://www.furmanek.net/36/using-macruby-to-set-xcode-project-version-from-git/ | |
# Xcode auto-versioning script for Subversion by Axel Andersson | |
# Updated for git by Marcus S. Zarra and Matt Long | |
# Converted to ruby by Abizern | |
# Converted to MacRuby by Gregory Furmanek | |
# Merged with MacRuby version by elliottcable | |
# Appends the git sha to the version number set in Xcode. |
This file contains 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 'feedzirra' | |
# fetching a single feed | |
feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing") | |
# feed and entries accessors | |
feed.title # => "Paul Dix Explains Nothing" | |
feed.url # => "http://www.pauldix.net" | |
feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing" | |
feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0" |
This file contains 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
# Kivanio Barbosa | |
# Class to remove or install gems | |
class Phoda | |
attr_accessor :command | |
attr_accessor :file | |
attr_accessor :sudo | |
def initialize(command,file,sudo=false) | |
raise "Need some existent File." unless File.exist?(file) | |
@file = file |
This file contains 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
#!/usr/bin/env ruby | |
# Execute the git, gem, or rake command, depending on the second argument | |
case ARGV.first | |
when /^(add|bisect|branch|checkout|clone|commit|diff|fetch|grep|init|log|merge|mv|pull|push|rebase|reset|rm|show|status|tag)$/ | |
system "git #{ARGV.join(' ')}" | |
when /^(build|cert|check|cleanup|contents|dependency|environment|fetch|generate_index|help|install|list|lock|mirror|outdated|pristine|query|rdoc|search|server|sources|specification|stale|uninstall|unpack|update|which)$/ | |
system "gem #{ARGV.join(' ')}" | |
else |
This file contains 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
XML Document parsing benchmark | |
user system total real | |
hpricot:xml:doc 10.160000 0.950000 11.110000 ( 11.144462) | |
hpricot2:xml:doc 0.950000 0.000000 0.950000 ( 0.953266) | |
nokogiri:compat:doc 0.220000 0.020000 0.240000 ( 0.238401) | |
nokogiri:xml:doc 0.170000 0.030000 0.200000 ( 0.200283) | |
XML XPath benchmarks (//status/text, //user/name) | |
user system total real | |
hpricot:xml:xpath 7.580000 1.150000 8.730000 ( 8.728314) |
This file contains 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
class Object | |
def send_through(object, *args) | |
object.dispatcher_for(self).call(self, *args) | |
end | |
end | |
module Dispatcher | |
class DispatcherNotFound < StandardError; end | |
def self.extended(klass) |
This file contains 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
# This assumes you have the metric_fu and kablame plugins installed. | |
# For kablame I like to modify it to include your stories or features dir as well as the specs. | |
# Set the artifacts dir for development | |
ENV['CC_BUILD_ARTIFACTS'] ||= File.expand_path("#{RAILS_ROOT}/metrics") | |
rspec_base = File.expand_path("#{RAILS_ROOT}/vendor/plugins/rspec/lib") | |
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) | |
require 'spec/rake/spectask' | |
require 'spec/rake/verify_rcov' |
This file contains 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
http://www.sinatrarb.com/wild.html | |
http://www.sinatrarb.com/extensions-wild.html | |
http://www.irclogger.com | |
http://followcost.com | |
http://moourl.com | |
http://whoisbigger.sobrerailes.com | |
http://integrityapp.com | |
http://github.com/adamwiggins/scanty/tree/master | |
http://github.com/atmos/hancock/tree/master | |
http://github.com/cschneid/irclogger/tree/master |
OlderNewer