Skip to content

Instantly share code, notes, and snippets.

View viniciussbs's full-sized avatar

Vinícius Sales viniciussbs

  • Rio de Janeiro, Brasil
View GitHub Profile
require "money"
class Decorator < BasicObject
undef_method :==
def initialize(component)
@component = component
end
def method_missing(name, *args, &block)
~ % ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10]
~ % rvm list
rvm rubies
ruby-1.9.2-p0 [ x86_64 ]
~ % rvm use 1.9.2@rails2
#!/usr/bin/env ruby
git_dir = '/home/i0n/git'
# git_dir = '/Users/i0n/sites/bin/'
app_name = ARGV
Dir.chdir git_dir
Dir.mkdir "#{app_name}.git"
Dir.chdir "#{git_dir}/#{app_name}.git"
system "git init --bare"
puts "SUCCESS!"
# Returns a copy of self with all +true+ elements removed.
# [ "a", true, "b", true, "c", true].compact_true #=> [ "a", "b", "c" ]
#
def compact_true
remove_elements(TrueClass)
end
# Returns a copy of self with all +false+ elements removed.
# [ "a", false, "b", false, "c", false].compact_true #=> ["a","b","c" ]
#