SlideShare una empresa de Scribd logo
1 de 48
My Ruby (and Rails)
   environment
 Reuven M. Lerner • reuven@lerner.co.il
Rails Underground, Israel • July 13th, 2011
Who am I?

• Web developer, software architect,
  consultant, lecturer/trainer
• Linux Journal columnist since 1996
• Mostly Ruby on Rails + PostgreSQL, but
  also Python, PHP, jQuery, and lots more...
Want to learn Rails?

• I’m teaching a course at Hi-Tech College
• Not very far from here!
• August 14 - 18 , 2011
            th    th


• (I can do private training as well...)
Also:

• I’m swamped with Ruby work!
• Want to help me out?
• (I need to sleep!)
• Come speak with me after my talk...
Tools are important
Shell
• For years, I used bash
 • GNU Bourne-Again Shell
• I recently switched to zsh
• I use the plugin, “oh my zsh”
• Did it change my life? No.
 • But some things are easier
Better things

• Easy-to-customize prompt
• Saner history (across terminal tabs)
• Automatic updates of oh-my-zsh
• One configuration file (.zshrc)
Things I use often

• C-z (suspend) and fg
• Emacs keybinding
• C-r (reverse search
• Customized prompt
iTerm2
• The OS X terminal is OK
• iTerm used to be much better
• Recently rewritten as iTerm2
• I use very few of the features
 • Lots of tabs, though!
• My favorites: Search, movie playback
rvm
• Don’t develop in Ruby without rvm
• Really, it’s amazing
• I use 1.8.7, 1.9.2, and JRuby day to day
 • Learn about updates!
• .rvmrc for each project I work on
• Gemsets vs. bundles — bundles are winning
irb
• I use irb (or the Rails console) every day
• If you’re programming in Ruby, then you
  should probably have IRB open always!
• Every piece of code I write, more or less, is
  tried in IRB first
• Debugging largely happens for me in IRB
Gems for IRB!

• There has been an explosion of IRB-
  enhancing gems
• I’ll present some of them
• Most or all of these are from the “irbtools”
  gem, which packages them together
ap


• “Awesome print” — and it is!
• Data structures look nicer, in color
Sorted methods!

• How often do you write
  foo.methods.sort
• Now you can just write
  foo.methods
every_day_irb

• Puts shell commands in IRB!
  ls
  cat
  pwd
;nil after long evals

• Cute trick: If you’re reading a lot of data, add
  ;nil
• to the end of your command, so that IRB
  won’t print it all.
hirb
• Shows data in a table
• Sort of like ap, but for to_s
• Better with ActiveRecord output
• If you want to disable it (I do by default),
  just set Hirb::View.disable, or
  Hirb::View.enable
methodfinder

• Methodfinder.find
• Object#find_method
  "abc".find_method("ABC")
sketch

• Anonymous edits
• Named edits
• Great with emacsclient (for Emacs users)
  sketch
  sketch :foo
GNU Emacs
• One True Editor
• I’ve used it since 1988 (yes, 1988!)
• More operating system than editor
• Configure it in Emacs Lisp
 • Full, Turing-complete language with
    oodles of functions for text, files,
    networks, and psychoanalysis
Ideal Emacs keyboard
Required anti-vi joke
Subject: Re: HELP: music for cl, vi, vlc, pi

Date: 14 May 1996 10:35:43 +0200

Alan> vi doesn't play music.

David> Sure it does.

In fact, vi has a special mode just for music. If you
are not in insert mode, you are in `beep' mode:
whatever you press produces a beep. In the best
tradition of vi, there is of course just one note
(you know: small is beautiful) but this is just one
of those reasons why vi hackers love vi.
How Emacs works
How Emacs works


              Lisp
            function
How Emacs works


                    Lisp
    Key binding
                  function
How Emacs works


                            Lisp
Keystroke   Key binding
                          function
Sounds crazy?

• It’s great.
• Define functions. Or install packages.
• Set bindings (global or modal).
• Use control-alt-shift-meta-cokebottle
Function, binding
(defun indent-buffer (&optional which-buffer)
  "Indents a buffer (default is current)."
  (interactive "bBuffer to indent: ")
  (indent-region (point-min) (point-max) nil)
  (beep)
  (message "Done indenting"))


(global-set-key   "ei" 'indent-buffer)
(add-hook 'ruby-mode-hook
          '(lambda ()
             (interactive)
             (inf-ruby-keys)

       (rainbow-delimiters-mode t)
             (turn-on-font-lock)
             (ruby-electric-mode t)

       (rvm-activate-corresponding-ruby)

       (if (and (not (null buffer-file-name))

   
        (file-writable-p buffer-file-name)

 
 
           (not (string-match "jruby" rvm--
current-ruby-binary-path)))

   
   (flymake-mode))

       ))
Snippets

• TextMate fans, rejoice — Emacs has
  snippets, too!
  • It has had “abbrevs” forever
• Even import TextMate snippets
• I don’t use these that much, to be honest
Intellisense?

• Everyone in Israel asks about it!
• Emacs has a few options that come close
• I’ve used it on a few occasions, but never
  really liked it
Flymake


• Check your syntax (with a background
  Ruby process) as you type!
• Errors? The line appears in red
Ruby electric mode


• Inserts extra quotes, braces,
• Also inserts “end” after class, module, if,
  etc.
Rainbow delimiters

• Fancy braces!
• Each set of parens/braces gets its own
  color
• Lovely when you have a hash
Rinari
• Rinari Is Not A Rails IDE
• Keyboard shortcuts to jump to related
  parts of the code
• Tries to be minimal
• There’s also emacs-rails — more
  functionality, but updated less frequently
ERb and Haml


• Handles colorizing, indenting
• Flymake works inside of ERb, also!
Switching buffers

• From controllers (C-c ‘ f c) — functional
  tests (C-c ‘ f t)
• Models (C-c ‘ f m) — unit tests (or C-c ‘ f t)
• Switch to the log (C-c ‘ f o)
Tags
• Index of names in your files
• Jump to the right file/line
• Even search/replace
• I go back and forth on using tags ... they
  work really well, but I’m often too lazy, and
  end up using “git grep”
Emacs server

• If you’re starting Emacs more than once a
  day, then you’re doing something wrong
• Open buffers
• Connect from outside
 • e.g., sketch (from before, in IRB)
Magit

• Use Git from within Emacs!
 • Stage, Commit, Stash
 • Branch, Merge
 • Push, pull
• Fully integrated, and works really nicely
Macros

• Record a macro
• Replay any number of times
• Super-duper useful, especially when
  converting files
Firefox plugins

• I use Firefox as my main browser
• Not the fastest (for now!)
• Not updated like Chrome (for now!)
• But it has excellent plugins
Firebug
• Everyone’s favorite JavaScript/Ajax
  debugger
• Console
• Execute JavaScript
• Modify CSS in real time
• Truly an amazing piece of software
Web developer

• “View Generated HTML” — my favorite!
• Also:View HTTP request, response headers
• Mark items with boxes
Growl

• Notification system under OS X
• Autotest + Growl gives me nice output for
  red/green
• Just require “autotest/growl” in your
  ~/.autotest file
Pow
• Finally, I have to run things locally
• 37signals recently released Pow for OS X
• (There’s talk of doing it for Linux, too)
• Super-duper easy:
 • symlink from ~/.pow/foo to project foo
 • Now go to http://foo.dev !
Thanks!
(Any questions?)
     reuven@lerner.co.il
   http://www.lerner.co.il/
        054-496-8405
“reuvenlerner” on Skype/AIM

Más contenido relacionado

La actualidad más candente

Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devopsRob Kinyon
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersDiego Freniche Brito
 
Python to go
Python to goPython to go
Python to goWeng Wei
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time rebootKentaro Goto
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttackKyle Drake
 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Rubysikachu
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Michał Konarski
 
ZeroMQ at Oredev 2013
ZeroMQ at Oredev 2013ZeroMQ at Oredev 2013
ZeroMQ at Oredev 2013Ashic Mahtab
 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeForrest Chang
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with GoSteven Francia
 
Why Plone Will Die
Why Plone Will DieWhy Plone Will Die
Why Plone Will DieAndreas Jung
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettextNgoc Dao
 

La actualidad más candente (20)

Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented Programmers
 
Python to go
Python to goPython to go
Python to go
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Tofu and its environment
Tofu and its environmentTofu and its environment
Tofu and its environment
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Ruby
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
ZeroMQ at Oredev 2013
ZeroMQ at Oredev 2013ZeroMQ at Oredev 2013
ZeroMQ at Oredev 2013
 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hope
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
Why Plone Will Die
Why Plone Will DieWhy Plone Will Die
Why Plone Will Die
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 

Destacado

Big Data — Your new best friend
Big Data — Your new best friendBig Data — Your new best friend
Big Data — Your new best friendReuven Lerner
 
Ukrainian branch of WDC
Ukrainian branch of WDCUkrainian branch of WDC
Ukrainian branch of WDCOleksii Leonov
 
Web APIs: The future of software
Web APIs: The future of softwareWeb APIs: The future of software
Web APIs: The future of softwareReuven Lerner
 
Introduction to Version Control Systems
Introduction to Version Control SystemsIntroduction to Version Control Systems
Introduction to Version Control SystemsOleksii Leonov
 
What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?Reuven Lerner
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databaseReuven Lerner
 
Python's magic methods
Python's magic methodsPython's magic methods
Python's magic methodsReuven Lerner
 
Technical training business talk.key
Technical training business talk.keyTechnical training business talk.key
Technical training business talk.keyReuven Lerner
 
Online Stock Trading
Online Stock TradingOnline Stock Trading
Online Stock Tradingarfatrulz
 
Intro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemIntro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemReuven Lerner
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shelljaguardesignstudio
 

Destacado (20)

Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Rails console
Rails consoleRails console
Rails console
 
Big Data — Your new best friend
Big Data — Your new best friendBig Data — Your new best friend
Big Data — Your new best friend
 
Ukrainian branch of WDC
Ukrainian branch of WDCUkrainian branch of WDC
Ukrainian branch of WDC
 
Rails tools
Rails toolsRails tools
Rails tools
 
Ruby objects
Ruby objectsRuby objects
Ruby objects
 
Web APIs: The future of software
Web APIs: The future of softwareWeb APIs: The future of software
Web APIs: The future of software
 
Introduction to Version Control Systems
Introduction to Version Control SystemsIntroduction to Version Control Systems
Introduction to Version Control Systems
 
Rails traps
Rails trapsRails traps
Rails traps
 
Rails israel 2013
Rails israel 2013Rails israel 2013
Rails israel 2013
 
What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
 
Python's magic methods
Python's magic methodsPython's magic methods
Python's magic methods
 
Technical training business talk.key
Technical training business talk.keyTechnical training business talk.key
Technical training business talk.key
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
User interface design
User interface designUser interface design
User interface design
 
Online Stock Trading
Online Stock TradingOnline Stock Trading
Online Stock Trading
 
Intro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemIntro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, Jerusalem
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shell
 

Similar a Rails development environment talk

Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data SafeTony Tam
 
Scratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieScratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieESUG
 
Erlang - Dive Right In
Erlang - Dive Right InErlang - Dive Right In
Erlang - Dive Right Invorn
 
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
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Charles Nutter
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript ProgrammingYoshiki Shibukawa
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pieTomas Doran
 
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 Transparent Web: Bridging the Chasm in Web Development
The Transparent Web: Bridging the Chasm in Web DevelopmentThe Transparent Web: Bridging the Chasm in Web Development
The Transparent Web: Bridging the Chasm in Web Developmenttwopoint718
 
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?Joshua Ballanco
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Not Everything is an Object - Rocksolid Tour 2013
Not Everything is an Object  - Rocksolid Tour 2013Not Everything is an Object  - Rocksolid Tour 2013
Not Everything is an Object - Rocksolid Tour 2013Gary Short
 

Similar a Rails development environment talk (20)

JRuby: The Hard Parts
JRuby: The Hard PartsJRuby: The Hard Parts
JRuby: The Hard Parts
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
Scratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieScratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry Pie
 
Erlang - Dive Right In
Erlang - Dive Right InErlang - Dive Right In
Erlang - Dive Right In
 
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)
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 
MPI, Erlang and the web
MPI, Erlang and the webMPI, Erlang and the web
MPI, Erlang and the web
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
EhTrace -- RoP Hooks
EhTrace -- RoP HooksEhTrace -- RoP Hooks
EhTrace -- RoP Hooks
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
The Transparent Web: Bridging the Chasm in Web Development
The Transparent Web: Bridging the Chasm in Web DevelopmentThe Transparent Web: Bridging the Chasm in Web Development
The Transparent Web: Bridging the Chasm in Web Development
 
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?
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Not Everything is an Object - Rocksolid Tour 2013
Not Everything is an Object  - Rocksolid Tour 2013Not Everything is an Object  - Rocksolid Tour 2013
Not Everything is an Object - Rocksolid Tour 2013
 

Más de Reuven Lerner

Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Reuven Lerner
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Reuven Lerner
 
Git talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelGit talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelReuven Lerner
 
Dynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupDynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupReuven Lerner
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Reuven Lerner
 
PostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferencePostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferenceReuven Lerner
 

Más de Reuven Lerner (7)

Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
 
Git talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelGit talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in Israel
 
Dynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupDynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship group
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011
 
PostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferencePostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conference
 
ActiveRecord 2.3
ActiveRecord 2.3ActiveRecord 2.3
ActiveRecord 2.3
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Rails development environment talk

  • 1. My Ruby (and Rails) environment Reuven M. Lerner • reuven@lerner.co.il Rails Underground, Israel • July 13th, 2011
  • 2. Who am I? • Web developer, software architect, consultant, lecturer/trainer • Linux Journal columnist since 1996 • Mostly Ruby on Rails + PostgreSQL, but also Python, PHP, jQuery, and lots more...
  • 3. Want to learn Rails? • I’m teaching a course at Hi-Tech College • Not very far from here! • August 14 - 18 , 2011 th th • (I can do private training as well...)
  • 4. Also: • I’m swamped with Ruby work! • Want to help me out? • (I need to sleep!) • Come speak with me after my talk...
  • 6. Shell • For years, I used bash • GNU Bourne-Again Shell • I recently switched to zsh • I use the plugin, “oh my zsh” • Did it change my life? No. • But some things are easier
  • 7. Better things • Easy-to-customize prompt • Saner history (across terminal tabs) • Automatic updates of oh-my-zsh • One configuration file (.zshrc)
  • 8. Things I use often • C-z (suspend) and fg • Emacs keybinding • C-r (reverse search • Customized prompt
  • 9. iTerm2 • The OS X terminal is OK • iTerm used to be much better • Recently rewritten as iTerm2 • I use very few of the features • Lots of tabs, though! • My favorites: Search, movie playback
  • 10. rvm • Don’t develop in Ruby without rvm • Really, it’s amazing • I use 1.8.7, 1.9.2, and JRuby day to day • Learn about updates! • .rvmrc for each project I work on • Gemsets vs. bundles — bundles are winning
  • 11. irb • I use irb (or the Rails console) every day • If you’re programming in Ruby, then you should probably have IRB open always! • Every piece of code I write, more or less, is tried in IRB first • Debugging largely happens for me in IRB
  • 12. Gems for IRB! • There has been an explosion of IRB- enhancing gems • I’ll present some of them • Most or all of these are from the “irbtools” gem, which packages them together
  • 13. ap • “Awesome print” — and it is! • Data structures look nicer, in color
  • 14. Sorted methods! • How often do you write foo.methods.sort • Now you can just write foo.methods
  • 15. every_day_irb • Puts shell commands in IRB! ls cat pwd
  • 16. ;nil after long evals • Cute trick: If you’re reading a lot of data, add ;nil • to the end of your command, so that IRB won’t print it all.
  • 17. hirb • Shows data in a table • Sort of like ap, but for to_s • Better with ActiveRecord output • If you want to disable it (I do by default), just set Hirb::View.disable, or Hirb::View.enable
  • 19. sketch • Anonymous edits • Named edits • Great with emacsclient (for Emacs users) sketch sketch :foo
  • 20. GNU Emacs • One True Editor • I’ve used it since 1988 (yes, 1988!) • More operating system than editor • Configure it in Emacs Lisp • Full, Turing-complete language with oodles of functions for text, files, networks, and psychoanalysis
  • 22. Required anti-vi joke Subject: Re: HELP: music for cl, vi, vlc, pi Date: 14 May 1996 10:35:43 +0200 Alan> vi doesn't play music. David> Sure it does. In fact, vi has a special mode just for music. If you are not in insert mode, you are in `beep' mode: whatever you press produces a beep. In the best tradition of vi, there is of course just one note (you know: small is beautiful) but this is just one of those reasons why vi hackers love vi.
  • 24. How Emacs works Lisp function
  • 25. How Emacs works Lisp Key binding function
  • 26. How Emacs works Lisp Keystroke Key binding function
  • 27. Sounds crazy? • It’s great. • Define functions. Or install packages. • Set bindings (global or modal). • Use control-alt-shift-meta-cokebottle
  • 28. Function, binding (defun indent-buffer (&optional which-buffer) "Indents a buffer (default is current)." (interactive "bBuffer to indent: ") (indent-region (point-min) (point-max) nil) (beep) (message "Done indenting")) (global-set-key "ei" 'indent-buffer)
  • 29. (add-hook 'ruby-mode-hook '(lambda () (interactive) (inf-ruby-keys) (rainbow-delimiters-mode t) (turn-on-font-lock) (ruby-electric-mode t) (rvm-activate-corresponding-ruby) (if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name) (not (string-match "jruby" rvm-- current-ruby-binary-path))) (flymake-mode)) ))
  • 30. Snippets • TextMate fans, rejoice — Emacs has snippets, too! • It has had “abbrevs” forever • Even import TextMate snippets • I don’t use these that much, to be honest
  • 31. Intellisense? • Everyone in Israel asks about it! • Emacs has a few options that come close • I’ve used it on a few occasions, but never really liked it
  • 32. Flymake • Check your syntax (with a background Ruby process) as you type! • Errors? The line appears in red
  • 33. Ruby electric mode • Inserts extra quotes, braces, • Also inserts “end” after class, module, if, etc.
  • 34. Rainbow delimiters • Fancy braces! • Each set of parens/braces gets its own color • Lovely when you have a hash
  • 35. Rinari • Rinari Is Not A Rails IDE • Keyboard shortcuts to jump to related parts of the code • Tries to be minimal • There’s also emacs-rails — more functionality, but updated less frequently
  • 36. ERb and Haml • Handles colorizing, indenting • Flymake works inside of ERb, also!
  • 37. Switching buffers • From controllers (C-c ‘ f c) — functional tests (C-c ‘ f t) • Models (C-c ‘ f m) — unit tests (or C-c ‘ f t) • Switch to the log (C-c ‘ f o)
  • 38. Tags • Index of names in your files • Jump to the right file/line • Even search/replace • I go back and forth on using tags ... they work really well, but I’m often too lazy, and end up using “git grep”
  • 39. Emacs server • If you’re starting Emacs more than once a day, then you’re doing something wrong • Open buffers • Connect from outside • e.g., sketch (from before, in IRB)
  • 40. Magit • Use Git from within Emacs! • Stage, Commit, Stash • Branch, Merge • Push, pull • Fully integrated, and works really nicely
  • 41.
  • 42. Macros • Record a macro • Replay any number of times • Super-duper useful, especially when converting files
  • 43. Firefox plugins • I use Firefox as my main browser • Not the fastest (for now!) • Not updated like Chrome (for now!) • But it has excellent plugins
  • 44. Firebug • Everyone’s favorite JavaScript/Ajax debugger • Console • Execute JavaScript • Modify CSS in real time • Truly an amazing piece of software
  • 45. Web developer • “View Generated HTML” — my favorite! • Also:View HTTP request, response headers • Mark items with boxes
  • 46. Growl • Notification system under OS X • Autotest + Growl gives me nice output for red/green • Just require “autotest/growl” in your ~/.autotest file
  • 47. Pow • Finally, I have to run things locally • 37signals recently released Pow for OS X • (There’s talk of doing it for Linux, too) • Super-duper easy: • symlink from ~/.pow/foo to project foo • Now go to http://foo.dev !
  • 48. Thanks! (Any questions?) reuven@lerner.co.il http://www.lerner.co.il/ 054-496-8405 “reuvenlerner” on Skype/AIM

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n