SlideShare a Scribd company logo
1 of 25
Download to read offline
http://github.com/reborg/talk-macruby




  Writing Apps with
   HotCocoa and
      MacRuby

renzo.borgatti@agilepartners.com - ChiRb - April 6th 2009
MacRuby


Ruby 1.9 on Objective-C runtime
MacRuby

       Primitive Ruby classes
               <=>
Core Foundations & Cocoa equivalents
MacRuby

convenience, efficiency, flexibility,
 performance over RubyCocoa
MacRuby
reborg:scripts reborg$ macirb
irb(main):001:0> hello = quot;helloquot;
=> quot;helloquot;
irb(main):002:0> hello.class
=> NSMutableString




                                   static VALUE
                                   str_alloc(VALUE klass) {
                                       VALUE str;
                                       str = (VALUE)CFStringCreateMutable(NULL, 0);
                                       if (klass != 0
                                   	   && klass != rb_cNSString
                                   	   && klass != rb_cNSMutableString
                                   	   && klass != rb_cSymbol)
                                   	   *(Class *)str = (Class)klass;
                                       CFMakeCollectable((CFTypeRef)str);
                                       return (VALUE)str;
                                   }
MacRuby

  MacRuby recently got a new VM!
http://svn.macosforge.org/repository/
ruby/MacRuby/branches/experimental
HotCocoa

Compact Ruby-based DSL for UI
 development by Rich Kilmer
HotCocoa
   require 'hotcocoa'
include HotCocoa
application :name => quot;Hello ChiRbquot; do |app|
  app.delegate = self
  window (
    :frame => [500, 300, 200, 100],
    :title => quot;Hello ChiRbquot;) do |win|
    win << button(
      :title => quot;Click Mequot;,
      :on_action => lambda do |sender|
        alert(:message => quot;Hello ChiRb!quot;)
      end)
    win.will_close { exit }
  end
end
HotCocoa

command-line: creates rake-enabled
       skeleton project
HotCocoa
Mappings: helpers for most used Cocoa
       classes. Add your own.



  Right now, sources are your docs.
HotCocoa
Can be used from XCode but especially
      useful for programatic UI


Only way I know right now for testing-
      first UI under MacRuby
Pomodoro Technique

“The aim of the Pomodoro Technique is to use
time as a valuable ally in accomplishing what
we want to do in the way we want to do it, and
to enable us to continually improve the way we
work or study”
                                 Francesco Cirillo
                              www.pomodorotechnique.com
Pomodoro Technique
            25 + 5 and 4 + 1
       The Pomodoro Is Indivisible
   If a Pomodoro Begins, It Has to Ring
If More Than 5-7 Pomodoros, Break It Down
  If Less Than One Pomodoro, Add It Up
   The Next Pomodoro Will Go Better
Pomodoro Technique




      Francesco Cirillo “The Pomodoro Technique” Paper
               www.pomodorotechnique.com
Ring..........


5 minutes break, deep breath, relax
Pomodori


HotCocoa based tool for the Pomodoro
          Technique ( PT )
Pomodori
Very simple
Automatic timers
History
Charts
Architecture
       Strict separation
           view logic
        workflow logic
        business logic

  No architecture up-front
TDD => evolved to actual design
Architecture
        One view, one-many controllers

                                pomodori_controller
 main_view




                                      models




timer_controller               modal_button_controller
Architecture
View Switch: ask related controller




          chart_controller


        pom_by_count_model
TDD HotCocoa

     Option #1: pure Ruby with everything
             (RSpec, Stubba, etc.)
     Option #2: MacRuby with limitations
      (Test::Unit, Mocha and few more)


No options if the target class requires ‘hotcocoa’
View TDD
def test_should_go_running_mode_on_init
  @main_view.expects(:running_mode)
  @main_view.send(:initialize)
end

def test_switch_on_input_box
  @main_view.send(:enable_input_box)
  assert_equal(true, @main_view.summary_label.editable?)
  assert_equal(quot;Pomodoro description herequot;,
    @main_view.summary_label.to_s)
end

def test_switch_to_submit_mode
  @main_view.expects(:enable_input_box)
  @main_view.submit_mode
  assert_equal(quot;Submitquot;, @main_view.modal_button.title)
end
Controller TDD
def setup
  @main_view = stub_everything
  @modal_button_controller = ModalButtonController.new(
    :main_view => @main_view)
end

def test_should_switch_to_break_on_submit
  when_goes_into_break_mode(:on_click_submit)
end

def when_goes_into_break_mode(action)
  @main_view.expects(:break_mode)
  @main_view.expects(:update_modal_button_action).with do |a_block|
    assert_match(/on_click_restart/, a_block.name)
  end
  @main_view.expects(:update_modal_button_label).with(quot;Restartquot;)
  @modal_button_controller.send(action, quot;senderquot;)
end
Conclusions
MacRuby: young, 80% stable, promising
HotCocoa: cool (needs documentation)
Pomodori: the coolest app for the PT :)
       PT: see you at Agile2009


            Questions?
Resources
www.macruby.org - macruby main site

www.pomodorotechnique.com Pomodoro Technique main site

http://reborg.net - my blog often talking about the PT

http://reborg.github.com/pomodori - Pomodori application main site

http://svn.macosforge.org/repository/ruby/MacRuby/branches/
experimental - Laurent Sansonetti’s work on the new MacRuby VM

Slides and examples: http://github.com/reborg/talk-macruby

More Related Content

What's hot

How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageablecorehard_by
 
Дмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортДмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортSergey Platonov
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itSergey Platonov
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьPlatonov Sergey
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricksOri Calvo
 
Getting started with open cv in raspberry pi
Getting started with open cv in raspberry piGetting started with open cv in raspberry pi
Getting started with open cv in raspberry piJayaprakash Nagaruru
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereSergey Platonov
 
Javaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersAndres Almiray
 
Wade not in unknown waters. Part one.
Wade not in unknown waters. Part one.Wade not in unknown waters. Part one.
Wade not in unknown waters. Part one.PVS-Studio
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations DVClub
 
Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Sergey Platonov
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++corehard_by
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Антон Наумович, Система автоматической крэш-аналитики своими средствами
Антон Наумович, Система автоматической крэш-аналитики своими средствамиАнтон Наумович, Система автоматической крэш-аналитики своими средствами
Антон Наумович, Система автоматической крэш-аналитики своими средствамиSergey Platonov
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about CYi-Hsiu Hsu
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistAnton Arhipov
 

What's hot (20)

How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageable
 
Дмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортДмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репорт
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим жить
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricks
 
Getting started with open cv in raspberry pi
Getting started with open cv in raspberry piGetting started with open cv in raspberry pi
Getting started with open cv in raspberry pi
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhere
 
Javaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 Groovybuilders
 
Wade not in unknown waters. Part one.
Wade not in unknown waters. Part one.Wade not in unknown waters. Part one.
Wade not in unknown waters. Part one.
 
Qt Rest Server
Qt Rest ServerQt Rest Server
Qt Rest Server
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
 
Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
Антон Наумович, Система автоматической крэш-аналитики своими средствами
Антон Наумович, Система автоматической крэш-аналитики своими средствамиАнтон Наумович, Система автоматической крэш-аналитики своими средствами
Антон Наумович, Система автоматической крэш-аналитики своими средствами
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about C
 
C++ Core Guidelines
C++ Core GuidelinesC++ Core Guidelines
C++ Core Guidelines
 
Testing con spock
Testing con spockTesting con spock
Testing con spock
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with Javassist
 

Viewers also liked

MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby DevelopersRenzo Borgatti
 
Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Renzo Borgatti
 
Introduzione a macruby
Introduzione a macrubyIntroduzione a macruby
Introduzione a macrubyRenzo Borgatti
 
Introduction to Agile Development with Scrum
Introduction to Agile Development with ScrumIntroduction to Agile Development with Scrum
Introduction to Agile Development with ScrumRenzo Borgatti
 
Agile Pomodoro Development
Agile Pomodoro DevelopmentAgile Pomodoro Development
Agile Pomodoro DevelopmentRenzo Borgatti
 

Viewers also liked (6)

MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby Developers
 
Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014
 
Introduzione a macruby
Introduzione a macrubyIntroduzione a macruby
Introduzione a macruby
 
Introduction to Agile Development with Scrum
Introduction to Agile Development with ScrumIntroduction to Agile Development with Scrum
Introduction to Agile Development with Scrum
 
Lavorare Da Remoto
Lavorare Da RemotoLavorare Da Remoto
Lavorare Da Remoto
 
Agile Pomodoro Development
Agile Pomodoro DevelopmentAgile Pomodoro Development
Agile Pomodoro Development
 

Similar to Writing Apps with HotCocoa and MacRuby

Deep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming LibraryDeep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming LibraryJim McKeeth
 
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...Comunicare, condividere e mantenere decisioni architetturali nei team di svil...
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...Michele Orselli
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonCodemotion
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About RailsAdam Wiggins
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 
Command Line Applications with Ruby
Command Line Applications with RubyCommand Line Applications with Ruby
Command Line Applications with RubyAlexander Merkulov
 
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2Alessandro Molina
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpAll Things Open
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2rubyMarc Chung
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
maXbox Starter 45 Robotics
maXbox Starter 45 RoboticsmaXbox Starter 45 Robotics
maXbox Starter 45 RoboticsMax Kleiner
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoRodolfo Carvalho
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018Fabio Janiszevski
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMoshe Kaplan
 

Similar to Writing Apps with HotCocoa and MacRuby (20)

Deep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming LibraryDeep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming Library
 
Tech talks#6: Code Refactoring
Tech talks#6: Code RefactoringTech talks#6: Code Refactoring
Tech talks#6: Code Refactoring
 
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...Comunicare, condividere e mantenere decisioni architetturali nei team di svil...
Comunicare, condividere e mantenere decisioni architetturali nei team di svil...
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About Rails
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Command Line Applications with Ruby
Command Line Applications with RubyCommand Line Applications with Ruby
Command Line Applications with Ruby
 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
 
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
 
Dependency injectionpreso
Dependency injectionpresoDependency injectionpreso
Dependency injectionpreso
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2ruby
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
maXbox Starter 45 Robotics
maXbox Starter 45 RoboticsmaXbox Starter 45 Robotics
maXbox Starter 45 Robotics
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Recently uploaded

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Writing Apps with HotCocoa and MacRuby

  • 1. http://github.com/reborg/talk-macruby Writing Apps with HotCocoa and MacRuby renzo.borgatti@agilepartners.com - ChiRb - April 6th 2009
  • 2. MacRuby Ruby 1.9 on Objective-C runtime
  • 3. MacRuby Primitive Ruby classes <=> Core Foundations & Cocoa equivalents
  • 5. MacRuby reborg:scripts reborg$ macirb irb(main):001:0> hello = quot;helloquot; => quot;helloquot; irb(main):002:0> hello.class => NSMutableString static VALUE str_alloc(VALUE klass) { VALUE str; str = (VALUE)CFStringCreateMutable(NULL, 0); if (klass != 0 && klass != rb_cNSString && klass != rb_cNSMutableString && klass != rb_cSymbol) *(Class *)str = (Class)klass; CFMakeCollectable((CFTypeRef)str); return (VALUE)str; }
  • 6. MacRuby MacRuby recently got a new VM! http://svn.macosforge.org/repository/ ruby/MacRuby/branches/experimental
  • 7. HotCocoa Compact Ruby-based DSL for UI development by Rich Kilmer
  • 8. HotCocoa require 'hotcocoa' include HotCocoa application :name => quot;Hello ChiRbquot; do |app| app.delegate = self window ( :frame => [500, 300, 200, 100], :title => quot;Hello ChiRbquot;) do |win| win << button( :title => quot;Click Mequot;, :on_action => lambda do |sender| alert(:message => quot;Hello ChiRb!quot;) end) win.will_close { exit } end end
  • 10. HotCocoa Mappings: helpers for most used Cocoa classes. Add your own. Right now, sources are your docs.
  • 11. HotCocoa Can be used from XCode but especially useful for programatic UI Only way I know right now for testing- first UI under MacRuby
  • 12. Pomodoro Technique “The aim of the Pomodoro Technique is to use time as a valuable ally in accomplishing what we want to do in the way we want to do it, and to enable us to continually improve the way we work or study” Francesco Cirillo www.pomodorotechnique.com
  • 13. Pomodoro Technique 25 + 5 and 4 + 1 The Pomodoro Is Indivisible If a Pomodoro Begins, It Has to Ring If More Than 5-7 Pomodoros, Break It Down If Less Than One Pomodoro, Add It Up The Next Pomodoro Will Go Better
  • 14. Pomodoro Technique Francesco Cirillo “The Pomodoro Technique” Paper www.pomodorotechnique.com
  • 15. Ring.......... 5 minutes break, deep breath, relax
  • 16. Pomodori HotCocoa based tool for the Pomodoro Technique ( PT )
  • 18. Architecture Strict separation view logic workflow logic business logic No architecture up-front TDD => evolved to actual design
  • 19. Architecture One view, one-many controllers pomodori_controller main_view models timer_controller modal_button_controller
  • 20. Architecture View Switch: ask related controller chart_controller pom_by_count_model
  • 21. TDD HotCocoa Option #1: pure Ruby with everything (RSpec, Stubba, etc.) Option #2: MacRuby with limitations (Test::Unit, Mocha and few more) No options if the target class requires ‘hotcocoa’
  • 22. View TDD def test_should_go_running_mode_on_init @main_view.expects(:running_mode) @main_view.send(:initialize) end def test_switch_on_input_box @main_view.send(:enable_input_box) assert_equal(true, @main_view.summary_label.editable?) assert_equal(quot;Pomodoro description herequot;, @main_view.summary_label.to_s) end def test_switch_to_submit_mode @main_view.expects(:enable_input_box) @main_view.submit_mode assert_equal(quot;Submitquot;, @main_view.modal_button.title) end
  • 23. Controller TDD def setup @main_view = stub_everything @modal_button_controller = ModalButtonController.new( :main_view => @main_view) end def test_should_switch_to_break_on_submit when_goes_into_break_mode(:on_click_submit) end def when_goes_into_break_mode(action) @main_view.expects(:break_mode) @main_view.expects(:update_modal_button_action).with do |a_block| assert_match(/on_click_restart/, a_block.name) end @main_view.expects(:update_modal_button_label).with(quot;Restartquot;) @modal_button_controller.send(action, quot;senderquot;) end
  • 24. Conclusions MacRuby: young, 80% stable, promising HotCocoa: cool (needs documentation) Pomodori: the coolest app for the PT :) PT: see you at Agile2009 Questions?
  • 25. Resources www.macruby.org - macruby main site www.pomodorotechnique.com Pomodoro Technique main site http://reborg.net - my blog often talking about the PT http://reborg.github.com/pomodori - Pomodori application main site http://svn.macosforge.org/repository/ruby/MacRuby/branches/ experimental - Laurent Sansonetti’s work on the new MacRuby VM Slides and examples: http://github.com/reborg/talk-macruby