SlideShare a Scribd company logo
1 of 18
Download to read offline
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 ?

More Related Content

What's hot

NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1eddify
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsSetyo Nugroho
 
History of JavaScript
History of JavaScriptHistory of JavaScript
History of JavaScriptRajat Saxena
 
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 4Igalia
 
Building the AO tech blog
Building the AO tech blogBuilding the AO tech blog
Building the AO tech blogAO Tech
 
Building the AO Tech Blog
Building the AO Tech BlogBuilding the AO Tech Blog
Building the AO Tech BlogSarahNorris47
 
.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...Karel Zikmund
 

What's hot (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...
 

Viewers also liked

WomenWhoCodeSydney_PerformanceTipsRoR
WomenWhoCodeSydney_PerformanceTipsRoRWomenWhoCodeSydney_PerformanceTipsRoR
WomenWhoCodeSydney_PerformanceTipsRoRClaire Tran
 
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 AppsClaire Tran
 
Wwc london-perf-apps
Wwc london-perf-appsWwc london-perf-apps
Wwc london-perf-appsClaire Tran
 
Tech Plan 4 Small NPOs - Hammerstrom
Tech Plan 4 Small NPOs - HammerstromTech Plan 4 Small NPOs - Hammerstrom
Tech Plan 4 Small NPOs - Hammerstromjohanciti
 
Mc sheriff
Mc sheriffMc sheriff
Mc sheriffalbandma
 
S ta r chart presentation
S ta r chart presentationS ta r chart presentation
S ta r chart presentationcmunoz111777
 
E rate slides
E rate slidesE rate slides
E rate slidesawillia8
 
Converge Short ECMP Sept 2015
Converge Short ECMP Sept 2015Converge Short ECMP Sept 2015
Converge Short ECMP Sept 2015Jo_Vann
 

Viewers also liked (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
 

Similar to Ruby confhighlights

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 RubyHiroshi SHIBATA
 
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 futureHiroshi SHIBATA
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
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 InterfaceOleksii Sukhovii
 
Ruby microservices with Docker - Sergii Koba
Ruby microservices with Docker -  Sergii KobaRuby microservices with Docker -  Sergii Koba
Ruby microservices with Docker - Sergii KobaRuby Meditation
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
Ruby/rails performance and profiling
Ruby/rails performance and profilingRuby/rails performance and profiling
Ruby/rails performance and profilingDanny Guinther
 
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 2012Rafael Rosa
 
Writing a Gem with native extensions
Writing a Gem with native extensionsWriting a Gem with native extensions
Writing a Gem with native extensionsTristan Penman
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to railsGo Asgard
 
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 serverEugene Yokota
 
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 CoreHiroshi SHIBATA
 

Similar to 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
 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
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...DianaGray10
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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...apidays
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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...Martijn de Jong
 
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 DiscoveryTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
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 FresherRemote DBA Services
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 
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)
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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?
 
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
 

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