Skip to content

Instantly share code, notes, and snippets.

View chinmo's full-sized avatar

Tomonori Fukuta chinmo

View GitHub Profile
@chinmo
chinmo / gist:6195212
Last active December 20, 2015 21:08
http://morizyun.github.io/blog/ruby-design-pattern-14-abstract-factory/ を読んで考えた。 Client のインスタンスが ConcreteFactory に Product の生成を委ねるという形で捉え直した。つまり、 * Client ... 好みの ConcreteFactory (FlagAndAlgaeFactory or DuckAndWaterLilyFactory) で望みの生態系をつくる。個人的には Client が Pond だと良さそう。 * AbstractFactory ... Pond ではなく、OrganismFactory としてみた
# Product 1
class Frog
def initialize(name)
@name = name
end
def eat
puts "カエル #{@name} は食事中です"
end
end
@chinmo
chinmo / gist:5559724
Last active December 17, 2015 05:39
標準的なjavaライブラリだけでredmineにissue作る
import java.io.*;
import java.net.*;
public class Test {
public static void main(String [] args) {
try {
String content="{\"issue\": {\"project_id\": 1, \"subject\": \"Example\"}}";
log(content);
Simulaを知れば良いのかマービン・ミンスキー
→フレーム理論(知識の表象)
→?→LOGO
→アラン・ケイ
→OO ?
http://jibun.atmarkit.co.jp/ljibun01/rensai/gyoukai/042/01.html
で、ケイはシミュレートシミュレート言ってるので、
# coding: utf-8
前提 /^登録済みのユーザが$/ do
@user = User.create(name: "Example User", email: "user@example.com", password: "foobar", password_confirmation: "foobar")
end
もし /^ログインページでログイン情報を入力する$/ do
visit signin_path
fill_in "Email", with: @user.email
fill_in "Password", with: @user.password
# language: ja
フィーチャ: ログイン状態を維持する
ユーザとして、
ログイン状態を維持したい。
なぜなら、頻繁にログイン作業をする負担を軽減したいからだ。
シナリオ: ユーザを覚えているのでしばらくの間再ログインしなくても良い
前提 登録済みのユーザが
もし ログインページでログイン情報を入力する