Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Enjoy Agile Development

ogom
March 05, 2016

Enjoy Agile Development

楽速開発
||
楽しく、そして速く開発する。

ogom

March 05, 2016
Tweet

More Decks by ogom

Other Decks in Programming

Transcript

  1. Basic Ruby Gems 1. gem 'pry-rails', group: [:development, :test] 2.

    gem 'factory_girl_rails', group: [:development, :test] 3. gem 'rspec-rails', group: [:development, :test] 4. gem 'spring-commands-rspec', group: [:development] 5. gem 'guard-rspec', require: false, group: [:development] 6. gem 'guard-shell', require: false, group: [:development] 7. gem 'ridgepole', group: [:development] 8. gem 'rails-erd', group: [:development]
  2. Guard Shell (Schema) 1. guard :shell, no_run_all: true do 2.

    watch(%r{^db/migrate/(.+)\.rb$}) do |m| 3. `rake db:migrate:reset` 4. `rake db:seed` 5. `rake erd` 6. `ridgepole -c config/database.yml --export --split --output db/schemas/schema.rb` 7. `cat db/schemas/#{m[1].split('_create_').last}.schema` 8. end 9. end
  3. Seed Ruby Gems 1. gem 'seedbank', group: [:development, :test] 2.

    gem 'seed_dump', group: [:development, :test] 3. gem 'seed-fu', group: [:development, :test]
  4. Guard Shell (Seed) 1. guard :shell, no_run_all: true do 2.

    watch(%r{^app/models/(.+)\.rb$}) do |m| 3. `rake erd` 4. end 5. watch(%r{^db/seeds/(.+)\.seeds.rb$}) do |m| 6. `rake db:seed:#{m[1].split(File::Separator).join(':')}` 7. `rake db:seed:dump EXCLUDE=created_at,updated_at FILE=tmp/db/dump.rb` 8. `cat tmp/db/dump.rb` 9. end 10.end
  5. Demonstration • Guard ͕ίʔσΟϯάͷฤूΛݕ஌ͯ͠ɺ೚ҙͷΞΫγϣϯΛ࣮ࢪ͠·͢ɻ ʢGuard Shell ͸ɺNo Run All ͷΦϓγϣϯͷվमΛ͍ͯ͠·͢ɻʣ

    • db/migrate ͕ฤू͞ΕΔͱɺεΩʔϚ͕࠶ߏங͞Εͯ
 σʔλ΋࠶ొ࿥͠·͢ɻฤूͨ͠εΩʔϚ͕දࣔ͞Ε·͢ɻ • app/models ͕ฤू͞ΕΔͱɺ࠷৽ͷ ERD ͕දࣔ͞Ε·͢ɻ • db/seeds ͕ฤू͞ΕΔͱɺͦͷσʔλ͕࠶ొ࿥͞Εͯ
 σʔλͷμϯϓ͕දࣔ͞Ε·͢ɻ • db/seeds ͷσʔλ͸ FactoryGirl Ͱੜ੒͞Ε͍ͯ·͢ɻ
 ͦͷ FactoryGirl ͷ஋͸ RSpec Ͱςετ͞Ε͍ͯ·͢ɻ