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 sh(cmd, &block) | |
out, code = sh_with_code(cmd, &block) | |
code == 0 ? out : raise(out.empty? ? "Running `#{cmd}' failed. Run this command directly for more detailed output." : out) | |
end | |
def sh_with_code(cmd, &block) | |
cmd << " 2>&1" | |
outbuf = '' | |
Bundler.ui.debug(cmd) | |
Dir.chdir(base) { |
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 C1 | |
SOME_CONST=3 | |
@@some_class_var = 3 | |
end | |
class C2<C1 | |
SOME_CONST=7 | |
end | |
class C3<C1 |
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
perl -i -p -e 's/\n//' file | |
tr -d '\n' < file |
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 test_auto_closing_tags | |
reader = Nokogiri::XML::Reader.from_memory(<<-eoxml) | |
<xml><city>Paris</city><state/></xml> | |
eoxml | |
assert_equal [false, false, nil, nil, true, nil], | |
reader.map{|node| node.empty_element? if node.node_type == Nokogiri::XML::Node::ELEMENT_NODE} | |
end |
NewerOlder