Skip to content

Instantly share code, notes, and snippets.

View h-lame's full-sized avatar
💀
a momentary diversion on the road to the grave

Murray Steele h-lame

💀
a momentary diversion on the road to the grave
View GitHub Profile
class Module
def private(*args)
if args.empty?
@acl = :private
else
args.each do |meth|
alias_method :"__#{meth}", meth
undef_method meth
end
end
@h-lame
h-lame / cucumber.rake
Created October 15, 2009 08:48
Run all cucumber features and collect failed ones, then run just those failed ones.
$LOAD_PATH.unshift(Rails.root + '/vendor/plugins/cucumber/lib') if File.directory?(Rails.root + '/vendor/plugins/cucumber/lib')
CUCUMBER_FAILED_LOG = Rails.root + "log/cucumber_failed"
touch(CUCUMBER_FAILED_LOG) unless File.exist?(CUCUMBER_FAILED_LOG)
begin
require 'cucumber/rake/task'
require "cucumber_rerun_task"
namespace :features do
Cucumber::Rake::Task.new(:active) do |t|
2009-10-06 07:51:36.776 System Preferences[408] PrefPaneInstalld: awakeFromNib
2009-10-06 07:51:36.777 System Preferences[408] PrefPaneInstalld: mainViewDidLoad
2009-10-06 07:51:36.796 System Preferences[408] /bin/launchctl unload -w -S Aqua /Users/msteel01/Library/LaunchAgents/com.floehopper.installdPrefPane.plist
2009-10-06 07:51:36.861 System Preferences[408] launchctl: illegal option -- S
usage: launchctl load [-wF] paths...
2009-10-06 07:51:36.862 System Preferences[408] Error executing command: /bin/launchctl unload -w -S Aqua /Users/msteel01/Library/LaunchAgents/com.floehopper.installdPrefPane.plist
2009-10-06 07:51:36.862 System Preferences[408] PrefPaneInstalld#mainViewDidLoad: RuntimeError: Error executing command: /bin/launchctl unload -w -S Aqua /Users/msteel01/Library/LaunchAgents/com.floehopper.installdPrefPane.plist
/Users/msteel01/Library/PreferencePanes/Installd.prefpane/Contents/Resources/command.rb:19:in `execute'
/Users/msteel01/Library/PreferencePanes/Installd.prefpane/Contents/Resource
class Schedule
def initialize(service)
@service = service
end
attr_accessor :schedule
def day
(1..23).map { [] }
@h-lame
h-lame / upgrade_views
Created January 23, 2009 12:23
Script for updating view files to the new <name>.<output_format>.<renderer> naming scheme of Rails 2.x (useful for upgrading 1.x apps).
#!/usr/bin/env ruby
require 'optparse'
options = { :use_svn => true }
OptionParser.new do |opt|
opt.banner = "Usage: upgrade_views [options]"
opt.on('-f', '--file_rename', 'Use file renaming rather than svn move to update the files.') { |v| options[:use_svn] = false }
opt.parse!(ARGV)
end