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

RubyMotion Gets A Cool New Friend: mruby on iOS

RubyMotion Gets A Cool New Friend: mruby on iOS

Joseph Ku

April 25, 2014
Tweet

More Decks by Joseph Ku

Other Decks in Technology

Transcript

  1. ! WHAT’S RUBYMOTION? A Ruby toolchain for iOS Develop and

    test native iOS app in Ruby Based on MacRuby
  2. ! DEPLOYMENT Deploy your app to beta testers by TestFlight

    ! ! Deploy to App Store $ rake archive:distribution $ gem install motion-testflight $ rake testflight notes='Orz'
  3. ! UPDATES FOR RUBYMOTION Xcode 5.1 & iOS 7.1 support

    OS X support Templates Fix tons of memory management issues Background fetching Performance improvements
  4. class Test def test foo = 42 Proc.new { foo

    + 123 } end end ! Test.new.test.call # Crashes sometimes
  5. MRuby::CrossBuild.new('ios-arm64') do |conf| toolchain :gcc ! conf.cc.flags << "-arch arm64"

    conf.linker.flags << "-arch arm64” # ... ! end mruby - build_config.rb
  6. #define MRB_USE_FLOAT; #define MRB_INT64 0% 1% 2% 3% 4% 5%

    6% bm_so_lists.rb fib39.rb Benchmark on A7
  7. DSL

  8. { "uuid": "B9407F30-F5F8-466E-AFF9-25556B57FE6D", "events": [ { "proximity": "immediate", "url": "http://host.com/event/1"

    }, { "proximity": "near", "url": "http://host.com/event/2" }, { "proximity": "far", "url": "http://host.com/event/3" } ] }
  9. beacon b1 do uuid "B9407F30-F5F8-466E-AFF9-25556B57FE6D" major 75682 minor 1 end

    ! beacon b2 do uuid "B9407F30-F5F8-466E-AFF9-25556B57FE6D" major 75682 minor 2 end ! beacon b3 do uuid "B9407F30-F5F8-466E-AFF9-25556B57FE6D" major 75682 minor 3 end ! event b1.far, b2.near do url “https://host.com/event/1" end ! event b2.immediate, !b3.far do url “https://host.com/event/2" end
  10. #include <stdint.h> const uint8_t nothing_here[] = { 0x52,0x49,0x54,0x45,0x30,0x30,0x30,0x32,0x1f,0xef,0x00,0x00,0x00,0x62,0x4d,0x41, 0x54,0x5a,0x30,0x30,0x30,0x30,0x49,0x52,0x45,0x50,0x00,0x00,0x00,0x44,0x30,0x30, 0x30,0x30,0x00,0x00,0x00,0x38,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x04,

    0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x3d,0x00,0x80,0x00,0xa0,0x00,0x00,0x00,0x4a, 0x00,0x00,0x00,0x01,0x00,0x00,0x08,0x74,0x6f,0x6c,0x64,0x20,0x79,0x6f,0x75,0x00, 0x00,0x00,0x01,0x00,0x04,0x70,0x75,0x74,0x73,0x00,0x45,0x4e,0x44,0x00,0x00,0x00, 0x00,0x08, }; secret.c $ mrbc -Bnothing_here secret.rb mrb.read_irep nothing_here mrb.run