- マルチプラットフォーム
- 最初から良い感じに使える
- 設定ファイルがJSON
- 拡張がPythonで書ける
- プロプライエタリ
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 TransfersControllerTest < ActionController::TestCase | |
| test "POST#create" do | |
| source = Account.new(:balance => 900) | |
| destination = Account.new(:balance => 900) | |
| Account.expects(:find).with('1').returns(source) | |
| Account.expects(:find).with('2').returns(destination) | |
| post :create, :account_id => '1', | |
| :destination_id => '2', | |
| :amount => '500' | |
| assert_equal 400, source.balance |
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
| source :rubygems | |
| gem 'rspec' | |
| gem 'capybara' | |
| gem 'rake' |
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
| set encoding=utf-8 | |
| set fileencodings=utf-8,euc-jp | |
| set expandtab "タブ入力を複数の空白入力に置き換える | |
| set tabstop=4 "画面上でタブ文字が占める幅 | |
| set shiftwidth=4 "自動インデントでずれる幅 | |
| set softtabstop=4 "連続した空白に対してタブキーやバックスペースキーでカーソルが動く幅 | |
| set autoindent "改行時に前の行のインデントを継続する | |
| set smartindent "改行時に入力された行の末尾に合わせて次の行のインデントを増減する | |
| filetype plugin indent on |
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
| /Users/yuta% sudo php-build 5.3.9 ~/.phpenv/versions/5.3.9 | |
| Password: | |
| [Info]: Loaded pyrus Plugin. | |
| [Info]: Loaded xdebug Plugin. | |
| [Info]: php.ini-production gets used as php.ini | |
| [Info]: Building 5.3.9 into /Users/yuta/.phpenv/versions/5.3.9 | |
| [Skipping]: Already downloaded and extracted http://www.php.net/distributions/php-5.3.9.tar.bz2 | |
| [Preparing]: /var/tmp/php-build/source/5.3.9 | |
| [Compiling]: /var/tmp/php-build/source/5.3.9 | |
| [Pyrus]: Downloading from http://pear2.php.net/pyrus.phar |
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
| # expect to の書き方が推奨されているので書きなおす | |
| # https://github.com/rspec/rspec-rails | |
| # ↓ 落ちる | |
| it "routes to #show" do | |
| expect(get: "/entries/1").to route_to(controller: "entries", action: "show", id: "1") | |
| end | |
| Failures: |
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
| # http://blog.uu59.org/2011-10-03-sinatra-stream.html | |
| require "rubygems" | |
| require "sinatra" | |
| set :server, :thin # 注: :keep_openが使えるのはイベントベースのサーバだけなのでthinを明示的に指定してる | |
| connections = [] | |
| get '/' do | |
| # keep stream open |
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
| # -*- coding: utf-8 -*- | |
| presenters = %w(mizzyさん fuchinoさん demiさん kulopさん わじさん ライティさん まよとさん あんちぽさん あよはたさん \ | |
| うーたんさん うまづらさん テリーさん けんごさん tnmtさん) | |
| presenters.shuffle! | |
| presenters.each_with_index do |presenter, index| | |
| puts "#{index+1}. #{presenter}" | |
| end |
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 Formatter | |
| def output_report(title, text) | |
| raise 'Abstruct method called' | |
| end | |
| end | |
| class HTMLFormatter < Formatter | |
| def output_report(title, text) | |
| puts '<html>' | |
| puts '<head>' |
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 | |
| # | |
| require 'nkf' | |
| class PhoneticMap | |
| def data | |
| @data ||= build_data | |
| end | |
| def index_of(string) |