Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 361356e374
Fetching contributors…

Cannot retrieve contributors at this time

executable file 375 lines (325 sloc) 11.833 kb
<!doctype html>
<html>
<head lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1024, user-scalable=no">
<title>Ruby Development Stack | Presentation</title>
<meta name="description" content="Small introduction about ruby development stack." />
<meta name="author" content="Juan Hernández Babón" />
<link rel="stylesheet" href="/css/vendor/deck.core.css">
<link rel="stylesheet" href="/css/vendor/deck.hash.css">
<link rel="stylesheet" href="/css/vendor/deck.navigation.css">
<link rel="stylesheet" href="/css/vendor/deck.scale.css">
<link rel="stylesheet" href="/css/vendor/deck.status.css">
<link rel="stylesheet" href="/css/vendor/swiss.css">
<link rel="stylesheet" href="/css/vendor/horizontal-slide.css">
<script src="/js/vendor/modernizr.custom.js"></script>
<link rel="shortcut icon" href="/favicon.png" />
</head>
<body class="deck-container">
<!-- Begin slides -->
<section id="title" class="slide">
<h1>Ruby Development Stack</h1>
</section>
<section class="slide" id="about">
<h2>About me</h2>
<ul>
<li>My name is Juan Hern&aacute;ndez.</li>
<li>I work as a ruby developer in <a href="https://wuaki.tv">Wuaki.tv</a></li>
<li>Twitter: <a href="https://twitter.com/jhbabon">@jhbabon</a></li>
<li>Github: <a href="https://github.com/jhbabon">jhbabon</a></li>
</ul>
</section>
<section id="interpreters" class="slide">
<h2>Ruby interpreters</h2>
<ul>
<li>MRI.</li>
<li>JRuby.</li>
<li>Rubinius.</li>
<li>REE (will be discontinued).</li>
<li>IronRuby (Mono).</li>
<li>MacRuby.</li>
<li>And more...</li>
</ul>
</section>
<section class="slide" id="mri">
<h2>MRI</h2>
<blockquote>
<p>
Matz's Ruby Interpreter or Ruby MRI is the reference implementation of the Ruby programming language.
</p>
<cite>
<a href="http://en.wikipedia.org/wiki/Ruby_MRI">Wikipedia</a>
</cite>
</blockquote>
<ul>
<li>Versions:
<ul>
<li>1.8.7: Will be discontinued in 2013.</li>
<li>1.9.3: Current stable version.</li>
<li>2.0.0-preview1: New features. Comming February 2013.</li>
</ul>
</li>
</ul>
</section>
<section class="slide" id="jruby">
<h2>JRuby</h2>
<blockquote>
<p>
JRuby is a 100% Java implementation of the Ruby programming language. It's Ruby for the JVM.
</p>
<cite>
<a href="https://github.com/jruby/jruby/wiki/AboutJRuby">
https://github.com/jruby/jruby/wiki/AboutJRuby
</a>
</cite>
</blockquote>
<ul>
<li>Can execute Java inside Ruby.</li>
<li>Better threads management.</li>
</ul>
</section>
<section class="slide" id="rubinius">
<h2>Rubinius</h2>
<blockquote>
<p>
Provide a rich, high-performance environment for running Ruby code.
</p>
<cite>
<a href="http://en.wikipedia.org/wiki/Rubinius">Wikipedia</a>
</cite>
</blockquote>
<ul>
<li>Includes a bytecode virtual machine.</li>
<li>Compiles to bytecode.</li>
<li>Better threads management.</li>
</ul>
</section>
<section id="version-manager" class="slide">
<h2>Version manager</h2>
<ul>
<li>You can install many interpreters.</li>
<li>You can switch the interpreter.</li>
<li>You can test your app against various interpreters.</li>
<li>Most importants:
<ul>
<li>RVM</li>
<li>rbenv</li>
</ul>
</li>
</ul>
</section>
<section id="rvm-1" class="slide">
<h2>RVM</h2>
<ul>
<li>Widely used.</li>
<li>Active development.</li>
<li>
With it you can:
<ul>
<li>Install many versions of ruby.</li>
<li>Manage gemsets.</li>
</ul>
</li>
<li>
It has a GUI for Mac:
<a href="http://unfiniti.com/software/mac/jewelrybox/">
jewelrybox
</a>
</li>
</ul>
</section>
<section id="rvm-2" class="slide">
<h2>RVM</h2>
<h4>But...</h4>
<ul>
<li>
It overrides some shell functions (like <code>cd</code> and <code>gem</code>).
</li>
<li>
It install its own packages instead of use the ones available in the system (openssl, ...).
</li>
<li>Sometimes is a pain.</li>
</ul>
</section>
<section class="slide" id="rbenv">
<h2>rbenv</h2>
<ul>
<li>Same principles as RVM: manage and control ruby versions.</li>
<li>It doesn't install interpreters, only manages them.</li>
<li>Configurable via plugins:
<ul>
<li>Install (with ruby-build).</li>
<li>Gemsets.</li>
</ul>
</li>
<li>Easy. Faster.</li>
<li>More UNIX.</li>
<li>Only manipulates shell env variables, like <code>PATH</code>.</li>
</ul>
</section>
<section class="slide" id="gem-command">
<h2>Gem: Command</h2>
<ul>
<li>Part of the ruby interpreter.</li>
<li>Package manager for ruby.</li>
<li>If you use a manager, each version install its own gems.</li>
<li>Basic gems: <code>bundler</code> and <code>rake</code>.</li>
<li>It has a config file (<code>~/.gemrc</code>).</li>
</ul>
<h4>Example</h4>
<script src="https://gist.github.com/4135230.js?file=gem_install.sh"></script>
</section>
<section class="slide" id="gem">
<h2>Gem: Package</h2>
<blockquote>
A gem is a packaged Ruby application or library. It has a name (e.g. rake) and a version (e.g. 0.4.16)
</blockquote>
<ul>
<li>Once a gem is installed, is available in the ruby load path.</li>
</ul>
</section>
<section class="slide" id="irb">
<h2>IRB</h2>
<ul>
<li>Part of the ruby interpreter.</li>
<li>Quick and easy way to execute ruby code.</li>
<li>Useful for testing.</li>
<li>It can control jobs, manipulate sessions and connect to remote servers.</li>
</ul>
</section>
<section class="slide" id="irb-example">
<h2>IRB: Usage example</h2>
<script src="https://gist.github.com/4135230.js?file=irb_example.sh"></script>
</section>
<section class="slide" id="bundler-basics">
<h2>Bundler: The basics</h2>
<ul>
<li>It's a gem.</li>
<li>Manage all the dependencies of your app.</li>
<li>Resolves the <em>dependency hell</em>.</li>
<li>Two key files:
<ul>
<li><code>Gemfile</code>: ruby file to declare all the needed gems.</li>
<li><code>Gemfile.lock</code>: managed by bundler. Sets all the versions and dependencies. <strong>Never write in this file!</strong></li>
</ul>
</li>
<li>Install and update gems.</li>
<li>All the gems in the Gemfile are available in the app's load path.</li>
</ul>
</section>
<section class="slide" id="bundler-example">
<h2>Bundler: Gemfile example</h2>
<script src="https://gist.github.com/4135230.js?file=Gemfile"></script>
</section>
<section class="slide" id="bundler-ruby-usage">
<h2>Bundler: Ruby usage</h2>
<script src="https://gist.github.com/4135230.js?file=bundler_ruby_usage.rb"></script>
</section>
<section class="slide" id="bundler-tips">
<h2>Bundler: Tips</h2>
<ul>
<li><strong>Always</strong> use bundler to manage your app dependencies.</li>
<li>Use groups.</li>
<li>
<p>Use <code>--path</code> and <code>--binstubs</code> options.</p>
<script src="https://gist.github.com/4135230.js?file=bundle_install_example.sh"></script>
</li>
<li>
<p>Use a config file in <code>~/.bundle/config</code></p>
<script src="https://gist.github.com/4135230.js?file=bundle_config.yml"></script>
</li>
</ul>
</section>
<section class="slide" id="rake">
<h2>Rake</h2>
<ul>
<li>It's a gem.</li>
<li>The <code>make</code> of ruby.</li>
<li>Standard system to create all kind of tasks.</li>
<li>Declarative and powerful DSL.</li>
<li>Uses a ruby file called <code>Rakefile</code>.</li>
</ul>
</section>
<section class="slide" id="rake-example">
<h2>Rake: Usage example</h2>
<script src="https://gist.github.com/4135230.js?file=Rakefile"></script>
<script src="https://gist.github.com/4135230.js?file=rake_usage_example.sh"></script>
</section>
<section class="slide" id="rails">
<h2>Rails</h2>
<h5><small>A extremely basic introduction.</small></h5>
<ul>
<li>
<p>It's a <em>meta-gem</em> (a group of gems):</p>
<ul>
<li><code>actionmailer</code></li>
<li><code>actionpack</code></li>
<li><code>activemodel</code></li>
<li><code>activerecord</code></li>
<li><code>activesupport</code></li>
</ul>
</li>
<li>It has a complete command line utilities for: code generation, database manipulation, testing, etc.</li>
</ul>
</section>
<section class="slide" id="rails-cli">
<h2>Rails: Command line basics</h2>
<ul>
<li>
The <code>rails</code> command:
<ul>
<li><code>rails console</code></li>
<li><code>rails server</code></li>
<li><code>rails generate</code></li>
<li><code>rails dbconsole</code></li>
<li><code>rails new app_name</code></li>
</ul>
</li>
<li>
<code>rake</code> tasks:
<ul>
<li>Used for common administration tasks.</li>
<li>Manipulate the <code>db</code>, <code>assets</code>, etc.</li>
<li>You can create your own tasks.</li>
</ul>
</li>
</ul>
</section>
<section class="slide" id="rails-examples">
<h2>Rails: Task examples</h2>
<script src="https://gist.github.com/4135230.js?file=rails_task_example.sh"></script>
</section>
<section class="slide" id="end">
<h1>
<p>
Q&A
</p>
</h1>
</section>
<!-- End slides. -->
<!-- Begin extension snippets. -->
<!-- deck.navigation snippet -->
<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>
<!-- deck.status snippet -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.hash snippet -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>
<!-- End extension snippets. -->
<!-- Required JS files. -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/vendor/jquery.1.8.3.min.js"><\/script>')</script>
<script src="/js/vendor/deck.core.js"></script>
<script src="/js/vendor/deck.hash.js"></script>
<script src="/js/vendor/deck.navigation.js"></script>
<script src="/js/vendor/deck.scale.js"></script>
<script src="/js/vendor/deck.status.js"></script>
<script src="/js/app.js"></script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.