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

my-first-mrbgem

 my-first-mrbgem

110cd4dcaed019b3bd9809e541afdeb6?s=128

Masafumi Okura

March 24, 2021
Tweet

Transcript

  1. mrbgemΛ࡞ͬͯΈͨ Fukuoka.rb 200ճ LTେձ OKURA Masafumi, 2021-03-24

  2. @okuramasafumi.inspect • ໊લɿେ૔խ࢙ • ॴଐɿϑϦʔϥϯε • ίϛϡχςΟࢀՃɿແ਺ʢfukuoka.rb͸໿20ճࢀՃʣ • ՝֎׆ಈɿKaigi on

    Rails, Grow.rb, Entaku.rb • ࣗ࡞ͷgemɿAlba, neco, rubocop-sensibleͳͲ • ࣗ࡞ͷmrbgemɿmruby-malba, mruby-factory
  3. mrubyʹ͍ͭͯ

  4. None
  5. ཁ͸૊ΈࠐΈ޲͚ͷRuby

  6. mrbgemʹ͍ͭͯ

  7. mrbgemͱ͸ • mruby༻ͷgem • RubyͱCͰॻ͚Δ • Gemͱ͍ͬͯ΋CRubyͷgemͱ͸৭ʑҧ͏ʢͲ͏ҧ͏ͷ͔આ໌Ͱ͖ Δ΄ͲཧղͰ͖͍ͯͳ͍…ʣ

  8. mrbgemΛ࡞ͬͯΈͨײ૝

  9. ͍͚Δɺ͍͚Δͧʂ ʢιʔείʔυΛίϐϖ͠ͳ͕Βʣ

  10. ͍ͱ΋ͨ΍͘͢ൃੜ͢Δ NoMethodError

  11. ͳ͔ͥʁ

  12. mruby͸σϑΥϧτͰ͸CRubyͷ͢΂ ͯͷػೳΛ࢖͏͜ͱ͸Ͱ͖ͳ͍

  13. mrbgemΛadd_dependency͢Δ

  14. mruby-malbaͷ৔߹

  15. # mrbgem.rake MRuby::Gem::Specification.new('mruby-malba') do |spec| spec.license = 'MIT' spec.authors =

    'OKURA Masafumi' spec.add_dependency 'mruby-hash-ext' spec.add_dependency 'mruby-json' spec.add_dependency 'mruby-object-ext' spec.add_dependency 'mruby-class-ext' # Test spec.add_dependency 'mruby-proc-ext' spec.add_dependency 'mruby-print' end
  16. Ұߦղઆ • mruby-hash-extɿHash#transform_valuesͳͲΛ௥Ճ͢Δ • mruby-object-extɿBasicObject#instance_execͳͲΛ௥Ճ͢Δ • mruby-class-extɿClass#<=ͳͲΛ௥Ճ͢Δ • mruby-proc-extɿKernel#procͳͲΛ௥Ճ͢Δ •

    mruby-printɿKernel#putsͳͲΛ௥Ճ͢Δ
  17. Ͳ͏΍ͬͯඞཁͳmrbgemΛ୳͢ͷʁ

  18. ৬ਓͷצ

  19. mrubyΛϏϧυ͢Δͱɺ”build summary”ͷ߲໨ʹ૊ΈࠐΈͷ mrbgemҰཡ͕ग़ΔͷͰɺ͔ͦ͜Βͦ ΕͬΆ͍΋ͷΛ୳͢

  20. ਖ਼௚ɺख୳Γͷ໘͸͋Δͱࢥ͏

  21. RubyͷϑϩϯςΟΞ͕͜͜ʹ͋Δʂ