RubyMotion @ MagmaConf

RubyMotion @ MagmaConf

An overview of the RubyMotion ecosystem and my experience using it while building http://www.meals.mx

E49eab7677b4696db754b356953b9eac?s=128

Ivan Acosta-Rubio

June 11, 2013
Tweet

Transcript

  1. Friday, June 7, 13

  2. Friday, June 7, 13

  3. Friday, June 7, 13

  4. Historia Objective-C Obj-C to RM Wrappers Experiencia Dolor y Deseos

    Friday, June 7, 13
  5. Friday, June 7, 13

  6. Yo en Objective-C Friday, June 7, 13

  7. ¿Que es un RubyMotion? Un conjunto de herramientas que permiten

    desarrollar para IOS y OSX usando Ruby. Friday, June 7, 13
  8. MacRuby RubyMotion Friday, June 7, 13

  9. Friday, June 7, 13

  10. Friday, June 7, 13

  11. Friday, June 7, 13

  12. Friday, June 7, 13

  13. Friday, June 7, 13

  14. 25 años Friday, June 7, 13

  15. [object methodWithInput:input]; Friday, June 7, 13

  16. [object methodWithInput:input]; object.method_with_input(input) Friday, June 7, 13

  17. String -> NSMutableString → NSString → Comparable → NSObject →

    Kernel Friday, June 7, 13
  18. Hash -> NSMutableDictionary → NSDictionary → Enumerable → NSObject →

    Kernel Friday, June 7, 13
  19. Time -> Comparable → NSDate → NSObject → Kernel Friday,

    June 7, 13
  20. NSArray, NSObject, NSSet, NSMutableArray, NSMutableSet, etc. Foundation Framework Friday, June

    7, 13
  21. Friday, June 7, 13

  22. Friday, June 7, 13

  23. Friday, June 7, 13

  24. UIBotton, UITableView, UICollectionView, UILabel, UIAccelerometer, UIImage, UIImageView, UITextField, UIWebView ,UIScrollView,

    UIGestureRecognizer, UIColor UIKit Friday, June 7, 13
  25. Friday, June 7, 13

  26. Delegates A delegate is an object that acts on behalf

    of, or in coordination with, another object when that object encounters an event in a program Friday, June 7, 13
  27. Objective-C to RubyMotion Friday, June 7, 13

  28. https://github.com/kyamaguchi/ SublimeObjC2RubyMotion Friday, June 7, 13

  29. Friday, June 7, 13

  30. def test_converts_boolean_no(self): source = '[button setAttr:NO];' expected = '[button setAttr:false];'

    self.assertSentence(CodeConverter(source).convert_boolean().s, expected) Friday, June 7, 13
  31. def convert_boolean(self): self.s = re.sub(r'\bYES\b','true', self.s) self.s = re.sub(r'\bNO\b','false', self.s)

    return self Friday, June 7, 13
  32. ¿Que nos da RM? Friday, June 7, 13

  33. alloc.init release Friday, June 7, 13

  34. DSL Friday, June 7, 13

  35. rubymotion- wrappers.com Friday, June 7, 13

  36. Bubblewrap Friday, June 7, 13

  37. UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Hola Magma" message:@"¿Donde es la

    fiesta?" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [message show]; Friday, June 7, 13
  38. App.alert("Hola Magma is awesome!") Friday, June 7, 13

  39. BW::Device.camera.front.picture(media_types: [:movie, :image]) do |result| image_view = UIImageView.alloc.initWithImage(result[:original_image]) end Friday,

    June 7, 13
  40. TeaCup Friday, June 7, 13

  41. class MyController < UIViewController stylesheet :main_screen layout do subview(UIButton, :hi_button)

    end end Teacup::Stylesheet.new :main_screen do style :hi_button, origin: [10, 10], title: 'Hi!' end Friday, June 7, 13
  42. Pixate css for IOS and Android Friday, June 7, 13

  43. JoyBox @juankaram Friday, June 7, 13

  44. Helu In App Purchases Friday, June 7, 13

  45. class ExampleController < UIViewController def viewDidLoad @helu = Helu.new("loosing_weight_10") @helu.fail

    = fail_iap @helu.winning = successful_iap @helu.buy end def fail_iap lambda { |transaction| puts "something went wrong" } end def successful_iap lambda { |transaction| puts "We created the IAP :-)"} end end Friday, June 7, 13
  46. class Helu attr_reader :product_id def initialize(product_id) @product_id = product_id SKPaymentQueue.defaultQueue.addTransactionObserver(self)

    end def fail=(fail_block) @fail = fail_block end def winning=(winning_block) @winning = winning_block end Friday, June 7, 13
  47. def finishTransaction(transaction, wasSuccessful:wasSuccessful) end def completeTransaction(transaction) end def restoreTransaction(transaction) end

    def failedTransaction(transaction) end def paymentQueue(queue,updatedTransactions:transactions) end Friday, June 7, 13
  48. def finishTransaction(transaction,wasSuccessful:wasSuccessful) SKPaymentQueue.defaultQueue.finishTransaction(transaction) wasSuccessful ? @winning.call(transaction) : @fail.call(transaction) end Friday,

    June 7, 13
  49. Yo en RubyMotion Friday, June 7, 13

  50. Text http://pharobyexample.org/ Friday, June 7, 13

  51. rake debug=1 Friday, June 7, 13

  52. Breakpoint 1, 0x005d3316 in rb_exc_raise () (gdb) bt Friday, June

    7, 13
  53. #0 0x005d3316 in rb_exc_raise () #1 0x006934b4 in rb_vm_method_missing ()

    #2 0x0065f6bf in rb_method_missing () #3 0x006827bf in rb_vm_dispatch () #4 0x0068408c in rb_vm_trigger_method_missing () #5 0x00683221 in rb_vm_dispatch () #6 0x003e1202 in vm_dispatch () at app_delegate.rb:3 #7 0x003e2c6d in rb_scope__application:didFinishLaunchingWithOptions:_ _ (self=0xb1881f0, application=0xb467b60, launchOptions=0x4) at app_delegate.rb:10 Friday, June 7, 13
  54. El Rubygems de Obj-C Friday, June 7, 13

  55. “La mejor gema de Ruby es la comunidad” Friday, June

    7, 13
  56. RevealApp Friday, June 7, 13

  57. PARSE Push Notifications Data Social Friday, June 7, 13

  58. “ ... as well as targeting other platforms.” http://blog.rubymotion.com/post/49943751398/rubymotion-goes-2-0-and-gets-os-x-support-templates Friday,

    June 7, 13
  59. A Rubymotion le gusta el Mezcal Friday, June 7, 13

  60. rubymotion.com/support/training/ Norberto started programming 20 years ago and has been

    using NextStep and OpenStep since 1995 @hiphoox Friday, June 7, 13
  61. @ivanacostarubio + info Friday, June 7, 13