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

Enjoy Agile Development

68139fbc12ae51c0a56cae151fc8c85f?s=47 ogom
March 05, 2016

Enjoy Agile Development

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

68139fbc12ae51c0a56cae151fc8c85f?s=128

ogom

March 05, 2016
Tweet

More Decks by ogom

Other Decks in Programming

Transcript

  1. ָ଎։ൃ on Rails ୈ71ճ Rubyؔ੢ ษڧձ Takashi Ogomori

  2. Enjoy Agile Development • ΋ͷͮ͘Γ͸ɺσϛϯάαΠΫϧ͕
 ޿͘ར༻͞Ε͍ͯ·͢ɻ • ൒ੈل΋લ͔Β࢖ΘΕ͍ͯ·͕͢
 ࠓͰ΋༗ޮʹ׆༻͞Ε͍ͯ·͢ɻ

  3. Discover to Deliver • σϛϯάαΠΫϧ͸ɺௐࠪɾઃܭɾ੡଄ɾൢചΛ
 ܧଓతʹ܁Γฦ͢͜ͱͰ͢ɻ • ࡞Δ΂͖΋ͷΛൃݟͯ͠ɺ࡞ͬͨ΋ͷΛެ։ͯ͠
 ͦͯ͠ɺ࡞Δ΂͖΋ͷΛൃݟ͠·͢ɻ %JTDPWFS

    %FTJHO %FWFMPQ %FMJWFS
  4. Ruby on Rails • WebΞϓϦέʔγϣϯϑϨʔϜϫʔΫͰ͢ɻ • ϦϨʔγϣφϧσʔλϕʔε (RDBMS) ͷ 


    Object-relational mapping ͕ར༻Ͱ͖·͢ɻ
  5. Design to Develop • ϖʔύʔϓϩτλΠϐϯά͞ΕͨεΩʔϚΛ
 ϋϯυτϨʔεͰίʔσΟϯά͠·͢ɻ • ίʔσΟϯάͰ΋σϛϯάαΠΫϧΛ͠·͢ɻ

  6. Database schema • εΩʔϚͰσϛϯάαΠΫϧΛར༻͠·͢ɻ • σʔλΛௐࠪ • εΩʔϚΛઃܭ • εΩʔϚΛ੡଄

    • σʔλΛݕࠪ
  7. 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]
  8. 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
  9. Seed Ruby Gems 1. gem 'seedbank', group: [:development, :test] 2.

    gem 'seed_dump', group: [:development, :test] 3. gem 'seed-fu', group: [:development, :test]
  10. 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
  11. Demonstration • Guard ͕ίʔσΟϯάͷฤूΛݕ஌ͯ͠ɺ೚ҙͷΞΫγϣϯΛ࣮ࢪ͠·͢ɻ ʢGuard Shell ͸ɺNo Run All ͷΦϓγϣϯͷվमΛ͍ͯ͠·͢ɻʣ

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

  13. None