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
ruby -e 'puts $stdin.read.gsub(/method\s+([a-zA-Z"]*),\s+([a-z"]*)/){ "assert #{$2}, #{$1}" }' |
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
ruby -e 'puts $stdin.read.gsub(/method\s+([\w"]*),\s+([\w"]*)/){ "assert #{$2}, #{$1}" }' |
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
# use escapse squence | |
setopt prompt_subst | |
# prompt | |
local DEFAULT=$'%{\e[01;m%}' | |
local PURPLE=$'%{\e[01;35m%}' | |
local CYAN=$'%{\e[04;36m%}' | |
if [ $TERM = "dumb" ]; then | |
PROMPT="> " |
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
escape ^z^t | |
autodetach on | |
defscrollback 10000 | |
shell -$SHELL | |
shelltitle "$ |zsh" | |
startup_message off | |
bind s # disable keyboard lock |
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
# Generated by tortoisehg-config | |
[ui] | |
editor="C:\Program Files\Vim\vim72\gvim.exe" -c ":set fileencoding=cp932" | |
ignore=c:\home\hgignore.ini | |
[extensions] | |
hgext.win32text= | |
hgext.win32mbcs= | |
hgext.extdiff = | |
rebase = |
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
# -*- encoding: UTF-8 -*- | |
describe "Money" do | |
it "3000.yen で Moneyオブジェクトが生成できること" do | |
3000.yen.should == Money.create(3000, :yen) | |
end | |
describe "比較演算" do | |
it " == できること " do | |
(1000.yen == 1000.yen).should be_true | |
(1000.yen == 1000.dollar).should be_false |
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
# -*- encoding: UTF-8 -*- | |
describe "Money" do | |
it "3000.yen で Moneyオブジェクトが生成できること" do | |
3000.yen.should == Money.create(3000, :yen) | |
end | |
describe "比較演算" do | |
it " == できること " do | |
(1000.yen == 1000.yen).should be_true | |
(1000.yen == 1000.dollar).should be_false |
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
# encoding: utf-8 | |
describe "ボウリングのスコア" do | |
subject { BowlingGame.new } | |
[ | |
["すべてガーターの計算ができること", [0] * 21, 0], | |
["すべて1ピンの計算ができること", ([1, 1] * 10).concat([0]), 20], | |
["始めスペアの場合の計算ができること", [7, 3, 9, 0].concat([0] * 17), 28], | |
["最後スペアの場合の計算ができること", ([0] * 18).concat([7, 3, 9]), 19], | |
["先頭ストライクの計算ができること", [10, 0, 4, 3].concat([0] * 17), 24], | |
["最後ストライクの計算ができること", ([0, 0] * 9).concat([10,5,5]), 20], |
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
# 環境構築メモ | |
## rspec install | |
gem install rspec | |
## ansicon | |
https://github.com/adoxa/ansicon/downloads | |
解答して、x86\ansicon.exeを起動して テスト実行で カラーリング |
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 BowlingGame | |
attr_reader :rolls | |
def initialize(rolls) | |
@rolls = rolls | |
end | |
def score | |
(1..10).reduce([]) { |frame_calc_a, frame_number| | |
frame_calc_a << rolls[range(frame_number)] |