SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
GUI Programming with

MacRuby
GUI Programming with

         MacRuby
Who?
What?
When?
Where?
Why?
How?
Who?
Erik Michaels-Ober?
sferik
on Twitter, GitHub, Gmail, IRC, &c.
Code for America
    APPLY WITHIN
I’ve committed to...
rails          oauth2       rvm

rails_admin    faraday      bunder

merb_admin     thor         travis-ci

twitter        multi_json   dummy_data

twurl          multi_xml    git-pulls

simple_oauth   octokit      mlb
HubCap
Who else?
@lrz               @benstiglitz
@merbist           @importantshock
@rich_kilmer       @naixn
@alloy             @watson1978
@vincentisambart   @Psychs
@macruby           macruby-devel
What?
What

            MacRuby


1. A complete implementation of Ruby 1.9
Ruby apps   MacRuby apps
DEMO
What

             MacRuby

1. A complete implementation of Ruby 1.9
2. Allows you to script existing Mac apps
3. Allows you to create new Mac apps
Let me tell you a
    secret...
AppleScript
Objective-C
Ruby Method Invocation
object.method parameter
Objective-C Method Invocation

[object method:parameter];
Ruby Array Initialization and Assignment


array = []
Objective-C Array Initialization and Assignment


NSMutableArray *array =
[[NSMutableArray alloc] init];
RubyCocoa
MacRuby Hello World
require 'hotcocoa'
include HotCocoa

application do |app|
  win = window :size => [100,50]
  b = button :title => 'Hello'
  b.on_action { puts 'World!' }
  win << b
end
RubyCocoa Hello World
require 'osx/cocoa'
include OSX

app = NSApplication.sharedApplication
win = NSWindow.alloc.initWithContentRect_styleMask_backing_defer(
  [0, 0, 200, 60],
  NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
  NSBackingStoreBuffered, false)

win.title = 'Hello World'
button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)

button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit

button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
  (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))
button_controller = Object.new

def button_controller.sayHello(sender)
  puts "Hello World!"
end

button.target = button_controller
button.action = 'sayHello:'
win.display
win.orderFrontRegardless

app.run
Java
Objective-J
When?
When

    MacRuby
     NOW!
   Version 0.10
Version 1.0 coming soon
When

          MacRuby
MacRuby will be included
with Mac OS X 10.7 Lion*
*currently as a private framework :(
Why?
Why

            MacRuby
• You already know Ruby
• Use existing Ruby gems
• Ruby 1.9.2
• No GIL
• Multi-threaded generational GC
• Fast!
Performance Benchmarks
 8
                                              Ruby 1.9         MacRuby
 7

 6

 5

 4

 3

 2

 1


app_answer   app_tarai   so_object   vm1_ivar_set   vm2_proc    vm2_zsuper
Average Selling Price
$12.00

$10.00

 $8.00

 $6.00
                            $11.21

 $4.00

 $2.00              $4.19

            $1.57

           iPhone   iPad    Mac
How?
How

   MacRuby

macruby.com
How

       MacRuby
rvm get head
rvm install macruby
How

        MacRuby
brew install llvm
port install llvm
How

         MacRuby
Free with ADC account at
developer.apple.com/tools/xcode
or $4.99 on the Mac App Store
sferik
on Twitter, GitHub, Gmail, IRC, &c.

Contenu connexe

Tendances

JRoRでGAE/Jの手引き
JRoRでGAE/Jの手引きJRoRでGAE/Jの手引き
JRoRでGAE/Jの手引き
Naoto Takai
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
Ben Lin
 

Tendances (20)

Boxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About ItBoxen: How to Manage an Army of Laptops and Live to Talk About It
Boxen: How to Manage an Army of Laptops and Live to Talk About It
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environment
 
Node
NodeNode
Node
 
Build your own RasPiTV with Node.js & Socket.io
Build your own RasPiTV with Node.js & Socket.ioBuild your own RasPiTV with Node.js & Socket.io
Build your own RasPiTV with Node.js & Socket.io
 
Windows Azure loves OSS
Windows Azure loves OSSWindows Azure loves OSS
Windows Azure loves OSS
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
Super combinators
Super combinatorsSuper combinators
Super combinators
 
WordPress workflow of the future
WordPress workflow of the futureWordPress workflow of the future
WordPress workflow of the future
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Laravel mix
Laravel mixLaravel mix
Laravel mix
 
CoffeeScript Design Patterns
CoffeeScript Design PatternsCoffeeScript Design Patterns
CoffeeScript Design Patterns
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Getting Started with Pelican
Getting Started with PelicanGetting Started with Pelican
Getting Started with Pelican
 
JRoRでGAE/Jの手引き
JRoRでGAE/Jの手引きJRoRでGAE/Jの手引き
JRoRでGAE/Jの手引き
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
 

En vedette

2012 Library Orientation (1 August 2012)
2012 Library Orientation (1 August 2012)2012 Library Orientation (1 August 2012)
2012 Library Orientation (1 August 2012)
Joanne4
 
Slide Show For Bank Card Pos
Slide Show For Bank Card PosSlide Show For Bank Card Pos
Slide Show For Bank Card Pos
BryanMiedel
 
Pyramids (GROUP 4)
Pyramids (GROUP 4)Pyramids (GROUP 4)
Pyramids (GROUP 4)
asita warda
 
Hi ha forats negres
Hi ha forats negresHi ha forats negres
Hi ha forats negres
ranglada64
 
éRase una vez
éRase una vezéRase una vez
éRase una vez
amapola08
 

En vedette (20)

Easily Backup your Mobile Data
Easily Backup your Mobile DataEasily Backup your Mobile Data
Easily Backup your Mobile Data
 
Leerink Swann Research Report on Ventrus Bio ($VTUS)
Leerink Swann Research Report on Ventrus Bio ($VTUS)Leerink Swann Research Report on Ventrus Bio ($VTUS)
Leerink Swann Research Report on Ventrus Bio ($VTUS)
 
DARA Bio ($DARA) - KRN5500 article from the Journal of Pain and Symptom Manag...
DARA Bio ($DARA) - KRN5500 article from the Journal of Pain and Symptom Manag...DARA Bio ($DARA) - KRN5500 article from the Journal of Pain and Symptom Manag...
DARA Bio ($DARA) - KRN5500 article from the Journal of Pain and Symptom Manag...
 
Organizimi i procedurave
Organizimi i proceduraveOrganizimi i procedurave
Organizimi i procedurave
 
Paragliding klub 2010
Paragliding klub 2010Paragliding klub 2010
Paragliding klub 2010
 
让H5页面适配移动设备全家 - 前端篇 - peunzhang
让H5页面适配移动设备全家 - 前端篇 - peunzhang让H5页面适配移动设备全家 - 前端篇 - peunzhang
让H5页面适配移动设备全家 - 前端篇 - peunzhang
 
2012 Library Orientation (1 August 2012)
2012 Library Orientation (1 August 2012)2012 Library Orientation (1 August 2012)
2012 Library Orientation (1 August 2012)
 
Marketing 4030
Marketing 4030Marketing 4030
Marketing 4030
 
Slide Show For Bank Card Pos
Slide Show For Bank Card PosSlide Show For Bank Card Pos
Slide Show For Bank Card Pos
 
Pyramids (GROUP 4)
Pyramids (GROUP 4)Pyramids (GROUP 4)
Pyramids (GROUP 4)
 
Child sponsorship update december 2010
Child sponsorship update   december 2010Child sponsorship update   december 2010
Child sponsorship update december 2010
 
Digipak
DigipakDigipak
Digipak
 
里山グリーンカプセル
里山グリーンカプセル里山グリーンカプセル
里山グリーンカプセル
 
Hi ha forats negres
Hi ha forats negresHi ha forats negres
Hi ha forats negres
 
Aliakbarhassanpour securityproject
Aliakbarhassanpour securityprojectAliakbarhassanpour securityproject
Aliakbarhassanpour securityproject
 
GE Excite II For Sale
GE Excite II For SaleGE Excite II For Sale
GE Excite II For Sale
 
éRase una vez
éRase una vezéRase una vez
éRase una vez
 
Product portfolio 2013
Product portfolio 2013Product portfolio 2013
Product portfolio 2013
 
María montessori. la formacion del hombre
María montessori. la formacion del hombreMaría montessori. la formacion del hombre
María montessori. la formacion del hombre
 
HOU-eLearning - liemqv & minhbt
HOU-eLearning - liemqv & minhbtHOU-eLearning - liemqv & minhbt
HOU-eLearning - liemqv & minhbt
 

Similaire à GUI Programming with MacRuby

Macruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich KilmerMacruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich Kilmer
Matt Aimonetti
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
Mu Chun Wang
 
Ruby'izing iOS development
Ruby'izing iOS developmentRuby'izing iOS development
Ruby'izing iOS development
toamitkumar
 
Rubymotion inspect 2014_review
Rubymotion inspect 2014_reviewRubymotion inspect 2014_review
Rubymotion inspect 2014_review
Bob Firestone
 

Similaire à GUI Programming with MacRuby (20)

Macruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich KilmerMacruby& Hotcocoa presentation by Rich Kilmer
Macruby& Hotcocoa presentation by Rich Kilmer
 
MacRuby, an introduction
MacRuby, an introductionMacRuby, an introduction
MacRuby, an introduction
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?
 
Mac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimMac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. Lim
 
MacRuby to The Max
MacRuby to The MaxMacRuby to The Max
MacRuby to The Max
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
MacRuby for Fun and Profit
MacRuby for Fun and ProfitMacRuby for Fun and Profit
MacRuby for Fun and Profit
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
Why MacRuby Matters
Why MacRuby MattersWhy MacRuby Matters
Why MacRuby Matters
 
MacRuby
MacRubyMacRuby
MacRuby
 
Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"
 
Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)
 
Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
 
Ruby'izing iOS development
Ruby'izing iOS developmentRuby'izing iOS development
Ruby'izing iOS development
 
Rubymotion inspect 2014_review
Rubymotion inspect 2014_reviewRubymotion inspect 2014_review
Rubymotion inspect 2014_review
 
Building static libraries for iOS with CocoaPods
Building static libraries for iOS with CocoaPodsBuilding static libraries for iOS with CocoaPods
Building static libraries for iOS with CocoaPods
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 

Dernier

Dernier (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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
 
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
 
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...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

GUI Programming with MacRuby

  • 2. GUI Programming with MacRuby Who? What? When? Where? Why? How?
  • 5. sferik on Twitter, GitHub, Gmail, IRC, &c.
  • 6. Code for America APPLY WITHIN
  • 7. I’ve committed to... rails oauth2 rvm rails_admin faraday bunder merb_admin thor travis-ci twitter multi_json dummy_data twurl multi_xml git-pulls simple_oauth octokit mlb
  • 9. Who else? @lrz @benstiglitz @merbist @importantshock @rich_kilmer @naixn @alloy @watson1978 @vincentisambart @Psychs @macruby macruby-devel
  • 10. What?
  • 11. What MacRuby 1. A complete implementation of Ruby 1.9
  • 12. Ruby apps MacRuby apps
  • 13. DEMO
  • 14. What MacRuby 1. A complete implementation of Ruby 1.9 2. Allows you to script existing Mac apps 3. Allows you to create new Mac apps
  • 15. Let me tell you a secret...
  • 16.
  • 21. Ruby Array Initialization and Assignment array = []
  • 22. Objective-C Array Initialization and Assignment NSMutableArray *array = [[NSMutableArray alloc] init];
  • 24.
  • 25. MacRuby Hello World require 'hotcocoa' include HotCocoa application do |app|   win = window :size => [100,50]   b = button :title => 'Hello'   b.on_action { puts 'World!' }   win << b end
  • 26. RubyCocoa Hello World require 'osx/cocoa' include OSX app = NSApplication.sharedApplication win = NSWindow.alloc.initWithContentRect_styleMask_backing_defer(   [0, 0, 200, 60],   NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,   NSBackingStoreBuffered, false) win.title = 'Hello World' button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),   (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender)   puts "Hello World!" end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 27. Java
  • 29. When?
  • 30. When MacRuby NOW! Version 0.10 Version 1.0 coming soon
  • 31. When MacRuby MacRuby will be included with Mac OS X 10.7 Lion* *currently as a private framework :(
  • 32. Why?
  • 33. Why MacRuby • You already know Ruby • Use existing Ruby gems • Ruby 1.9.2 • No GIL • Multi-threaded generational GC • Fast!
  • 34. Performance Benchmarks 8 Ruby 1.9 MacRuby 7 6 5 4 3 2 1 app_answer app_tarai so_object vm1_ivar_set vm2_proc vm2_zsuper
  • 35. Average Selling Price $12.00 $10.00 $8.00 $6.00 $11.21 $4.00 $2.00 $4.19 $1.57 iPhone iPad Mac
  • 36. How?
  • 37. How MacRuby macruby.com
  • 38. How MacRuby rvm get head rvm install macruby
  • 39.
  • 40. How MacRuby brew install llvm port install llvm
  • 41.
  • 42. How MacRuby Free with ADC account at developer.apple.com/tools/xcode or $4.99 on the Mac App Store
  • 43.
  • 44.
  • 45.
  • 46. sferik on Twitter, GitHub, Gmail, IRC, &c.