Authlogicは、簡潔で柔軟なRubyで記述された認証ソリューションです。
コードで例示して説明した方がいいでしょう…
Authlogicでは新しい型のモデルを提供しています。他のモデルのようにいくつでもどんな名前で必要なだけ作成することができます。この例では、クラス名から分かるようにUserモデルを使って認証を行おうとしています。
class UserSession < Authlogic::Session::Base # ここでは以下のように設定項目を記述します:
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" > | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | |
| <title>SWFUpload v2 文書</title> | |
| </head> | |
| <style type="text/css"> | |
| h1 /* Title */ { | |
| } |
RR (Double Ruby、ダブルRuby)は、豊富なダブル化技術と簡潔な文法を備えたテストダブルフレームワークです。
| **RRの紹介** | |
| ダブル Ruby の省略である RR という名前の新しいテストダブルフレームワークを紹介できてうれしく思います。 | |
| テストダブルは、[ダブルの説明]です。テストダブルについての詳細を http://xunitpatterns.com/Test%20Double.html で読むことができます。 | |
| RR は次の構成をサポートしています: | |
| * Mock | |
| * Stub | |
| * instance_of | |
| * Probe |
| $ gdb $HOME/.rbenv/versions/1.9.3-debug/bin/ruby /cores/core.65588 | |
| GNU gdb 6.3.50-20050815 (Apple version gdb-1822) (Sun Aug 5 03:00:42 UTC 2012) | |
| Copyright 2004 Free Software Foundation, Inc. | |
| GDB is free software, covered by the GNU General Public License, and you are | |
| welcome to change it and/or distribute copies of it under certain conditions. | |
| Type "show copying" to see the conditions. | |
| There is absolutely no warranty for GDB. Type "show warranty" for details. | |
| This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done | |
| Reading symbols for shared libraries . done |
| context '納品書から' do | |
| context '請求書を変換する場合' do | |
| before do | |
| @user = FactoryGirl.create(:user) do |u| | |
| u.sender.bank_accounts.create(detail: 'Foo Bank') | |
| end | |
| end | |
| it '請求元の銀行口座の情報をコピーする' do | |
| invoice = described_class.from(@user.delivery_slips.first).to(:invoice) |
| class Greeter | |
| def initialize(time_proc = -> { Time.now.strftime("%H:%M:%S") }) | |
| @time_proc = time_proc | |
| end | |
| def greet | |
| time = @time_proc.call | |
| if '05:00:00' <= time && time < '12:00:00' | |
| 'おはようございます' | |
| elsif '12:00:00' <= time && time < '18:00:00' |
| # encoding: utf-8 | |
| require 'yaml' | |
| class Executer | |
| def initialize(dir) | |
| @dir = dir | |
| end | |
| def execute | |
| files do |file| |
I hereby claim:
To claim this, I am signing this object:
http://www.phoenixframework.org/docs/installation
$ sudo xcode-select --install