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
#!/usr/bin/env ruby | |
require 'ipaddr' | |
module Brainwash | |
module Help | |
extend self | |
def examples | |
<<-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 'formula' | |
class Forego < ScriptFileFormula | |
homepage 'https://github.com/ddollar/forego' | |
url 'https://godist.herokuapp.com/projects/ddollar/forego/releases/0.8.2/darwin-amd64/forego' | |
sha1 '62f4c0cb7e48647ca7c9ef4a801f49576b577d4a' | |
version '0.8.2' | |
test do | |
system "#{bin}/forego", "version" |
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
class AttachedFile < ActiveRecord::Base | |
belongs_to :parent, :polymorphic => true | |
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
current_path = File.expand_path(File.dirname(__FILE__)) | |
require File.join(current_path.split("/").collect {|p| current_path.split("/" + p).first + "/" + p}.reverse.detect {|p| File.exist?(p + "/spec_helper.rb")}, 'spec_helper') |
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
root = '/Users/henrik/Sites/auktion/spec/models/auction' | |
max = root.scan('/').length + 1 | |
x = max.times { |i| | |
path = "#{root}/#{'../'*i}spec_helper.rb" | |
unless (found = Dir[path]).empty? | |
break(File.expand_path(found.first)) | |
end | |
} | |
p x |