Skip to content

Lecture 00

marekjelen edited this page Sep 21, 2012 · 4 revisions

Motivation

Imagine a language where

  • you don't have to compile anything
  • you can just start writing your code without long ceremonies
  • you can use for server scripts, one-liners as well as web and desktop apps
  • you can easily improve the behavior of included library
  • the class name is always CamelCase and method name snake_case
  • writing callbacks is natural
  • [] + [] = []
  • writing tests is obvious thing to do
  • there is one specification but more implementations

What's written in Ruby?

  • languages: Ruby (Rubinius)
  • web apps: Github, Twitter
  • dev ops tools: Puppet/Chef/Vagrant
  • cloud platforms: OpenShift
  • cloud management: DeltaCloud
  • VIM/Emacs scripts
  • static pages generators - Jekyll
  • programming tools

Basic ecosystem

  • ruby --help
  • RVM/rbenv - getting different versions of ruby and libraries
rvm install ruby-1.9.2
rvm use ruby-1.9.2
rvm gemset create fimu
rvm 1.9.2@fimu
  • RubyGems - sharing the libraries with the rest of the world
gem list
gem install pry
  • irb - try the things out
irb
>> "dlroW olleH".reverse
  • pry - try the things out in the wild
def hello(name)
  binding.pry
end
hello("World")
  • git - source code version management
git clone git://github.com/municz/study-materials.wiki.git
cd study-materials.wiki
echo "Hello World" >> Home.md
git add .
git commit -m "My Useless Change"
Clone this wiki locally