Rebuilding Rails的心得
Ch1 Zero to “It Works!” Gem的檔案結構 $ bundle gem rulers create rulers/Gemfile create rulers/Rakefile create rulers/LICENSE.txt create rulers/README.md create rulers/.gitignore create rulers/rulers.gemspec # !! create rulers/lib/rulers.rb # !! create rulers/lib/rulers/version.rb Initializating git repo in src/rulers rulers/rulers.gemspec放的是gem的資訊與dependency rulers/lib/rulers.rb就是主程式 dependency分成development與runtime # rulers.gemspec gem.add_development_dependency "rspec" gem.add_runtime_dependency "rest-client" rack進入點 與 rack app回傳值的資料結構 # best_quotes/config.ru run proc { [200, {'Content-Type' => 'text/html'}, ["Hello, world!"]] } 狀態值,header,資料 rack app 的 interface # rulers/lib/rulers.rb require "rulers/version" module Rulers class Application def call(env) [200, {'Content-Type' => 'text/html'}, ["Hello from Ruby on Rulers!...