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

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

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