SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Ruby on Rails,
Apache httpd, and Oracle
Dan Davis
davisda4@mail.nlm.nih.gov
B1N14Q
Overview
 Why this Talk?
 Ruby on Rails
 Fast prototyping (demo)
 Integrating with Apache httpd
 Integrating with Oracle
 Maybe demo
Why this Talk?
 Node.js, MongoDB, and Express were cool
 Lots of Rapid Prototyping Environments
• Ruby on Rails (Digital Collections)
• ColdFusion (many things)
• php (Cake)
 Secure, Reliable, Transparent Data
 Integration
Why Ruby on Rails?
 How I started: a great application
 MVC
• Rapid prototyping
• Separation of Concerns
• Generators
 Unit and Integration Testing
 Security is built-in
 Community
 Library of “gems”
Ruby Overview
 General Purpose
 Innovative Class and Object model
 Domain Specific Languages
 Lamdas (function objects), Blocks, and Mixins
 JRuby
Class and Object model
•Everything is an Object
•Module – namespace, interface, behavior
•Class – inheritance, instantiation
Ruby - Domain Specific Languages
 Implicit Hash, no parents
doit first, second, :k1 => v1, :k2 => v2
doit first, second, k1: v1, k2: v2
 Comes from Functional Programming
(FORTH, Tcl, Ruby, Python)
 Examples Today
• Gemfile
• Routing
• Rspec Tests (BDD)
Ruby - Lambdas and Blocks
 Lambdas – function objects
l = lambda ( “There is no try” )
Puts l.call
 Blocks – are implicit arguments
def implicit_block(number)
puts yield(number)
end
implicit_block(7) { |number| number + 1 }
 Blocks – sometimes explicit
def explicit_block (number, &block)
Ruby - Mixins
 Can include a module
class AccountController
include AccountHelpers
…
 Can extend a module
bar = Bar.new
bar.extend Foo
 Can re-open objects
class String
def empty?
end
 Changes API Design
Ruby - jruby
 ruby is like perl – C with links to libs
 jruby is JVM implementation
 jruby starts slow, gets fast
 Not quite transparent
• Some “gems” implemented differently
• Some “gems” not available
• Cannot call SWT/Swing from ruby!
• Higher bar to start
Rails - Generators
 Application
rails new demoapp
 Model
rails generate User name:string 
email:string password_hash:string
 Migration
rails g migration AddRoleToUser
 Controller
rails g controller Users all view edit
 Integration Test
rails g integration_test AccountSettings
Ruby - Gemfile
 Tracks dependencies (like Ivy, Maven)
 Example of Domain Specific Language
 Easy
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 3.1.0'
gem 'jquery-datatables-rails'
Rails - Routing
 config/routes.rb
Nedtable::Application.routes.draw do
get ‘users’, to: ‘users#all’
post ‘users’, to: ‘users#create’
get ‘users/:id’, to: ‘users#view’
get ‘users/:id/edit’, to: ‘users#edit’
post ‘users/:id’, to: ‘users#update’
end
 See it in web
 See it on the console
Rails - rspec
 Behavioral Driven Testing
 Easy to read
describe MarcExporter do
it { should respond_to :to_marc }
it { should respond_to :reader }
…
describe "for NLM UI 1589530" do
…
its(:to_xml) { should == xmldata }
its(:to_marc) { should == mrcdata }
end
 “Mock” network connections
Rails - security
 CSRF
• automatically adds to form
• Automatically checks
 Injection
• You never have to write SQL
• Automatically wraps SQL/XML
 CSS - Safe by default
<%= “<br/>”.html_safe() %>
Rails - So much more
 Asset Pipeline
 Layouts
 Engines
 “gems” and more “gems”
Why Apache2? Why Oracle?
 Good Tools give you:
 Shoulders to stand on (powerful abstractions)
 Without compromising flexibility
 Good Architecture:
 Same thing at Project level
 Good Standards:
 Same thing at Organizational Level
Apache2 - Context
Apache2 – nlm.conf
<Location /solr>
ProxyPass ajp://localhost:8009/solr
ProxyPassReverse ajp://localhost:8009/solr
Options -MultiViews
Order allow,deny
Allow from 130.14.160.225/24
AuthType CAS
AuthName "NLM Login"
CASScope /
Require user davisda4 butlerj pantr
CASAuthNHeader REMOTE_USER
</Location>
Oracle - Benefits
 Reliable
 Secure
 XMLDB is included
 Transparent – SQL Developer/Toad
 Oracle Support in OSS evaluation
• Measures maturity
• Measures Enterprise readiness
Oracle – link to Rails
 Gemfile
gem 'ruby-oci8', '~> 2.1.0'
gem 'activerecord-oracle_enhanced-adapter’
 config/database.yml
development:
adapter: oracle_enhanced
database: 'oltp01_dev'
username: 'discovery'
password: ‘cleartext’
 Integrating getDBPassword
password: <% `getDBPassword …` %>
 Multiple Databases
establish_connection :serials
Let’s Build Something
 ER Diagram
 Navigational State Diagram
Cheat sheet #1
 Create Application
rails new allhands –T
cd allhands
 Update Gemfile and get dependencies
vim Gemfile
bundle update
bundle install
 Integrate dependencies through generators
rails g devise:install
rails g active_admin:install
rake db:migrate
Cheat sheet #2
 Create Models
rails g model Person …
rails g model OrgUnit …
rake db:migrate
rails g active_admin:resource Person
rails g active_admin:resource OrgUnit
 Fix Saving the Data
 Fix “associations”, e.g. foreign keys
 Add graphviz integration
 How much code did I write?
Takeaways - Learning
 Ms. Frizzle
• Make mistakes
• Try things
• Get messy
 Learning is Fun
• Cold Fusion MVC frameworks?
• Call Java libraries from CFML?
• Call jruby libs from CFML?
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsFu Cheng
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 
Java, Ruby & Rails
Java, Ruby & RailsJava, Ruby & Rails
Java, Ruby & RailsPeter Lind
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the WildTomer Gabel
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)daylerees
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitJukka Zitting
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsManoj Kumar
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettextNgoc Dao
 
Skinny Framework Progress Situation
Skinny Framework Progress SituationSkinny Framework Progress Situation
Skinny Framework Progress SituationKazuhiro Sera
 
Building Micro-Services with Scala
Building Micro-Services with ScalaBuilding Micro-Services with Scala
Building Micro-Services with ScalaYardena Meymann
 
Ruby on Rails Penetration Testing
Ruby on Rails Penetration TestingRuby on Rails Penetration Testing
Ruby on Rails Penetration Testing3S Labs
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015Tim Bracken
 
Beginning Scala with Skinny Framework #jjug_ccc
Beginning Scala with Skinny Framework #jjug_cccBeginning Scala with Skinny Framework #jjug_ccc
Beginning Scala with Skinny Framework #jjug_cccKazuhiro Sera
 
Zeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridZeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridJongyoul Lee
 

Was ist angesagt? (20)

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Apache Jackrabbit
Apache JackrabbitApache Jackrabbit
Apache Jackrabbit
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and Enhancements
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
Java, Ruby & Rails
Java, Ruby & RailsJava, Ruby & Rails
Java, Ruby & Rails
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Ruby on rails for beginers
Ruby on rails for beginersRuby on rails for beginers
Ruby on rails for beginers
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache Jackrabbit
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Laravel
LaravelLaravel
Laravel
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Skinny Framework Progress Situation
Skinny Framework Progress SituationSkinny Framework Progress Situation
Skinny Framework Progress Situation
 
Building Micro-Services with Scala
Building Micro-Services with ScalaBuilding Micro-Services with Scala
Building Micro-Services with Scala
 
Ruby on Rails Penetration Testing
Ruby on Rails Penetration TestingRuby on Rails Penetration Testing
Ruby on Rails Penetration Testing
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
 
Beginning Scala with Skinny Framework #jjug_ccc
Beginning Scala with Skinny Framework #jjug_cccBeginning Scala with Skinny Framework #jjug_ccc
Beginning Scala with Skinny Framework #jjug_ccc
 
Zeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridZeppelin meetup 2016 madrid
Zeppelin meetup 2016 madrid
 

Andere mochten auch

Essential programmer library
Essential programmer libraryEssential programmer library
Essential programmer libraryAndrew Hunt
 
Ruby on Rails in UbiSunrise
Ruby on Rails in UbiSunriseRuby on Rails in UbiSunrise
Ruby on Rails in UbiSunriseWisely chen
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Andere mochten auch (8)

Essential programmer library
Essential programmer libraryEssential programmer library
Essential programmer library
 
Ruby on Rails in UbiSunrise
Ruby on Rails in UbiSunriseRuby on Rails in UbiSunrise
Ruby on Rails in UbiSunrise
 
Slides
SlidesSlides
Slides
 
Rubynetto
RubynettoRubynetto
Rubynetto
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Ähnlich wie Ruby on Rails All Hands Meeting

Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rbawwaiid
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Day 2 - Intro to Rails
Day 2 - Intro to RailsDay 2 - Intro to Rails
Day 2 - Intro to RailsBarry Jones
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Ricardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devopsRicardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devopsSVDevOps
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOpsRicardo Sanchez
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 
Ruby Conf Preso
Ruby Conf PresoRuby Conf Preso
Ruby Conf PresoDan Yoder
 
Node.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankNode.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankCarsten Czarski
 

Ähnlich wie Ruby on Rails All Hands Meeting (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Day 2 - Intro to Rails
Day 2 - Intro to RailsDay 2 - Intro to Rails
Day 2 - Intro to Rails
 
Laravel 4 presentation
Laravel 4 presentationLaravel 4 presentation
Laravel 4 presentation
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Oracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node finalOracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node final
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Ricardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devopsRicardo Sanchez - Ruby projects of interest for devops
Ricardo Sanchez - Ruby projects of interest for devops
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
Ruby Conf Preso
Ruby Conf PresoRuby Conf Preso
Ruby Conf Preso
 
RoR guide_p1
RoR guide_p1RoR guide_p1
RoR guide_p1
 
Node.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankNode.js und die Oracle-Datenbank
Node.js und die Oracle-Datenbank
 

Kürzlich hochgeladen

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
 
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
 
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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
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
 
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
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

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
 
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
 
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...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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...
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Ruby on Rails All Hands Meeting

  • 1. Ruby on Rails, Apache httpd, and Oracle Dan Davis davisda4@mail.nlm.nih.gov B1N14Q
  • 2. Overview  Why this Talk?  Ruby on Rails  Fast prototyping (demo)  Integrating with Apache httpd  Integrating with Oracle  Maybe demo
  • 3. Why this Talk?  Node.js, MongoDB, and Express were cool  Lots of Rapid Prototyping Environments • Ruby on Rails (Digital Collections) • ColdFusion (many things) • php (Cake)  Secure, Reliable, Transparent Data  Integration
  • 4. Why Ruby on Rails?  How I started: a great application  MVC • Rapid prototyping • Separation of Concerns • Generators  Unit and Integration Testing  Security is built-in  Community  Library of “gems”
  • 5. Ruby Overview  General Purpose  Innovative Class and Object model  Domain Specific Languages  Lamdas (function objects), Blocks, and Mixins  JRuby
  • 6. Class and Object model •Everything is an Object •Module – namespace, interface, behavior •Class – inheritance, instantiation
  • 7. Ruby - Domain Specific Languages  Implicit Hash, no parents doit first, second, :k1 => v1, :k2 => v2 doit first, second, k1: v1, k2: v2  Comes from Functional Programming (FORTH, Tcl, Ruby, Python)  Examples Today • Gemfile • Routing • Rspec Tests (BDD)
  • 8. Ruby - Lambdas and Blocks  Lambdas – function objects l = lambda ( “There is no try” ) Puts l.call  Blocks – are implicit arguments def implicit_block(number) puts yield(number) end implicit_block(7) { |number| number + 1 }  Blocks – sometimes explicit def explicit_block (number, &block)
  • 9. Ruby - Mixins  Can include a module class AccountController include AccountHelpers …  Can extend a module bar = Bar.new bar.extend Foo  Can re-open objects class String def empty? end  Changes API Design
  • 10. Ruby - jruby  ruby is like perl – C with links to libs  jruby is JVM implementation  jruby starts slow, gets fast  Not quite transparent • Some “gems” implemented differently • Some “gems” not available • Cannot call SWT/Swing from ruby! • Higher bar to start
  • 11. Rails - Generators  Application rails new demoapp  Model rails generate User name:string email:string password_hash:string  Migration rails g migration AddRoleToUser  Controller rails g controller Users all view edit  Integration Test rails g integration_test AccountSettings
  • 12. Ruby - Gemfile  Tracks dependencies (like Ivy, Maven)  Example of Domain Specific Language  Easy # Use jquery as the JavaScript library gem 'jquery-rails', '~> 3.1.0' gem 'jquery-datatables-rails'
  • 13. Rails - Routing  config/routes.rb Nedtable::Application.routes.draw do get ‘users’, to: ‘users#all’ post ‘users’, to: ‘users#create’ get ‘users/:id’, to: ‘users#view’ get ‘users/:id/edit’, to: ‘users#edit’ post ‘users/:id’, to: ‘users#update’ end  See it in web  See it on the console
  • 14. Rails - rspec  Behavioral Driven Testing  Easy to read describe MarcExporter do it { should respond_to :to_marc } it { should respond_to :reader } … describe "for NLM UI 1589530" do … its(:to_xml) { should == xmldata } its(:to_marc) { should == mrcdata } end  “Mock” network connections
  • 15. Rails - security  CSRF • automatically adds to form • Automatically checks  Injection • You never have to write SQL • Automatically wraps SQL/XML  CSS - Safe by default <%= “<br/>”.html_safe() %>
  • 16. Rails - So much more  Asset Pipeline  Layouts  Engines  “gems” and more “gems”
  • 17. Why Apache2? Why Oracle?  Good Tools give you:  Shoulders to stand on (powerful abstractions)  Without compromising flexibility  Good Architecture:  Same thing at Project level  Good Standards:  Same thing at Organizational Level
  • 19. Apache2 – nlm.conf <Location /solr> ProxyPass ajp://localhost:8009/solr ProxyPassReverse ajp://localhost:8009/solr Options -MultiViews Order allow,deny Allow from 130.14.160.225/24 AuthType CAS AuthName "NLM Login" CASScope / Require user davisda4 butlerj pantr CASAuthNHeader REMOTE_USER </Location>
  • 20. Oracle - Benefits  Reliable  Secure  XMLDB is included  Transparent – SQL Developer/Toad  Oracle Support in OSS evaluation • Measures maturity • Measures Enterprise readiness
  • 21. Oracle – link to Rails  Gemfile gem 'ruby-oci8', '~> 2.1.0' gem 'activerecord-oracle_enhanced-adapter’  config/database.yml development: adapter: oracle_enhanced database: 'oltp01_dev' username: 'discovery' password: ‘cleartext’  Integrating getDBPassword password: <% `getDBPassword …` %>  Multiple Databases establish_connection :serials
  • 22. Let’s Build Something  ER Diagram  Navigational State Diagram
  • 23. Cheat sheet #1  Create Application rails new allhands –T cd allhands  Update Gemfile and get dependencies vim Gemfile bundle update bundle install  Integrate dependencies through generators rails g devise:install rails g active_admin:install rake db:migrate
  • 24. Cheat sheet #2  Create Models rails g model Person … rails g model OrgUnit … rake db:migrate rails g active_admin:resource Person rails g active_admin:resource OrgUnit  Fix Saving the Data  Fix “associations”, e.g. foreign keys  Add graphviz integration  How much code did I write?
  • 25. Takeaways - Learning  Ms. Frizzle • Make mistakes • Try things • Get messy  Learning is Fun • Cold Fusion MVC frameworks? • Call Java libraries from CFML? • Call jruby libs from CFML?