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 | |
#-*- encoding: utf-8 -*- | |
require 'test/unit' | |
require 'hoge' | |
class HogeTest < Test::Unit::TestCase | |
def setup | |
@obj = Hoge.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
#!/bin/sh | |
if [ "start" = "$1" ] ; then | |
cd /cygdrive/c/mongodb/bin | |
./mongod.exe --dbpath=../data --auth > /dev/null & | |
elif [ "stop" = "$1" ] ; then | |
ps ax | grep '/bin/mongod' | awk '{print $1}' | xargs kill -9 | |
else |
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 | |
#-*- encoding: utf-8 -*- | |
require 'getoptlong' | |
#search_pattern = '-DVD-BOX-' | |
#replace_pattern = 'DVD-BOX ' | |
opts = GetoptLong.new( | |
['--confirm', '-c', GetoptLong::NO_ARGUMENT], |
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 | |
#-*- encoding: utf-8 -*- | |
require 'test/unit' | |
class RequireUtilTest< Test::Unit::TestCase | |
def self.add(dir) | |
dir = dir[0, dir.size - 1] if dir.end_with?('/') | |
Dir::glob(dir + '/**/*').each do |file| |
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 'mechanize' | |
agent = Mechanize.new | |
agent.get('http://hogehoge.com') | |
agent.page.at("a").attributes["href"].text | |
# at は一致した最初の要素を返す |
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
def camelize string | |
string.split('-').map do |word| | |
word.capitalize | |
end.join | |
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
#! ruby #-*- encoding: utf-8 -*- | |
class GenerateTestCase | |
TEMPLATE = <<-EOS | |
#! ruby | |
#-*_ encoding: utf-8 -*- | |
require 'test/unit' | |
class _CLASS_NAME_Test < Test::Unit::TestCase |
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
PWD=`pwd | xargs basename` | |
echo $PWD |
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/sh | |
IFS=" | |
" | |
WORK_DIR='./diff' | |
[ -d ${WORK_DIR} ] && rm -fr ${WORK_DIR} | |
mkdir ${WORK_DIR} | |
DIFF_TXT='diff.txt' | |
cvs -d USER_NAME@HOST:/path/to/repo rdiff -kk -s -u -r BEGIN_TAG -r END_TAG PROJECT_NAME > ${DIFF_TXT} |
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
# encoding: utf-8 | |
class StringDelete | |
def delete(str, del) | |
str.delete(del) | |
end | |
end | |
if __FILE__ == $0 | |
require 'test/unit' |