• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ro r
 

Ro r

on

  • 646 views

 

Statistics

Views

Total Views
646
Views on SlideShare
638
Embed Views
8

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 8

http://www.slideshare.net 8

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ro r Ro r Presentation Transcript

    • Ruby on Rails Gabriel Ščerbák
    • Ruby ● Objektovo orientovaný jazyk založený na posielaní správ: class XML def method_missing(msg, *args, &block) puts "<#{msg}>#{args[0]}</#{msg}>" end end document = XML.new document.title “New document“
    • Ruby ● Prky funkcionálneho programovania - closures class XML def method_missing(msg, *args, &block) args.each do |value| puts "<#{msg}>#{value}</#{msg}>" end end end XML.new.name “John“, “Jack“, “Joe“, “Justin“, “Julian“
    • Ruby ● Dynamické typovanie ● Metaprogramovanie, otvorené triedy, symboly,... ● Key Value Coding pomocou asociatívnych polí ● Minimalistická syntax, nepovinné zátvorky, nepovinné bodkočiarky, end na konci bloku kódu namiesto zložených zátvoriek okolo,...
    • Rails ● Konvencia pred konfiguráciou, scaffolding ● Architektúra MVC s podporou štýlu REST $ ruby script/generate scaffold Recipe title:string chef:string instructions:text ● Views pre index, show, new a edit operácie ● Layout a CSS pre Recipes ● Controller, Helper, funkčný test a presmerovanie URL adries v štýle REST pre Recipes ● Model, migrácia, unit test a testovacie dáta pre Recipe
    • Rails ● Množina interných doménovo špecifických jazykov # routes.rb map.resources :projects map.task_archive 'tasks/:year/:month', :controller => 'tasks', :action => 'archive' map.home '', :controller => 'projects', :action => 'index'
    • Rails ● Vzor Active Record spolu s migráciami a rake db:* úlohami úplne abstrahujú od databázu $ruby script/generate model Folder class Folder < ActiveRecord::Base acts_as_tree belongs_to :user has_many :messages, :class_name => "Message" end $rake db:migrate
    • Ekosystém ● Runtime platformy: MRI, JRuby, IronRuby, MacRuby, MagLev, Rubinius ● Konzultácie, tréning, konferencie, knihy, ... ● Ukladanie dát: MySQL, Oracle, MongoDB, Redis ● Možnosti nasadenia: Engine Yard, Heroku,... ● Hosting projektov: GitHub, RubyForge,... ● IDE: TextMate, Netbeans, Eclipse, Aptana RadRails,
    • Ruby on Rails v praxi Basecamp Twitter Shopify Yellow pages GitHub Lighthouse
    • Ďakujem za Vašu pozornosť!