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

ruby24

 ruby24

開発者の道具箱
2013.12.12
git, rspec, twitter-bootstrap

Kuniaki IGARASHI

December 07, 2013
Tweet

More Decks by Kuniaki IGARASHI

Other Decks in Technology

Transcript

  1. HJUॳظԽ ࢼ͠ʹɺ৽͍͠ϑΥϧμΛ࡞ͬͯͦ͜ΛHJUͰόʔδϣϯ ؅ཧͯ͠Έ·͠ΐ͏ɻ NLEJSϑΥϧμ໊ DEϑΥϧμ໊ લ४උ ϑΥϧμΛ৽ن࡞੒͠·͢ɻ ࡞ͬͨϑΥϧμ΁Ҡಈ͠·͢ɻ HJU͸ϑΥϧμ୯ҐͰཤྺʢόʔδϣϯʣΛ؅ཧ͠·͢ɻ HJUॳظԽ

    HJUJOJU HJUJOJU͢ΔͱɺͦͷϑΥϧμΛόʔδϣϯ؅ཧͰ͖ΔΑ͏ʹͳΓ·͢ɻ Initialized empty Git repository in ϑΥϧμ໊ ˞౾஌ࣝɿόʔδϣϯ؅ཧ͞Ε͍ͯΔ৔ॴΛʮϦϙδτϦʯͱݺͼ·͢ɻ
  2. ίϛοτͷํ๏ ΤσΟλͰϑΝΠϧΛ࡞ͬͯɺHJUJOJUͨ͠ϑΥϧμ΁อଘ͠·͠ΐ͏ɻ લ४උ ίϛοτͯ͠Έ·͠ΐ͏ɻ HJUίϛοτ HJUBEEIFMMPSC HJUDPNNJUNIFMMPSCΛ௥Ճ ίϛοτ͢Δʹ͸ɺHJUBEEͨ͠ޙͰɺHJUDPNNJU͠·͢ɻ [master (root-commit)

    ebeb9df] hello.rb Λ௥Ճ 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 hello.rb QVUT)FMMPXPSME IFMMPSC ϑΝΠϧ໊΋ϑΝΠϧͷ಺༰΋ ࣗ༝Ͱ͔·͍·ͤΜɻ 3VCZͷίʔυͰͳͯ͘΋0,Ͱ͢ɻ IFMMPSCͷ෦෼͸ϑΝΠϧ໊ IFMMPSCΛ௥Ճͷ෦෼͸ ίϝϯτͰ͢ɻࣗ༝ʹॻ͚·͢ɻ
  3. commit ebeb9df1625ef74856a2724cca54e87abf72dfbc Author: Kuniaki IGARASHI <[email protected]> Date: Sat Dec 15

    21:44:22 2012 +0900 ! hello.rb Λ௥Ճ ཤྺͷݟํ HJUMPH ‏ίϛοτϋογϡ ‏ίϛοτͨ͠ਓ ‏ίϛοτͨ͠೔࣌ ‏ίϛοτϝοηʔδ ֤छ৘ใ͕ه࿥͞Ε͍ͯ·͢ɻ ! ίϛοτϋογϡ͸ͦͷίϛοτΛҰҙʹࣔ͢ӳ਺ࣈͰ͢ɻ ͜ͷίϛοτͷ໊લͱݴͬͯ΋͍͍Ͱ͠ΐ͏ɻ ͜ͷίϛοτΛࢦ͢ͱ͖͸FCFCEͱࢦఆ͠·͢ɻ
  4. ཤྺΛ֬ೝͯ͠Έ·͠ΐ͏ HJUMPH commit 6ba048b2967d1c04f271e12988e43f19f3f65def Author: Kuniaki IGARASHI <[email protected]> Date: Sun

    Dec 16 09:56:42 2012 +0900 ! putsจΛมߋ ! commit ebeb9df1625ef74856a2724cca54e87abf72dfbc Author: Kuniaki IGARASHI <[email protected]> Date: Sat Dec 15 21:44:22 2012 +0900 ! hello.rb Λ௥Ճ ‏৽͍͠ίϛοτ ͕૿͑·ͨ͠ ͜ͷΑ͏ʹίϛοτ͕ੵΈ্͕͍͖ͬͯ·͢ɻ มߋͷ಺༰Λ΋͏গ͠ৄ͘͠ݟΔʹ͸Ͳ͏͢Ε͹͍͍Ͱ͠ΐ͏͔ɻʢͭͮ͘ʣ
  5. commit 6ba048b2967d1c04f271e12988e43f19f3f65def Author: Kuniaki IGARASHI <[email protected]> Date: Sun Dec 16

    09:56:42 2012 +0900 ! putsจΛมߋ ! diff --git a/hello.rb b/hello.rb index 08b85bf..a32c710 100644 --- a/hello.rb +++ b/hello.rb @@ -1 +1 @@ -puts "Hello world!" +puts "foo" ! commit ebeb9df1625ef74856a2724cca54e87abf72dfbc Author: Kuniaki IGARASHI <[email protected]> Date: Sat Dec 15 21:44:22 2012 +0900 ! hello.rb Λ௥Ճ ! diff --git a/hello.rb b/hello.rb new file mode 100644 ཤྺΛৄ͘͠ݟͯΈ·͠ΐ͏ HJUMPHQ ‏IFMMPSC͕มߋ͞Εͨ ‏͔Β࢝·Δߦ͸࡟আ͞Εͨ͜ͱΛҙຯ͠·͢ɻ ‏ ͔Β࢝·Δߦ͸௥Ճ͞Εͨ͜ͱΛҙຯ͠·͢ɻ ίϛοτͰมΘͬͨࠩ෼ EJGG ͕දࣔ͞Ε·͢ɻԿΛม͔͑ͨௐ΂͍ͨͱ͖ʹศརͰ͢ɻ ·ͨɺҎԼͷઃఆจΛଧͭͱ݁Ռ͕Χϥʔʹͳͬͯݟқ͍Ͱ͢ɻ ճ͚ͩଧͯ͹ͣͬͱ༗ޮ HJUDPOpHHMPCBMDPMPSVJUSVF
  6. HJUͷݱࡏঢ়ଶΛ֬ೝ͢Δ HJUঢ়ଶ֬ೝ HJUTUBUVT ϑΝΠϧʹมߋ͕ͳ͍ͱ͖ # On branch master nothing to

    commit (working directory clean) ϑΝΠϧ͕มߋ͞Ε͍ͯΔͱ͖ # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: hello.rb # no changes added to commit (use "git add" and/or "git commit - a") ‏มߋ͞Ε͍ͯΔϑΝΠϧ໊ ͭͮ͘
  7. HJUͷݱࡏঢ়ଶΛ֬ೝ͢Δ ͖ͭͮ HJUঢ়ଶ֬ೝ HJUTUBUVT աڈʹίϛοτͯ͠ͳ͍ϑΝΠϧ͕ଘࡏ͢Δͱ͖ # On branch master #

    Untracked files: # (use "git add <file>..." to include in what will be committed) # # iga.rb nothing added to commit but untracked files present (use "git add" to track) ‏աڈʹίϛοτ͞Ε͍ͯͳ͍͚Ͳଘࡏͯ͠ΔϑΝΠϧ໊
  8. ྺ࢙Λר͖໭͢ աڈͷίϛοτ·Ͱ໭ͯ͠Έ·͠ΐ͏ɻ ྫʣ HJUDIFDLPVU<ίϛοτϋογϡ> IFMMPSCΛΤσΟλͰ։͘ͱɺFCFCE࣌఺ͷঢ়ଶʹ໭ͬͯΔ͜ͱ͕෼͔Γ·͢ɻ Note: checking out 'ebeb9d'. !

    You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. ! If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: ! git checkout -b new_branch_name ! HEAD is now at ebeb9df... hello.rb Λ௥Ճ ίϛοτϋογϡ͸ HJUMPHͰௐ΂͓͖ͯ·͢ɻ ίϛοτϋογϡ͸શ෦ଧͨͳͯ͘΋ Ұҙʹܾ·Δ௕͞Ͱେৎ෉Ͱ͢ɻ HJUDIFDLPVUFCFCE QVUT)FMMPXPSME
  9. 34QFDϓϩμΫτίʔυ࣮૷ ͨͱ͑͹#PPLϞσϧ͕ҎԼͷΑ͏ʹͳ͍ͬͯͯɺEFDP@UJUMFͱ͍ ͏λΠτϧΛσίΔૉఢͳϝιουΛ࣮૷͍ͯͨ͠ͱ͠·͠ΐ͏ɻ DMBTT#PPL"DUJWF3FDPSE#BTF EFGEFDP@UJUMF   UJUMF  

    FOE FOE ͨͱ͑͹ɺCPPL#PPLOFX UJUMF݄ͷϥΠΦϯ ͷͱ͖ CPPLEFDP@UJUMFͱ࣮ߦͯ͠ ݄ͷϥΠΦϯ Λಘ͍ͨΘ͚Ͱ͢ɻ ςετͳͩ͠ͱ͏·͘ಈ͔͘ෆ҆Ͱ໷΋຾Ε·ͤΜɻ ςετίʔυΛॻ͍ͯΈ·͠ΐ͏ʂ ˞͜ͷ#PPLΫϥεͷΑ͏ʹɺΞϓϦͰ࣮ࡍͷಈ࡞ʹ࢖ΘΕΔίʔυΛϓϩμΫ τίʔυͱಡΜͩΓ΋͠·͢ɻࢲ͸ຊ൪ίʔυͱಡΜ͡Ό͏͜ͱ͕ଟ͍Ͱ͢ɻ BQQNPEFMTCPPLSC
  10. 34QFDςετίʔυ࣮૷ ςετίʔυ͸ҎԼͷΑ͏ʹॻ͚·͢ɻ DPEJOHVUG SFRVJSFTQFD@IFMQFS ! EFTDSJCF#PPLEP EFTDSJCFEFDP@UJUMFEP JU  Ͱғ·ΕͨλΠτϧΛฦ͢EP

    CPPL#PPLOFX UJUMF݄ͷϥΠΦϯ  CPPLEFDP@UJUMFTIPVME ݄ͷϥΠΦϯ  FOE FOE FOE TQFDNPEFMTCPPL@TQFDSC ‏#PPLΫϥεͷ ‏EFDP@UJUMFϝιουʹ͍ͭͯ ͸Πϯελϯεϝιουͷҙ ‏͜͏ಈ࡞͢΂͖ ‏લ४උ ‏ςετίʔυɹίΞ෦෼ CPPLEFDP@UJUMFTIPVME ݄ͷϥΠΦϯ  ϙΠϯτ͸͜ͷίʔυͰ͢ɻTIPVME͕ςετͷͨΊͷϝιουɻ ʮCPPLEFDP@UJUMF͸ ݄ͷϥΠΦϯ ͱ ಉ͡ ʹͳΔ΂͖ʯ ͱ͍͏ςετίʔυͰ͢ɻ CPPLEFDP@UJUMFͷ݁Ռ͕ ݄ͷϥΠΦϯ ͷ৔߹ʹςετΛ௨ա͠·͢ɻ ҟͳΔ৔߹΍͏·͘ಈ͔ͳ͍৔߹͸ςετ͕ࣦഊ͠·͢ɻ
  11. ίʔυ मਖ਼ޙ %0$5:1&IUNM IUNM IFBE UJUMF#PPLT"QQUJUMF TUZMFTIFFU@MJOL@UBHCPPUTUSBQ NFEJBBMM TUZMFTIFFU@MJOL@UBHBQQMJDBUJPO NFEJBBMM

    EBUBUVSCPMJOLTUSBDLUSVF KBWBTDSJQU@JODMVEF@UBHBQQMJDBUJPO EBUBUVSCPMJOLTUSBDLUSVF DTSG@NFUB@UBHT IFBE CPEZ OBWDMBTTOBWCBSOBWCBSEFGBVMUSPMFOBWJHBUJPO EJWDMBTTOBWCBSIFBEFS CVUUPOUZQFCVUUPODMBTTOBWCBSUPHHMFEBUBUPHHMFDPMMBQTFEBUB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ͩ͘͞ɻ ಈػɿͳͥͦͷϓϩάϥϜΛ࡞Ζ͏ͱࢥ͔ͬͨ

    ϓϩάϥϜͷσϞ ! ൃදޙʹൃදࢿྉͱίʔυ܈Λఏग़͍ͯͩ͘͠͞ ൃද͠ͳ͍৔߹ɺධՁ͸ݪଇͱͯ͠ෆՄͱ͠·͢ ͳͷͰɺൃද೔ʹग़੮Ͱ͖ͳ͍৔߹͸ޒेཛྷ΁૬ஊ͍ͯͩ͘͠͞ ˞ϧΠεઌੜͷߨٛΛडߨ͍ͯ͠Δํ͸ɺͦͷҰ෦Λ͜͜Ͱ࡞ͬͯ΋Βͬͯ ΋͔·Θͳ͍Ͱ͢ɻผͷ΋ͷΛ࡞ͬͯ΋0,Ͱ͢ɻ
  14. εέδϡʔϧ   ੍࡞ظؒ ग़੮͸ͯ͠΋͠ͳͯ͘΋0,Ͱ͢ ग़੮ѻ͍  ޒेཛྷ͸ߨٛ࣌ؒத͸෦԰ʹ͍ΔͷͰɺ ࣭໰ɺ૬ஊͳͲؾܰʹͲ͏ͧ !

    ൃද೔ ࠷ऴߨٛ೔  ͔Β։࢝͢ΔͷͰே͕Μ͹ͬͯདྷͯʂ ൃදࢿྉͱίʔυ܈ͷఏग़ํ๏͸͜ͷ೔ʹ࿈བྷ͠·͢
  15. ͍··Ͱͷಓ۩ͷ͓͞Β͍ 3VCZฤ &YDFM DTWϑΝΠϧͷಡΈࠐΈ TQSFBETIFFUHFN ࢿྉୈճ(FN  ! UXJUUFSσʔλͷऩू UXJUUFSHFN

    ࢿྉୈճ(FN  ! 4JOBUSB 8FCϑϨʔϜϫʔΫ  TJOBUSBHFN ࢿྉୈճ4JOBUSBͰ࡞Δ؆୯8FCΞϓϦ  ! J1IPOF΁1VTI௨஌ ͓·͚ ߨٛࢿྉϖʔδʹஔ͍ͯ͋Γ·͢
  16. ͍··Ͱͷಓ۩ͷ͓͞Β͍ 3BJMTฤ Ұ൪খ͞ͳ3BJMTΞϓϦ ࢿྉୈճ  8FCը໘Λ࡞ͬͯ৘ใΛදࣔ͢Δͱ͖ʹ ! $44)5.- ࢿྉୈճ 

    σβΠϯΛ͔ͬ͜Α͍ͨ͘͠ͱ͖ʹ ! $36% ࢿྉୈճ  ৽ن࡞੒ɺදࣔɺߋ৽ɺ࡟আͷͭͷجຊಈ࡞ ! OFXDSFBUF ࢿྉୈճ  ৽ن࡞੒ʹ͍ͭͯৄ͘͠ ! NPEFM ࢿྉୈճ  σʔλΛอଘ͍ͨ͠ͱ͖ʹ ! ը૾౤ߘΞϓϦ ࢿྉୈճ  ը૾Λ౤ߘͰ͖ΔΑ͏ʹ͢ΔɺHFNͷ࢖͍ํɺ#VOEMFS
  17. HFNQSZ HSPVQ<EFWFMPQNFOU UFTU> ‏௥Ճ (FNpMF ௥Ճͨ͠ΒɺTIFMMͰCVOEMFίϚϯυΛ࣮ߦͯ͠QSZΛΠϯετʔϧ͠·͢ɻ CVOEMF QSZΛ࢖͏ͨΊʹ͸ɺ·ͣલ४උͱͯ͠ (FNpMFʹHFNQSZΛ௥Ճ͠·͢ɻ Ґஔ͸ྫ͑͹HFNTRMJUFͷ࣍ͷߦ͋ͨΓɻ

    લ४උ QSZͰσόοά ˞HFNQSZ͚ͩͰ΋ಈ࡞͠·͢ɻ্ه͸։ൃϞʔυ EFWFMPQNFOU ͱςετϞʔυ UFTU ͚ͩͰQSZΛ࢖͍ɺ αʔϏεӡ༻Ϟʔυ QSPEVDUJPOͱ͍͍·͢ Ͱ͸QSZΛ࢖Θͳ͍ઃఆʹ͍ͯ͠·͢ɻ 3BJMT͸Կ΋ࢦఆ͠ͳ͍৔߹͸௨ৗEFWFMPQNFOUϞʔυͰಈ࡞͍ͯ͠·͢ɻ QSZ͸ϓϩάϥϜͷ࣮ߦΛࢭΊͯɺͦͷ৔ॴͰ3VCZͷίʔυ Λ࣮ߦ͢Δ͜ͱ͕Ͱ͖ΔɺJSCͷΑ͏ͳର࿩؀ڥͰ͢ɻ
  18. ࣍ʹɺιʔείʔυͰࢭΊ͍ͨ৔ॴ΁ CJOEJOHQSZͱॻ͖·͢ɻ DMBTT#PPLT$POUSPMMFS"QQMJDBUJPO$POUSPMMFS EFGJOEFY !CPPLT#PPLBMM CJOEJOHQSZ  FOE FOE ‏௥ه

    IUUQMPDBMIPTUCPPLT SBJMTTFSWFSΛ࠶ىಈͯ͠ɺϒϥ΢βͰΞΫηεͯ͠Έ·͠ΐ͏ɻ ྫͱͯ͠ɺCPPLT΁ΞΫηε͞Εͨͱ͖ʹఀࢭ͢ΔΑ͏ʹ #PPLT$POUSPMMFSͷJOEFYΞΫγϣϯʹॻ͍ͯΈ·͠ΐ͏ɻ QSZͰσόοά
  19. ࣗश༻3BJMTࢿྉ ಛʹڭՊॻ͸࢖͍·ͤΜ͕ɺࣗश༻ʹ͸ҎԼͷࢿྉΛ͓קΊ͠·͢ɻ ! 3BJMT5VUPSJBM XFC  IUUQSBJMTUVUPSJBMKQ WFSTJPO ! υοτΠϯετʔϧ

    XFC ಈը  IUUQEPUJOTUBMMDPNMFTTPOTCBTJD@SBJMT@W  3BJMT(VJEF XFC &OHMJTI  IUUQHVJEFTSVCZPOSBJMTPSH ! 3BJMTʹΑΔΞδϟΠϧ8FCΞϓϦέʔγϣϯ։ൃୈ൛ IUUQXXXBNB[PODPKQEQ ! վగ৽൛جૅ3VCZPO3BJMT IUUQXXXBNB[PODPKQEQ ! ͨͷ͍͠3VCZ IUUQXXXBNB[PODPKQEQ