ããã«ã¡ã¯ãWeb ã¨ã³ã¸ãã¢ã® @kechol ã§ãã
Quipper ã§ã¯ç¾å¨ãããã°ãåéããã StudySapuri Meetupï¼Product åãData åï¼ãéå¬ãããã¨ãæ¡ç¨æ´»åã«åãå ¥ãã¦ãã¾ããä»æ¥ã¯ãããªæ¡ç¨æ´»åã«ã¤ãã¦ãåãé¢ãã£ã¦ãã Web ã¨ã³ã¸ãã¢ã®æ¡ç¨ããã»ã¹ã®è£å´ãå°ããç´¹ä»ãããã¨æãã¾ãã
TL;DR
- Quipper ã«ããã Web ã¨ã³ã¸ãã¢æ¡ç¨ããã»ã¹ã«ããã¦ã¯ãã³ã¼ããã¹ããå®æ½ãã¦ããããã®ããã»ã¹ã¯é常ã«éè¦ãªãã®ã ã¨èãã¦ãã
- ããã¾ã§ã¢ããªã±ã¼ã·ã§ã³ãæ¸ãã¦ããããããªãã¹ããå®æ½ãã¦ããããåè£è ã»æ¡ç¨ã¡ã³ãã¼åæ¹ã®è² æ ã大ãããæ¹åã®ä½å°ããã£ã
- ãããåãã¦ãããå°ãããå®åã«è¿ãã³ã¼ãã§ãã¹ãã§ããããã«ã³ã¼ããã¹ããæ¹åãã
Quipper ã«ããã Web ã¨ã³ã¸ãã¢ã®æ¡ç¨ããã»ã¹
Quipper ã«ããã Web ã¨ã³ã¸ãã¢ã®åºæ¬çãªæ¡ç¨ããã»ã¹ã¯ãç¾å¨ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
- æ¸é¡ã®ã¹ã¯ãªã¼ãã³ã°
- ä¸æ¬¡é¢æ¥
- ã³ã¼ããã¹ã
- äºæ¬¡é¢æ¥
- VP of Engineering é¢æ¥
- ãªãã¡ã¼é¢è«
Quipper ã§ã¯ããã®æ¡ç¨ããã»ã¹ã«ã¯ Web ã¨ã³ã¸ãã¢ã Engineering Manager ãç©æ¥µçã«é¢ãã£ã¦ãããå ¨ã¦ã®ããã»ã¹ãéã㦠Web ã¨ã³ã¸ãã¢ãåè£è ã®è©ä¾¡ãè¡ãã¾ãã
åããã»ã¹ã®è©³ç´°ã«ã¤ãã¦ã¯ãå¼ç¤¾ã® Quipper Web Engineer æ±äº¬ãªãã£ã¹æ¡ç¨é¢æ¥ã¬ã¤ã ãã覧ãã ããã
ã³ã¼ããã¹ãã¨ããã¹ããã
æ¡ç¨ããã»ã¹ã®ä¸ã§ãé¢æ¥ããããã¨ã¯å½ç¶ã§ãã£ã¦ããã³ã¼ããã¹ããè¡ããªãä¼ç¤¾ããããã¨æãã¾ããããã Quipper ã«ããã¦ãWeb ã¨ã³ã¸ãã¢ã®æ¡ç¨ã¡ã³ãã¼ã¯ãã©ãããå½¢ã§ããã³ã¼ããã¹ãã®ããã»ã¹ãé常ã«éè¦ãªã¹ãããã¨èãã¦ãã¾ãã
Web ã¨ã³ã¸ãã¢ãå«ããã½ããã¦ã§ã¢ã¨ã³ã¸ãã¢ã¨ããè·ã¯ãã³ã¼ããæ¸ããã¨ã§ç¾å®ã®åé¡ã解決ãã¦ãããã¨ãéè¦ãªè·åã®ä¸ã¤ã§ãããã®è·åãä»»ããããæ¹ããè¦æ¥µããããã«ããã®æ¹ãæ¸ããã³ã¼ããè¦ã¦å¤æããã¨ãããã¨ã¯çã«ããªã£ã¦ããã¨è¨ããã¨æãã¾ããé¢æ¥ã®ãããªå ´ã GitHub çã®å ¬éãªãã¸ããªã§ã¯ãå®éã«ãã®æ¹ãå®åã§æ¸ããã³ã¼ããè¦ãããæ©ä¼ã¯å°ãªããããããæå³ã§ã³ã¼ããã¹ãã¨ããã¹ãããã¯æ¡ç¨ããã»ã¹ã«ããã¦å¿ é ã§ããã¨èãã¦ãã¾ãã
ããã«ããã®å ã®äºæ¬¡é¢æ¥ã«ãããè°è«ãéãã¦ãå®éã«ä¸ç·ã«åããéã«ã©ã®ãããªã³ãã¥ãã±ã¼ã·ã§ã³ã«ãªããã確ããããã¨ãã§ãããã¨ããç¹ãéè¦ã§ããç§ãã¡ã¯æ®æ®µãã¼ã ã§éçºãè¡ã£ã¦ãããProduct Manager ã Web ã¨ã³ã¸ãã¢å士ã§ä»æ§ãå®è£ ã«ã¤ãã¦è°è«ããã¨ãããã¨ãå½ããåã«è¡ã£ã¦ãã¾ããããããå®åä¸ã®ã³ãã¥ãã±ã¼ã·ã§ã³ããã¡ãã¨åããæ¹ã§ããããè¦æ¥µãããã¨ãæ¡ç¨ããã»ã¹ã®ä¸ã§ã¯å¤§åã§ãã
å®éã³ã¼ããã¹ããå®æ½ãã¦ããã¨ãé¢æ¥ã§ã®å°è±¡ã¨ã¯å ¨ãéãçµè«ã«è³ããã¨ããããã¹ã¯ãªã¼ãã³ã°ããã»ã¹ã¨ãã¦ã¯æå¹ã«æ©è½ãã¦ããã¨èãã¦ãã¾ãã
ã³ã¼ããã¹ãã®æ¯é
Quipper ã§ã¯å¾æ¥ãåºæ¬ç㪠CRUD æä½ãªã©ä»æ§ãæºããå°ã㪠Web ã¢ããªã±ã¼ã·ã§ã³ããã¹ããå«ãã¦æ¸ãã¦ãã¦ããããã¨ããå½¢å¼ã®ã³ã¼ããã¹ããå®æ½ãã¦ãã¾ãããããã®ã³ã¼ããã¹ãã®ã¹ããããæ¡ç¨åè£è ã«ã¨ã£ã¦ããæ¡ç¨ã¡ã³ãã¼ã«ã¨ã£ã¦ãè² æ ãå¼·ãããããã®ã§ãããã¨ããã®ãäºå®ã§ããã
èªåããã®ã³ã¼ããã¹ããåãã¦å ¥ç¤¾ããä¸äººã§ã¯ããã¾ãããåè£è ã«ã¨ã£ã¦ã転è·æ´»åãããä¸ã§ãã¾ãä»äºã家åºã®äºæ ãããä¸ã§ãWeb ã¢ããªã±ã¼ã·ã§ã³ãä¸ã¤ä½ãã¨ãããã¨ãè² æ ã§ãããã¨ã¯æ³åã«ãããããã¾ããã
ã¾ããå°ã㪠Web ã¢ããªã±ã¼ã·ã§ã³ã¨è¨ã£ã¦ãã人ã«ãã£ã¦æ¸ãããã¯æ§ã ã§ããç¹ã« Quipper ã§ã¯ä»¥ä¸ã®ãããªåé¡ãããã¾ããã
- åå¦ã®å¤æããã¦ããé¨åã¨ã¯å¥ã®é¨åã«æéãããã¦ãã¾ãããã¨
- ä»æ§ãæºããã°æè¡ãèªç±ã«é¸å®ãããã ãããã¨æãã°ãããã§ããã ããã¦ãã¾ããã
- åè£è ã«ã¨ã£ã¦ã¯ããå¤ãã®æè¡ãè¦ããã»ããåæ ¼ç¢ºçãä¸ããã ãããã¨ããã¤ã³ã»ã³ãã£ããåããã
- åè£è
ã«ãã£ã¦å©ç¨ãã¦ãããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªã大ããéãå ´åããããã¨
- Quipper ãå®éã«ä½¿ç¨ããæè¡ãæ¨å¥¨ãã¦ã¯ãããã®ã®ãåè£è èªèº«ã®å¤æã§èªç±ã«æè¡è¦ç´ ãé¸ã¹ã¦ãã¾ããã
æçµçã«åè£è ã®åå¦ã決å®ããªããã°ãããªãã¨ããå ´é¢ã§ã¯ããããã£ãã±ã¼ã¹ã¯ã¬ãã¥ã¼ããå´ã§ã®åå¦ã®å¤æãé£ãããã¬ãã¥ã¼ã«æéãããããåå¦çµæã«æºããããå¾ãã¨ããæ¸å¿µãããã¾ããã
ããããã³ã¼ããã¹ãã®åé¡ç¹ã«ã¤ãã¦ãæ¡ç¨ã¡ã³ãã¼ã®éã§ãè°è«ã¨ãªããã³ã¼ããã¹ãã®è¦ç´ãããããã¨ã¨ãªãã¾ããã
ã³ã¼ããã¹ãã®è¦ç´ã
ã³ã¼ããã¹ããè¦ç´ãã«ããã£ã¦ã¯ããªãã¹ãåè£è ã®è² æ ã«ãªããªãå½¢ã§å®æ½ã§ãããã¤ããã¹ãã«åæ ¼ããåè£è 㯠Quipper ã§æ´»èºã§ãããã¨ãä¿è¨¼ã§ãããã¨ãããã¨ãçæ³çã ã¨èãã¦ãã¾ãã
ã¾ãåè£è ã®è² æ ãæ¸ããã«ããã£ã¦ã¯ãWeb ã¢ããªã±ã¼ã·ã§ã³ã丸ãã¨ä¸ã¤ä½ã£ã¦ããã ãã®ã§ã¯ãªãããã®ä¸ã®è¦ç´ æè¡ãã³ã¢ãã¸ãã¯ã«çµã£ã¦åºé¡ãããããªå½¢ã«å¤æ´ãããã¨ã§ãåè£è ã«ä½ãåçã¨ãã¦æ±ãã¦ããã®ãæ確ã«ãªãããã«ãã¦ããããã¨èãã¾ããã
ã¾ãããã¹ãã«åæ ¼ããæç¹ã§ Quipper ã§æ´»èºã§ãããã¨ãä¿è¨¼ã§ããããã«ããããã«ã¯ãããå®åçãªã³ã¼ãããã¹ãã¨ãã¦åºé¡ããå¿ è¦ãããã¨èãã¾ãããfizzbuzz ã®ãããªåºæ¬çãªããã°ã©ãã³ã°è½åãåãåé¡ã ãã§ã¯ä¸ååã§ãããQuipper ã§å©ç¨ãã¦ãã Web ã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã使ã£ããã¸ãã¯ãæ¸ãããã©ããã確èªãããã®ã§ãã
å®éã®ã³ã¼ããã¹ãã®ã¤ã¡ã¼ã¸
ã³ã¼ããè¦ããã»ããã¤ã¡ã¼ã¸ã湧ãã ããæãã®ã§ãç¾å¨ã®ã³ã¼ããã¹ãã¨ä¼¼ããã³ãã¬ã¼ãããè¦ããã¾ããä¸è¿°ã®éããæ°ããã³ã¼ããã¹ãã«ããã¦ã¯ãåè£è ã«åçãæ±ããé¨åãæ確ã§ããã¤å®åã®ã³ã¼ãã«è¿ããããªãã®ã«ãªããã¨ãçæ³ã¨ãã¦ãã¾ãã
ããããçæ³ãå¶ããããã«ã以ä¸ã®ãããªãã¹ããèãã¦ãã¾ãã
require "bundler/inline" gemfile do source "https://rubygems.org" gem "activerecord" gem "sqlite3" gem "minitest" end require "active_record" require "minitest/autorun" class Question < ActiveRecord::Base validates :content, presence: true validates :answer, numericality: { only_integer: true, greater_than: 0 } def self.with_prime_answers_under_100 # TODO: Implement me! end end class QuestionTest < Minitest::Test def setup ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveRecord::Schema.define do create_table :questions do |t| t.string :content, null: false t.integer :answer, null: false end end 101.downto(1) do |i| Question.create!(content: "Question #{i}", answer: i) end end def test_with_prime_answers_under_100 questions = Question.with_prime_answers_under_100 primes = Set[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] assert_equal primes, questions.map(&:answer).to_set end end
ãã®ãã¹ã㯠100 以ä¸ã®ç´ æ°ãåçã«ã㤠Question ã DB ããåå¾ãåæããã¡ã½ãã Question.with_prime_answers_under_100
ãå®è£
ãã¦ããããã¹ãã§ãã
ã·ã³ãã«ã«è§£ãã¨ä»¥ä¸ã®ãããªæãã«ãªãã¨æãã¾ãã
@@ -8,6 +8,7 @@ gemfile do end +require "prime" require "active_record" require "minitest/autorun" @@ -16,7 +17,7 @@ class Question < ActiveRecord::Base validates :answer, numericality: { only_integer: true, greater_than: 0 } def self.with_prime_answers_under_100 - # TODO: Implement me! + where(answer: Prime.each(100).to_a) end end
ãã®ãã¹ãã§ä½¿ããã¦ãã ActiveRecord ã¯æ®æ®µ Rails ãæ¸ãã¦ãã Web ã¨ã³ã¸ãã¢ã«ã¨ã£ã¦é¦´æã¿ã®ãããã®ã§ãããåã« 100 以ä¸ã®ç´ æ°ãåæã§ãããã¨ãããããªããã°ã©ãã³ã°è½åã®åé¡ã«å ãã¦ãDB ã¸ã®ã¢ã¯ã»ã¹æ°ãæ³å®ã§ããããRails ã® Model ã¨ãã¦ã©ã®ããã«ã³ã¼ããæ§æãããã¨ãã£ã観ç¹ãåºã¦ãã¾ãã
ã¾ãããã®å½¢å¼ã«ã¯ä»ã«ã以ä¸ã®ãããªã¡ãªãããããã¾ãã
- è¦ãã観ç¹ãæ確ã«ãã¦ããå°ããªæ§æã«ã¾ã¨ãããã¨ã§ãåè£è ããã¸ãã¯ãæ¸ãå§ããã¾ã§ã®è¿·ãããªããªã
- å®è¡ã§ãããã¹ããä¸ç·ã«æä¾ãããã¨ã§ãæå¾ ããä»æ§ãæºããã¦ãããã©ããã®å¤æã容æã«ãªã
å®éã®åå¦å¤æã«ããã¦ã¯ããã¹ããéã£ã¦ãããã¨ãåæã¨ãã¦ãæ¸ãã¦ããã ããã³ã¼ããåãããè¦ã¦çã«ããªã£ã¦ããããå å³ãã¦å¤æãã¦ãã¾ãã
ãã®ä¾ã§ã¯ Model ãæ±ããã¹ãã§ããããä»ã«ãããããå°ããªã³ã¼ãã§åã¾ããããªãã®ãããã¤ãã®è¦³ç¹ã«åãã¦åºé¡ãã¦ãã¾ããå®éã®åé¡ã¯ããå°ãé£ãããã®ã«ãªãããããã¾ããã ;)
ã¨ããããã§ãQuipper ã«ããã Web ã¨ã³ã¸ãã¢ã®ã³ã¼ããã¹ãã«ã¤ãã¦ãç´¹ä»ãã¾ãããã¾ã ã¾ã æ¹åã®ä½å°ã®ãããã®ã§ã¯ããã¾ãããã³ã¼ããã¹ããå«ããå¼ãç¶ã Web ã¨ã³ã¸ãã¢ãæ¡ç¨ããã»ã¹ã主ä½çã«æ¹åãã¦ãããã¨ã§ããäºãã«ã¨ã£ã¦ä¸å¹¸ãªãã¹ããããé²ããããè¯ãã¨ã³ã¸ãã¢çµç¹ã¥ãããã§ããã¨ä¿¡ãã¦ãã¾ãã
è¯ãã³ã¼ããã¹ãã Quipper ã§ä¸ç·ã«èãã¦ã¿ããããããã¯ã©ããªåºé¡ããããã®ãæ°ã«ãªãã®ã§ã³ã¼ããã¹ããåãã¦ã¿ãããã¨ããæ¹ã¯ãã²ãå¿åãã ããã