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 Bottles | |
# ... verse() method not shown for brevity ... | |
def verses(upper_bound, lower_bound) | |
upper_bound | |
.downto(lower_bound) | |
.collect {|verse_number| verse(verse_number)} | |
.join("\n") | |
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
class Bottles | |
# ... verse() method not shown for brevity ... | |
def verses(upper_bound, lower_bound) | |
"#{verse(upper_bound)}\n#{verse(lower_bound)}" | |
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
# ... previous setup and tests not shown for brevity ... | |
def test_a_couple_verses | |
expected = <<-VERSES | |
99 bottles of beer on the wall, 99 bottles of beer. | |
Take one down and pass it around, 98 bottles of beer on the wall. | |
98 bottles of beer on the wall, 98 bottles of beer. | |
Take one down and pass it around, 97 bottles of beer on the wall. | |
VERSES |
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 Bottles | |
def verse(num) | |
case num | |
when 0 | |
"No more bottles of beer on the wall, no more bottles of beer.\n" + | |
"Go to the store and buy some more, 99 bottles of beer on the wall.\n" | |
when 1 | |
"1 bottle of beer on the wall, 1 bottle of beer.\n" + | |
"Take it down and pass it around, no more bottles of beer on the wall.\n" |
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 Bottles | |
def verse(num) | |
case num | |
when 89 | |
"89 bottles of beer on the wall, 89 bottles of beer.\n" + | |
"Take one down and pass it around, 88 bottles of beer on the wall.\n" | |
when 99 | |
"99 bottles of beer on the wall, 99 bottles of beer.\n" + | |
"Take one down and pass it around, 98 bottles of beer on the wall.\n" |
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 Bottles | |
def verse(num) | |
"99 bottles of beer on the wall, 99 bottles of beer.\n" + | |
"Take one down and pass it around, 98 bottles of beer on the wall.\n" | |
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
require_relative '../../test_helper' | |
require_relative '../lib/bottles' | |
class BottlesTest < Minitest::Test | |
attr_reader :bottles | |
def setup | |
@bottles = ::Bottles.new | |
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
ssh -L 9210:localhost:9200 user@servername.com |
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
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 \ | |
gem install nokogiri -- \ | |
--with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config \ | |
--with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config | |
https://github.com/sparklemotion/nokogiri/issues/1049 |
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
{ | |
"name": "http-server", | |
"preferGlobal": true, | |
"version": "0.3.0", | |
"author": "Nodejitsu <support@nodejitsu.com>", | |
"description": "a simple zero-configuration command-line http server", | |
"contributors": [ | |
{ | |
"name": "Marak Squires", | |
"email": "marak@nodejitsu.com" |