MySQL 세팅과 동일하다.
$ vi Gemfile
MySQL 세팅과 동일하다.
$ vi Gemfile
https://github.com/guard/guard
몇 가지 규칙에 따라 자동으로 뭔가를 해주는 프로그램.
일단 브랜치를 하나 만들고 작업 시작.
woowahan-api-demo
-> https://github.com/ahastudio/woowahan-api-demo
$ brew install sqlite3
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update && brew upgrade
| require "csv" | |
| class Lottery | |
| def initialize | |
| filename = File.expand_path(File.dirname(__FILE__) + '/data.csv') | |
| @names = CSV.read(filename)[1..-1].map{|row| row[0]} | |
| end | |
| def random | |
| @names[rand(@names.size)] |
| def application(name, &block) | |
| $app = Application.new | |
| $app.name = name | |
| $app.instance_eval(&block) | |
| end | |
| class Application | |
| attr_accessor :name | |
| def initialize |
| $npcs = {} | |
| def say(words) | |
| puts words | |
| end | |
| def npc(name, &block) | |
| $npcs[name] = block | |
| end |