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

Shinosaka.rb #3

Shinosaka.rb #3

murajun1978

May 13, 2014
Tweet

More Decks by murajun1978

Other Decks in Programming

Transcript

  1. Shinosaka.rb #3

    View full-size slide

  2. RubyGems
    ύοέʔδ؅ཧγεςϜ

    View full-size slide

  3. gem install …
    ͍ͭ΋ͷ͜Ε

    View full-size slide

  4. https://github.com/rails/rails

    View full-size slide

  5. gemͬͯ࡞Δͷ೉͍͠ʁ

    View full-size slide

  6. ࡞ͬͯΈΑ͏ϔ(^o^)ϊ

    View full-size slide

  7. http://bundler.io/
    https://www.ruby-lang.org
    http://git-scm.com/

    View full-size slide

  8. % bundle gem ΩϥΩϥωʔϜˑϛ
    ͻͳܗ࡞੒

    View full-size slide

  9. gemspecͷฤू
    name: ΩϥΩϥωʔϜˑϛ
    authors: [“murajun1978”, “murajun”](഑ྻͰෳ਺ࢦఆՄ)
    email: [“[email protected]”](഑ྻͰෳ਺ࢦఆՄ)
    summary: gemύοέʔδͷઆ໌ͷཁ໿(gem list -d Ͱදࣔ͞ΕΔ)
    description: gemύοέʔδͷৄࡉઆ໌(RubyGemsʹදࣔ͞ΕΔ)
    homepage: gemύοέʔδͷؔ࿈αΠτ(GitHub PagesͳͲ)
    license: gemύοέʔδͷϥΠηϯε
    required_ruby_version: gemύοέʔδʹඞཁͳRubyόʔδϣϯ
    post_install_message: gemΠϯετʔϧޙʹදࣔ͢Δϝοηʔδ
    http://guides.rubygems.org/

    View full-size slide

  10. % bundle gem ΩϥΩϥωʔϜˑϛ -t
    % mkdir spec
    % vim spec/spec_helper.rb
    $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
    require ΩϥΩϥωʔϜˑϛ
    spec_helper.rb
    ςετ؀ڥ( Ŗ`дŖ´)ŝžŕ
    or

    View full-size slide

  11. % rake build
    ͼΔͲ

    View full-size slide

  12. % gem install pkg/ΩϥΩϥωʔϜˑϛ
    ͍Μ͢ͱʔΔ

    View full-size slide

  13. % rake install
    ͼΔͲ & ͍Μ͢ͱʔΔ

    View full-size slide

  14. ࢖ͬͯΈΑ͏ϔ(^o^)ϊ

    View full-size slide

  15. GemͷΓΓʔ͢४උ
    RubyGemsͷΞΧ΢ϯτ࡞੒
    API KEYͷొ࿥
    % curl -u [account_name] https://rubygems.org/api/v1/api_key.yaml > \
    ~/.gem/credentials
    % chmod 0600 ~/.gem/credentials

    View full-size slide

  16. % rake release
    GemͷΓΓʔ͢

    View full-size slide

  17. ٳܜ͠Αʔͥ(ʆɾωɾ´)

    View full-size slide

  18. LT΍Ζʔͥ(ʆɾωɾ´)

    View full-size slide

  19. Ʊ"-ʓ Ʊ"-ʓƱ"-ʓ Ʊ"-ʓ

    View full-size slide