This file contains 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
javascript:( | |
function (){ | |
var json = JSON.parse(document.body.innerText); | |
var create = function(el, props) { | |
var e = document.createElement(el); | |
if (props) { | |
Object.keys(props).forEach(function(key) { | |
e[key] = props[key]; | |
}); |
This file contains 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
# MultiRuby Switcher: see multiruby for installs | |
mrs() { | |
local path="$HOME/.multiruby/install/$1/bin:" | |
if test "$1" = "system" -o "$1" = ""; then | |
echo >&2 "using system" | |
path= | |
elif ! test -d "${path%:}"; then | |
echo >&2 "$1 not available" | |
return 1 | |
fi |
This file contains 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
$ ruby /tmp/ruby.rb -v | |
Run options: -v --seed 24668 | |
# Running: | |
sleeping | |
TestReporting#test_slow = 1.00 s = . | |
sleeping | |
TestReporting#test_really_slow = 2.00 s = . |
This file contains 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
diff --git a/lib/minitest/spec.rb b/lib/minitest/spec.rb | |
index 5c27a99..64265f0 100644 | |
--- a/lib/minitest/spec.rb | |
+++ b/lib/minitest/spec.rb | |
@@ -8,10 +8,10 @@ def infect_an_assertion meth, new_name, dont_flip = false # :nodoc: | |
self.class_eval <<-EOM | |
def #{new_name} *args | |
case | |
- when Proc === self then | |
- Minitest::Spec.current.#{meth}(*args, &self) |
This file contains 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
#!/bin/bash | |
attach() { | |
tmux attach-session -t ${1:-$name} | |
} | |
list() { | |
if [[ "$1" == 'short' ]]; then | |
local args='-F #{session_name}' | |
shift |
This file contains 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
#!/bin/bash | |
server=$1 | |
port=$2 | |
lport=${3:=$port} | |
# stdout will be server | |
# stderr will be client | |
exec 3>&1 |
This file contains 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 Foo | |
## | |
# Public: This is my foo route | |
# | |
# See #/bar for examples (but it doesn't link) | |
# But this[#baz] does | |
get '/foo' do | |
end |
This file contains 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 install image_science -v 1.2.3 | |
gem install image_science -v 1.2.4 | |
export INLINEDIR=/tmp/.ruby_inline | |
ruby -e "gem 'image_science', '1.2.3'; require './test_inline.rb'" | |
ruby -e "gem 'image_science', '1.2.4'; require './test_inline.rb'" | |
rm -rf /tmp/.ruby_inline |
This file contains 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
module A | |
def test_whatever | |
flunk 'sucks' | |
end | |
end |
This file contains 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
## | |
# This method gets doc'd | |
# | |
# :method: foo | |
add_my_method :cool, :method | |
## | |
# This method does not get doc'd | |
# |