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
describe 'with an array with non bytes', -> | |
arg = [2, 4, -12] | |
subject = | |
try | |
type.dress(arg) | |
catch e | |
e | |
it 'should raise an error', -> |
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
def source_text(arg) | |
case arg | |
when IO then arg.read | |
when Path then Path(arg).read | |
else | |
raise "Unable to find source text for `#{arg}`" | |
end | |
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
Run options: exclude {:fails_on=>#<Proc:./spec/spec_helper.rb:32>, :unix=>false, :symlink=>false, :ruby=>#<Proc:./spec/spec_helper.rb:27>} | |
........FF...........................F.F.....F..FF...........F.....F......F............................................... | |
Failures: | |
1) Path implementation realpath | |
Failure/Error: not_exist.make_symlink('not-exist-target') | |
NotImplementedError: | |
symlink() function is unimplemented on this machine | |
# ./lib/epath/file.rb:65:in `symlink' |
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
source :rubygems | |
gem "temple" |
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
source :rubygems | |
gem "citrus" | |
gem "rspec" |
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
source "http://rubygems.org/" | |
gem "sinatra", "~> 1.3.0" | |
gem "thin" |
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 'http' | |
NB = 5 | |
times = [] | |
threads = (0..NB).map do |i| | |
Thread.new(i) {|nb| | |
t1 = Time.now | |
puts Http.get("http://127.0.0.1:3000") | |
t2 = Time.now | |
times[nb] = (t2-t1) |
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 Hash | |
def with(&block) | |
block.call *block.parameters.map{|x| self[x.last]} | |
end | |
end | |
# Example | |
h = {:name => "blambeau", :hobby => "ruby"} |
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
gem "grit", :git => "[email protected]:blambeau/grit.git" |
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 'wlang' | |
$vars = [] | |
dialect = WLang::dialect do | |
rule "#" do |parser, offset| | |
varname, reached = parser.parse(offset) | |
$vars << varname | |
["#{varname}", reached] |