Practical factory_girl
factory_girlを代表とするFixture Replacementライブラリによって、柔軟なテストデータの準備が容易にできるようになりました。
#!/bin/sh | |
/usr/share/mysql/scripts/mysql_install_db --basedir=/usr --user=mysql --datadir=/var/lib/mysql_tmpfs | |
/etc/init.d/mysql restart | |
/usr/bin/mysqladmin -u root password 'root' |
Enumerator.new {|y| loop { y << ('A'..'Z').to_a.sample } }.each_slice(4).take_while {|str| str.join != 'STAP'}.count |
grep -rl "/^" **/*.rb | xargs gsed -i "s/\/\^/\/\\A/g" | |
grep -rl "$/" **/*.rb | xargs gsed -i "s/\$\//\\\\z\//g" |
#!/usr/bin/env ruby | |
require 'yaml' | |
# target YAML file | |
# | |
# - id:1 | |
# name: 'fuga' | |
# age: 20 | |
# - id:2 |
require 'mini_magick' | |
require 'imlib2' | |
require 'benchmark/ips' | |
require 'fileutils' | |
require 'tapp' | |
THUMB_SIZE = 80 | |
SRC_DIR = Pathname('/Users/kenchan/Dropbox/Camera Uploads') | |
DEST_DIR = Pathname.pwd.join('tmp') |
{ | |
"$schema": "http://interagent.github.io/interagent-hyper-schema", | |
"definitions": { | |
"account-feature": { | |
"description": "An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku.", | |
"$schema": "http://json-schema.org/draft-04/hyper-schema", | |
"stability": "production", | |
"strictProperties": true, | |
"title": "Heroku Platform API - Account Feature", | |
"type": [ |
[root@db0e92112086 build-screen]# git clone http://49d7d66ae6f5f1d250bb0cbfce3ed439205f8e26@<my-github-enterprise-host>/kenchan/<repo>.git | |
Initialized empty Git repository in /tmp/build-screen/<repo>/.git/ | |
Password: | |
(空エンターでcloneできる) | |
[root@db0e92112086 build-screen]# git --version | |
git version 1.7.1 |
root@pool:/app# git diff | |
diff --git a/docker/pool/Dockerfile b/docker/pool/Dockerfile | |
index 18a1eea..7beaed3 100644 | |
--- a/docker/pool/Dockerfile | |
+++ b/docker/pool/Dockerfile | |
@@ -10,6 +10,12 @@ RUN curl -s https://get.docker.com/builds/Linux/x86_64/docker-latest -o docker | |
RUN chmod +x docker | |
RUN cp docker /usr/bin/ | |
+# Update git |
[6] pry(main)> class Hoge | |
[6] pry(main)* def fuga | |
[6] pry(main)* if false | |
[6] pry(main)* user =nil | |
[6] pry(main)* end | |
[6] pry(main)* user | |
[6] pry(main)* end | |
[6] pry(main)* def piyo | |
[6] pry(main)* user | |
[6] pry(main)* end |