SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
RubyConf Snippets 
(RubyConf Australia 2014 - Feb 18-20)
What is it? 
● Annually in Australia (Melbourne/Sydney) 
● Around the world (e.g. Miami, India, Argentina) 
● Variety of talks held over 2 days 
● Local and International speakers 
● A day of workshops (e.g. Rails Girls Next, C Extensions, 
Rspec) 
● Best practises, examples, inspiration, meet new people 
● Videos - http://vimeo.com/rubyau
This Year 
● Continuous Delivery 
● Rails Engines 
● Middleware 
● Ruby 2.1 
● Minitest 
● Programming as a Parent 
● Asset Pipeline 
● MongoDB 
● Concurrency Practices in Ruby 
● JRuby 
● Security 
● Loads more ... https://m.lanyrd.com/2014/rubyconf-au/schedule/ 
● Videos - http://vimeo.com/rubyau
The Snippets 
● Continuous Deployment 
● Rails Engines 
● C Extensions 
● Community
Continuous Deployment
Continuous Deployment
Rails Engines
Rails Engines 
● Slow 
● Buggy 
● New features take too 
long 
● Disploys are 
complicated 
● So many 
dependencies
Rails Engines 
rails plugin new <engine_name> --mountable 
rails g controller <controller_name> 
rake db:migrate 
rake <engine_name>:install:migrations 
gem 'engine_name', path: "vendor/engines/engine_name" 
● engine.rb, routes.rb, application.rb 
● test app (test/dummy) 
● namespaced - routes, views, tables etc 
● migrations 
● SOA, Model Managers
Rails Engines 
● Avoid accessing ActiveRecord 
directly 
● Domain API 
● Smart & Fast test suite => test 
changes in the changed engine
C Extensions 
● C code in a Ruby Gem 
● E.g. nokogiri 
● Testable (write Rspec on C code!) 
● Why? speedier (Ruby is not slow, but not great on 
processing e.g. image processing) 
● Ruby wrapper for C libs
C Extensions 
bundle gem <gem_name> create the gem 
# <gem_name>.gemspec 
spec.add_development_dependency "rake-compiler" 
# Rakefile 
require "rake/extensiontask" 
Rake::ExtensionTask.new('rbshop') do |ext| 
ext.lib_dir = "lib/rbshop" 
end 
mkdir -p ext/gem_name C code lives here
C Extensions 
# ext/gem_name/extconf.rb add extension config file 
require ‘mkmf’ creates makefile to compile C code 
create_makefile(‘gem_name’) 
# ext/gem_name/gem_name.c 
initialise the extension 
ruby.h is the C API 
e.g. INT2NUM
C Extensions 
● free() and malloc() 
● Tell Ruby what 
methods to allocate 
and free memory 
● Ruby holds onto 
memory until it 
needs to free it
C Extensions 
➔ Call functions that define modules/classes: 
◆ rb_define_module - Creates modules 
◆ rb_define_class_under - Creates a new class 
◆ rb_define_alloc_func - Lets you control how allocation happens 
➔ Types 
◆ Strings, Arrays, Hashes, Numbers 
◆ Check_Type(r_radius, T_FLOAT) 
◆ E.g. Strings 
● rb_str_new(const char *ptr, long len) 
● rb_str_new2(const char *ptr) 
● rb_str_cat(VALUE str, const char *ptr, long len) 
● rb_str_modify(VALUE str)
C Extensions 
SPECS 
In Ruby!!
Community 
● Rails Girls and Rails Girls Next 
● RoRo Syd 
● Ninefold, Re-Interactive 
● Installfest, Developer Hub 
● General Assembly 
● New Groups - Ruby Women, Women Who 
Code
Questions ?

Weitere ähnliche Inhalte

Was ist angesagt?

NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
eddify
 

Was ist angesagt? (10)

NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
History of JavaScript
History of JavaScriptHistory of JavaScript
History of JavaScript
 
Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Overview of the Open Source Vulkan Driver for Raspberry Pi  4Overview of the Open Source Vulkan Driver for Raspberry Pi  4
Overview of the Open Source Vulkan Driver for Raspberry Pi 4
 
Building the AO tech blog
Building the AO tech blogBuilding the AO tech blog
Building the AO tech blog
 
From 'Legacy' to 'Edge'
From 'Legacy' to 'Edge'From 'Legacy' to 'Edge'
From 'Legacy' to 'Edge'
 
Building the AO Tech Blog
Building the AO Tech BlogBuilding the AO Tech Blog
Building the AO Tech Blog
 
Brief History of JavaScript
Brief History of JavaScriptBrief History of JavaScript
Brief History of JavaScript
 
Web Assembly
Web AssemblyWeb Assembly
Web Assembly
 
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile....NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
 

Andere mochten auch (8)

WomenWhoCodeSydney_PerformanceTipsRoR
WomenWhoCodeSydney_PerformanceTipsRoRWomenWhoCodeSydney_PerformanceTipsRoR
WomenWhoCodeSydney_PerformanceTipsRoR
 
Ruby On Rails Sydney Meetup - Performance Tips For Apps
Ruby On Rails Sydney Meetup - Performance Tips For AppsRuby On Rails Sydney Meetup - Performance Tips For Apps
Ruby On Rails Sydney Meetup - Performance Tips For Apps
 
Wwc london-perf-apps
Wwc london-perf-appsWwc london-perf-apps
Wwc london-perf-apps
 
Tech Plan 4 Small NPOs - Hammerstrom
Tech Plan 4 Small NPOs - HammerstromTech Plan 4 Small NPOs - Hammerstrom
Tech Plan 4 Small NPOs - Hammerstrom
 
Mc sheriff
Mc sheriffMc sheriff
Mc sheriff
 
S ta r chart presentation
S ta r chart presentationS ta r chart presentation
S ta r chart presentation
 
E rate slides
E rate slidesE rate slides
E rate slides
 
Converge Short ECMP Sept 2015
Converge Short ECMP Sept 2015Converge Short ECMP Sept 2015
Converge Short ECMP Sept 2015
 

Ähnlich wie Ruby confhighlights

Ruby/rails performance and profiling
Ruby/rails performance and profilingRuby/rails performance and profiling
Ruby/rails performance and profiling
Danny Guinther
 

Ähnlich wie Ruby confhighlights (20)

The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Introduction to Ruby Native Extensions and Foreign Function Interface
Introduction to Ruby Native Extensions and Foreign Function InterfaceIntroduction to Ruby Native Extensions and Foreign Function Interface
Introduction to Ruby Native Extensions and Foreign Function Interface
 
Node.js an Exectutive View
Node.js an Exectutive ViewNode.js an Exectutive View
Node.js an Exectutive View
 
Ruby microservices with Docker - Sergii Koba
Ruby microservices with Docker -  Sergii KobaRuby microservices with Docker -  Sergii Koba
Ruby microservices with Docker - Sergii Koba
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
rubyonrails
rubyonrailsrubyonrails
rubyonrails
 
rubyonrails
rubyonrailsrubyonrails
rubyonrails
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
Ruby/rails performance and profiling
Ruby/rails performance and profilingRuby/rails performance and profiling
Ruby/rails performance and profiling
 
Autolab Workshop
Autolab WorkshopAutolab Workshop
Autolab Workshop
 
Hack Rio/OS
Hack Rio/OSHack Rio/OS
Hack Rio/OS
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
 
Writing a Gem with native extensions
Writing a Gem with native extensionsWriting a Gem with native extensions
Writing a Gem with native extensions
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to rails
 
Ansible deployment
Ansible deploymentAnsible deployment
Ansible deployment
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Ruby confhighlights

  • 1. RubyConf Snippets (RubyConf Australia 2014 - Feb 18-20)
  • 2. What is it? ● Annually in Australia (Melbourne/Sydney) ● Around the world (e.g. Miami, India, Argentina) ● Variety of talks held over 2 days ● Local and International speakers ● A day of workshops (e.g. Rails Girls Next, C Extensions, Rspec) ● Best practises, examples, inspiration, meet new people ● Videos - http://vimeo.com/rubyau
  • 3. This Year ● Continuous Delivery ● Rails Engines ● Middleware ● Ruby 2.1 ● Minitest ● Programming as a Parent ● Asset Pipeline ● MongoDB ● Concurrency Practices in Ruby ● JRuby ● Security ● Loads more ... https://m.lanyrd.com/2014/rubyconf-au/schedule/ ● Videos - http://vimeo.com/rubyau
  • 4. The Snippets ● Continuous Deployment ● Rails Engines ● C Extensions ● Community
  • 8. Rails Engines ● Slow ● Buggy ● New features take too long ● Disploys are complicated ● So many dependencies
  • 9. Rails Engines rails plugin new <engine_name> --mountable rails g controller <controller_name> rake db:migrate rake <engine_name>:install:migrations gem 'engine_name', path: "vendor/engines/engine_name" ● engine.rb, routes.rb, application.rb ● test app (test/dummy) ● namespaced - routes, views, tables etc ● migrations ● SOA, Model Managers
  • 10. Rails Engines ● Avoid accessing ActiveRecord directly ● Domain API ● Smart & Fast test suite => test changes in the changed engine
  • 11. C Extensions ● C code in a Ruby Gem ● E.g. nokogiri ● Testable (write Rspec on C code!) ● Why? speedier (Ruby is not slow, but not great on processing e.g. image processing) ● Ruby wrapper for C libs
  • 12. C Extensions bundle gem <gem_name> create the gem # <gem_name>.gemspec spec.add_development_dependency "rake-compiler" # Rakefile require "rake/extensiontask" Rake::ExtensionTask.new('rbshop') do |ext| ext.lib_dir = "lib/rbshop" end mkdir -p ext/gem_name C code lives here
  • 13. C Extensions # ext/gem_name/extconf.rb add extension config file require ‘mkmf’ creates makefile to compile C code create_makefile(‘gem_name’) # ext/gem_name/gem_name.c initialise the extension ruby.h is the C API e.g. INT2NUM
  • 14. C Extensions ● free() and malloc() ● Tell Ruby what methods to allocate and free memory ● Ruby holds onto memory until it needs to free it
  • 15. C Extensions ➔ Call functions that define modules/classes: ◆ rb_define_module - Creates modules ◆ rb_define_class_under - Creates a new class ◆ rb_define_alloc_func - Lets you control how allocation happens ➔ Types ◆ Strings, Arrays, Hashes, Numbers ◆ Check_Type(r_radius, T_FLOAT) ◆ E.g. Strings ● rb_str_new(const char *ptr, long len) ● rb_str_new2(const char *ptr) ● rb_str_cat(VALUE str, const char *ptr, long len) ● rb_str_modify(VALUE str)
  • 16. C Extensions SPECS In Ruby!!
  • 17. Community ● Rails Girls and Rails Girls Next ● RoRo Syd ● Ninefold, Re-Interactive ● Installfest, Developer Hub ● General Assembly ● New Groups - Ruby Women, Women Who Code