話しをしたいポイントは3つ。
- 条件分岐を避けましょう
- 一時変数の使い方に注意しましょう
- 状態の使い方に気を使いましょう
これを徹底することで、バグの入り込む余地を最小限に保つプログラミングをしましょう。
require 'rspec' | |
require 'rr' | |
module RR | |
module Adapters | |
module Rspec | |
def self.included(mod) | |
RSpec.configuration.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER) | |
end | |
end |
require 'rubygems' | |
require 'rack' | |
run(lambda do | |
system 'killall X' | |
[200, { 'Content-Type' => 'text/plain' }, ['Goodbye!']] | |
end) |
gem 'rails3-generators' | |
gem 'mongoid', '>= 2.0.0.beta' | |
gem 'bson_ext' | |
gem 'haml' | |
gem 'hirb', :group => :development | |
gem 'what_methods', :group => :development | |
gem 'rspec-rails', '>= 2.0.0.beta', :group => :test | |
gem 'rr', :group => :test |
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |
# Copyright 1999-2009 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: $ | |
EAPI="2" | |
inherit elisp-common eutils mercurial toolchain-funcs | |
DESCRIPTION="The Go Programming Language" | |
HOMEPAGE="http://golang.org/" | |
SRC_URI="" |