- 名前(任意)
- KONDO Uchio
- Twitter or Facebookのアカウント or HN等
- @udzura
- http://blog.udzura.jp
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
# Homebrew のインストール | |
# 公式 (http://brew.sh/) に載っているコマンドです | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Ruby のビルドに必要なものをインストール | |
brew install openssl readline rbenv ruby-build # 時間がかかります | |
# rbenv 用の設定を .bash_profile に書き込む | |
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile |
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 Moge | |
def moge1; p "Moge#moge1"; end | |
def moge2; p "Moge#moge2"; end | |
end | |
module OverwrapMoge | |
def moge1 | |
super | |
# It's a fancy ruby wolrd | |
self.class.instance_method(:moge2).bind(self).call |
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 generate_name | |
begin | |
name = Digit.generate(6) | |
end while Image.exists?(name: name) | |
name | |
end | |
def generate_name | |
loop do | |
name = Digit.generate(6) |
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
describe Object do | |
context "extented with MyModule" do | |
before(:all){ subject.extend(MyModule) } | |
it "should define #some_method" do | |
subject.should respond_to(:some_method) | |
end | |
end | |
end | |
describe Class do |
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
project :test => :shoulda, :renderer => :haml, :stylesheet => :sass, :script => :jquery, :orm => :activerecord | |
#default routes | |
APP_INIT = <<-APP | |
get "/" do | |
"Hello World!" | |
end | |
get :about, :map => '/about_us' do | |
render :haml, "%p This is a sample blog created to demonstrate the power of Padrino!" |