Skip to content

Instantly share code, notes, and snippets.

View bruce's full-sized avatar
🤝
Here to help!

Bruce Williams bruce

🤝
Here to help!
View GitHub Profile
module Tuneup
module Bootstrap
module Utils
private
def build_dir
'tuneup-bootstrap'
Technique:
http://www.pragprog.com/the-pragmatic-programmer
Ruby:
http://www.pragprog.com/titles/ruby/programming-ruby
Rails:
http://www.pragprog.com/titles/rails2/agile-web-development-with-rails
#!/usr/bin/env ruby
require 'erb'
require 'find'
require 'open3'
require 'rubygems'
begin
require 'colorize'
rescue LoadError
require 'cucumber/rake/task'
cucumber_options = proc do |t|
t.binary = Merb.root / 'bin' / 'cucumber'
t.cucumber_opts = "--format pretty"
end
Cucumber::Rake::Task.new(:features, &cucumber_options)
Cucumber::Rake::FeatureTask.new(:feature, &cucumber_options)
namespace :merb_cucumber do
Fiveruns::Tuneup.step "Name of this step", :controller do
# call your code here
end
require 'rubygems'
require 'randexp'
branch = /bruce-\d{6,7}-\w{4,8}-\w{10,18}/.gen
`git checkout -b #{branch} && git push origin #{branch}:#{branch}`
bruce@rimal ~/bin % timer
Insufficient arguments
timer projects
OR: timer start|stop|status|info|total PROJECT [OPTIONS]
-t, --time TIME Specify a time (start/stop)
-d, --describe DESCRIPTION Specify a description for this period (start/stop)
-r, --rate RATE Include total to invoice using RATE (total)
-w, --within DATETIMES Within DATETIMES (total/info)
-s, --since DATETIME Since DATETIME (total/info)
-u, --until DATETIME Until DATETIME (total/info)
# Playing with it in irb:
>> (class << Widget; self; end).ancestors
=> [BazWrapper, BarWrapper, FooWrapper, Class, Module, Object, Kernel]
>> widget = Widget.new
=> #<Widget:0x11771f8>
>> (class << widget; self; end).ancestors
=> [BazWrapper::WrappingB, BazWrapper::WrappingA, BarWrapper::Wrapping, FooWrapper::Wrapping,
$:.unshift(File.dirname(__FILE__) << '/../lib')
require 'clingwrap'
class Widget
def do_something
sleep 0.12
puts "Did something!"
end
end
Widget metaclass ancestors...
[Wrapper, Class, Module, Object, Kernel]
The 2 `new' methods get invoked...
Invoked Widget::new
Invoked Wrapper's new
The 2 `render_on' methods get invoked...
Invoked Wrapping's render_on
Invoked Widget#render_on