Transcript of "A tour on ruby and friends"

1.
a Tour on Ruby and FriendsMinqi Pan (P.S.V.R)

2.
“A Programmer’s Best Friend”3 Keywords: Dynamic... Ruby executes at runtime many common behaviors that other languages might perform during Reﬂective... Ruby can observe (do type introspection) and modify its own structure and behavior at runtime. Humanity... Ruby is designed for programmer productivity and fun.

4.
Snippet #2.Everything is an object Applying an action on a number... 5.times do print "We *love* Ruby -- its outrageous!" end

5.
Snippet #3. Flexibility Essential parts of Ruby can be removed or redeﬁned, at will... class Numeric def plus(x) self.+(x) end end y = 5.plus 6 # y is now equal to 11

6.
Snippet #4. closures creating a function together with a referencing environment for the non-local variables of that# In an object instance variable (denoted with @), remembera block.def remember(&a_block) @block = a_blockend# Invoke the above method, giving it a block which takes aname.remember {|name| puts "Hello, #{name}!"}# When the time is right (for the object) -- call theclosure!@block.call("Jon")# => "Hello, Jon!"

14.
“Often people, especially computer engineers, focus on the machines. Theythink, "By doing this, the machine will run faster. By doing this, the machine willrun more effectively. By doing this, the machine will something somethingsomething." They are focusing on machines. But in fact we need to focus onhumans, on how humans care about doing programming or operating theapplication of the machines. We are the masters. They are the slaves. ”

15.
Rails2 Keywords: Convention over Conﬁguration... a developer only needs to specify unconventional aspects of the application. Dont repeat yourself... information is located in a single, unambiguous place..

17.
Rails was created in 2003 byDavid Heinemeier Hansson I made that! In 2005 he was recognized by Google and OReilly with the Hacker of the Year award for his creation of Ruby on Rails. Hansson appeared on the cover of the July 2006 issue of Linux Journal

18.
“ Flexibility is not free. It’s overrated. And if you trade thatﬂexibility in for some constraints, you get a lot of complexityremoved from the equation, you get a lot of productivity backfrom all the stuff you don’t have to do.”

26.
RailtiesRailties is responsible for gluing all frameworks together.Overall, it:* handles the bootstrapping process for a Rails application;* manages the +rails+ command line interface;* and provides Rails generators core.

27.
activesupportA toolkit of support libraries and Ruby core extensions extractedfrom the Rails framework. Rich support for multibyte strings,internationalization, time zones, and testing.http://rubygems.org/gems/activesupport

29.
activesupportActive Support is a collection of utility classes and standard libraryextensions that were found useful for the Rails framework. These additionsreside in this package so they can be loaded as needed in Ruby projectsoutside of Rails.of great use to ruby learners!

30.
actionpackAction Pack is a framework for handling and responding to webrequests. It provides mechanisms for *routing* (mappingrequest URLs to actions), deﬁning *controllers* that implementactions, and generating responses by rendering *views*, whichare templates of various formats. In short, Action Pack providesthe view and controller layers in the MVC paradigm.http://rubygems.org/gems/actionpack

32.
actionpack* Action Dispatch, which parses information about the web request, handles routing as deﬁned by the user, and does advanced processing related to HTTP such as MIME-type negotiation, decoding parameters in POST/PUT bodies, handling HTTP caching logic, cookies and sessions.* Action Controller, which provides a base controller class that can be subclassed to implement ﬁlters and actions to handle requests. The result of an action is typically content generated from views.* Action View, which handles view template lookup and rendering, and provides view helpers that assist when building HTML forms, Atom feeds and more. Template formats that Action View handles are ERB (embedded Ruby, typically used to inline short Ruby snippets inside HTML), and XML Builder.

33.
activerecordActive Record connects classes to relational database tables to establish analmost zero-conﬁguration persistence layer for applications. The libraryprovides a base class that, when subclassed, sets up a mapping between the newclass and an existing table in the database. In the context of an application,these classes are commonly referred to as *models*. Models can also beconnected to other models; this is done by deﬁning *associations*.(c.f. mongoid)http://rubygems.org/gems/activerecord

35.
activerecord Automated mapping between classes and tables, attributes and columns. Associations between objects deﬁned by simple class methods. Aggregations of value objects. Validation rules that can differ for new or existing objects. Callbacks available for the entire life cycle (instantiation, saving, destroying, validating, etc.). Observers that react to changes in a model. Inheritance hierarchies. Transactions Reﬂections on columns, associations, and aggregations. Database abstraction through simple adapters. Logging support Database agnostic schema management with Migrations.

37.
how it worksModel classes are mapped to remote REST resourcesby Active Resource much the same way Active Recordmaps model classes to databasetables. When arequest is made to a remote resource, a REST XMLrequest is generated, transmitted, and the resultreceived and serialized into a usable Ruby object.

39.
Philosiphy Active Resource attempts to provide a coherent wrapper object-relational mapping for REST web services. It follows the same philosophy as Active Record, in that one of its prime aims is to reduce the amount of code needed to map to these resources. This is made possible by relying on a number of code- and protocol-based conventions that make it easy for Active Resourceto infer complex relations and structures.

43.
actionmailerAction Mailer is a framework for designing email-service layers.These layers are used to consolidate code for sending outforgotten passwords, welcome wishes on signup, invoices forbilling, and any other use case that requires a written notiﬁcationto either a person or another system.

48.
Wait! where is activemodel? activerecord relies on this! activepack also relies on this!!! A toolkit for building modeling frameworks like Active Record and Active Resource. Rich support for attributes, callbacks, validations, observers, serialization, internationalization, and testing.

53.
Nitro it does not dictate how a web application should be structured.<select name="day"> <option for="day in 1..31" selected_if="day == Time.now.day">#{day}</option></select> One could use templates with embedded code!

54.
CampingCamping is a webapplication frameworkwritten in Ruby whichconsistently stays under4kb - the completesource code can beviewed on a single page.