<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spuri3</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spuri3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Spuri3"/>
	<updated>2026-05-16T15:42:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1453_sst&amp;diff=89866</id>
		<title>CSC/ECE 517 Fall 2014/oss M1453 sst</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1453_sst&amp;diff=89866"/>
		<updated>2014-10-27T05:52:43Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Expand the coverage of the developer tools for inspecting web content in Servo remotely from a Firefox browser - requires the ability to read JavaScript code in Firefox&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Background Information==&lt;br /&gt;
Firefox supports remote debugging - i.e. communicating with an arbitrary server that implements a protocol for exposing information about web content. Servo implements a very basic developer tools server that currently supports executing JS remotely and investigating the DOM tree in the document inspector. We want to expand these capabilities by allowing remote modification of the DOM tree, better JS console integration (exposing historical and real-time exceptions), and enabling server-&amp;gt;client messages that are not responses to client-&amp;gt;server messages.&lt;br /&gt;
&lt;br /&gt;
===Developer tools===&lt;br /&gt;
The Mozilla debugging protocol allows a debugger to connect to a browser, discover what sorts of things are present to debug or inspect, select [http://en.wikipedia.org/wiki/JavaScript JavaScript] threads to watch, and observe and modify their execution. The protocol provides a unified view of JavaScript, [http://en.wikipedia.org/wiki/Document_Object_Model DOM] nodes, [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] rules, and the other technologies used in client-side web applications. The protocol ought to be sufficiently general to be extended for use with other sorts of clients (profilers, say) and servers (mail readers; random XULrunner applications).&lt;br /&gt;
&lt;br /&gt;
All communication between debugger (client) and browser (server) is in the form of [http://en.wikipedia.org/wiki/JSON JSON] objects. This makes the protocol directly readable by humans, capable of graceful evolution, and easy to implement using stock libraries. In particular, it should be easy to create mock implementations for testing and experimentation.&lt;br /&gt;
&lt;br /&gt;
The protocol operates at the JavaScript level, not at the [http://en.wikipedia.org/wiki/C%2B%2B C++] or machine level, and assumes that the JavaScript implementation itself is healthy and responsive. The JavaScript program being executed may well have gone wrong, but the JavaScript implementation's internal state must not be corrupt. Bugs in the implementation may cause the debugger to fail; bugs in the interpreted program must not.&lt;br /&gt;
&lt;br /&gt;
Reference: https://wiki.mozilla.org/Remote_Debugging_Protocol&lt;br /&gt;
&lt;br /&gt;
'''Setting up remote debugging'''&lt;br /&gt;
&lt;br /&gt;
Firefox acts as the client and provides the user interface to control the developer tools. The guide to explain how to use remote debugging to inspect or debug code running in Firefox is [https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Thunderbird here]&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
Servo is an experimental web browser engine under development by [https://www.mozilla.org/en-US/research/ Mozilla Research]. It is an ambitious project aimed at rebuilding the browser on modern parallel hardware. Servo aims at addressing the causes of security vulnerabilities while designing a platform that can fully utilize the performance of tomorrow’s massively parallel hardware to enable new and richer experiences on the Web. Servo is written in [http://en.wikipedia.org/wiki/Rust_(programming_language) Rust], a new [http://en.wikipedia.org/wiki/Type_safety type safe], systems language which is authored by Mozilla. &lt;br /&gt;
&lt;br /&gt;
Mozilla has paired up with [http://en.wikipedia.org/wiki/Samsung Samsung] which will port this advanced technology Web browser engine to Android and [http://en.wikipedia.org/wiki/ARM_architecture ARM]. Samsung will contribute a ARM back end to Rust and the necessary infrastructure to cross-compile to [http://en.wikipedia.org/wiki/Android_(operating_system) Android] along with other improvements. &lt;br /&gt;
&lt;br /&gt;
The mission of the experimental engine is to take advantage of tomorrow’s faster, multi-core, heterogeneous computing architectures. The prototype seeks to create a highly parallel environment, in which typical web browser components such as rendering, layout, HTML parsing, image decoding will be handled by specific and disjoint tasks, thus achieving the objective of optimal usage of parallel architecture.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
Rust is a new programming language designed to support concurrency and parallelism in building platforms both in functional and object-oriented paradigms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety.&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory.&lt;br /&gt;
There are a number of ways to install Rust, but the easiest is to use the rustup script. If you're on Linux or a Mac, all you need to do is this:&lt;br /&gt;
     $ curl -s https://static.rust-lang.org/rustup.sh | sudo sh&lt;br /&gt;
(If you're concerned about curl | sudo sh, check references)&lt;br /&gt;
If you're on Windows, please download either the 32-bit installer or the 64-bit installer and run it.&lt;br /&gt;
&lt;br /&gt;
Uninstalling Rust&lt;br /&gt;
    $ curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --uninstall&lt;br /&gt;
&lt;br /&gt;
If you used the Windows installer, just re-run the .exe and it will give you an uninstall option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference : http://doc.rust-lang.org&lt;br /&gt;
&lt;br /&gt;
Download Rust at: http://www.rust-lang.org/&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
===Installing dependencies for Servo===&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
     brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
     pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
     sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
 pushd .&lt;br /&gt;
 cd /tmp&lt;br /&gt;
 wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
 rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
 sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
 popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
Reference :https://github.com/servo/servo&lt;br /&gt;
&lt;br /&gt;
===Building Servo===&lt;br /&gt;
[[File:Servo_build.png|frame|right|alt=Servo build.|Successful build of Servo]]&lt;br /&gt;
&lt;br /&gt;
===Running Servo===&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
This project mainly aims at expanding the remote debugging capabilities provided by Servo. The current implementation provides a developer tools server which currently supports executing JS remotely and investigating the DOM tree in the document inspector. The scope of this project is to expand the coverage of remote debugging capabilities. These include:&lt;br /&gt;
*remote modification of the DOM tree&lt;br /&gt;
*better exposure of exception in JS console&lt;br /&gt;
*enable Server-Client messages.&lt;br /&gt;
&lt;br /&gt;
===Work done in Part 1===&lt;br /&gt;
'''Build Servo'''&lt;br /&gt;
&lt;br /&gt;
Setup a local instance of Servo. Install the dependencies and successfully build Servo. Reproduce the problem of Servo window getting hung up when opened with an instance of devtools.&lt;br /&gt;
&lt;br /&gt;
'''Fixing the issue of successful Servo Exit'''&lt;br /&gt;
&lt;br /&gt;
This issue was fixed by sending an Exit message to the developer tools. On browser close, a &amp;lt;code&amp;gt;ServerExitMsg&amp;lt;/code&amp;gt; message is sent from the &amp;lt;code&amp;gt;handle_exit&amp;lt;/code&amp;gt; method in the &amp;lt;code&amp;gt;constellation.rs&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
'''Storing and exiting connections'''&lt;br /&gt;
&lt;br /&gt;
The accepted streams were stored in a &amp;lt;code&amp;gt;Vector&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;devtools/lib.rs&amp;lt;/code&amp;gt; file. On the exit of Servo the corresponding read and write end of the stream were closed successfully.&lt;br /&gt;
&lt;br /&gt;
The following two files were modified to include the new code.&lt;br /&gt;
&lt;br /&gt;
:*'''[https://github.com/shanil-puri/servo/blob/master/components/compositing/constellation.rs constellation.rs]'''&lt;br /&gt;
:*'''[https://github.com/shanil-puri/servo/blob/master/components/devtools/lib.rs devtools/lib.rs]'''&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
*Separate devtools event handling from script handling tasks. &lt;br /&gt;
*Implement client server messages to update the attribute values of a HTML node.&lt;br /&gt;
*Send a console message to the developer tools server.&lt;br /&gt;
*Synchronously fetch the cached messages from tasks.&lt;br /&gt;
*Create an error reporter for error logging and notification.&lt;br /&gt;
*Dynamic buffering and sending of messages to Developer Tools.&lt;br /&gt;
*Support for disparate client reading and writing.&lt;br /&gt;
*Send a detailed error message to the client when an error is reported to the tasks.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88182</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88182"/>
		<updated>2014-09-24T21:26:20Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 40%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.12.0 || (February 9th 2014)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.12.0.rc1 || (December 31st 2013)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.11.4 || (September 24th 2013)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.11.0 || (March 21st 2013)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.10.7 || (June 20th 2012)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.10.0 || (NA)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.9.29 || (NA)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
| 0.19.1 || (NA)&lt;br /&gt;
|-align=&amp;quot;center&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88181</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88181"/>
		<updated>2014-09-24T21:25:37Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 40%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|-&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (February 9th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0.rc1 || (December 31st 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.4 || (September 24th 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.0 || (March 21st 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.7 || (June 20th 2012)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.0 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
| 0.9.29 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
| 0.19.1 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88180</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88180"/>
		<updated>2014-09-24T21:25:12Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 60%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|- style=&amp;quot;height: 100px;&amp;quot;&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (February 9th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0.rc1 || (December 31st 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.4 || (September 24th 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.0 || (March 21st 2013)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.7 || (June 20th 2012)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.0 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
| 0.9.29 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
| 0.19.1 || (NA)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88179</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88179"/>
		<updated>2014-09-24T21:23:14Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 40%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|-&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0.rc1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.4 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.7 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.9.29 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.19.1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88178</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88178"/>
		<updated>2014-09-24T21:22:12Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 40%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|-&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0.rc1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.4 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.7 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.9.29 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.19.1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88177</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88177"/>
		<updated>2014-09-24T21:21:47Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 60%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|- style=&amp;quot;height: 100px;&amp;quot;&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0.rc1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.11.4 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.10.7 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.9.29 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
| 0.19.1 || (August 13th 2014)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88175</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88175"/>
		<updated>2014-09-24T21:21:03Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: /* Padrino Version Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|300px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg|600px||]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 60%; height: 200px&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Version || Date of Release &lt;br /&gt;
|- style=&amp;quot;height: 100px;&amp;quot;&lt;br /&gt;
| 0.12.3 || (August 13th 2014)&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
| 0.12.0.rc1 || (August 13th 2014)&lt;br /&gt;
| 0.11.4 || (August 13th 2014)&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
| 0.10.7 || (August 13th 2014)&lt;br /&gt;
| 0.12.0 || (August 13th 2014)&lt;br /&gt;
| 0.9.29 || (August 13th 2014)&lt;br /&gt;
| 0.19.1 || (August 13th 2014)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_arch_struct1.jpg&amp;diff=88170</id>
		<title>File:Padrino arch struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_arch_struct1.jpg&amp;diff=88170"/>
		<updated>2014-09-24T19:57:37Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: uploaded a new version of &amp;amp;quot;File:Padrino arch struct1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88169</id>
		<title>File:Padrino profile struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88169"/>
		<updated>2014-09-24T19:57:02Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: uploaded a new version of &amp;amp;quot;File:Padrino profile struct1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88164</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88164"/>
		<updated>2014-09-24T19:50:16Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|603px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88163</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88163"/>
		<updated>2014-09-24T19:49:03Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|603px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88162</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88162"/>
		<updated>2014-09-24T19:47:40Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88161</id>
		<title>File:Padrino profile struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88161"/>
		<updated>2014-09-24T19:47:05Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: uploaded a new version of &amp;amp;quot;File:Padrino profile struct1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88160</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88160"/>
		<updated>2014-09-24T19:46:12Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino_profile_struct1.jpg|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88159</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88159"/>
		<updated>2014-09-24T19:45:33Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino profile struct1.jpg|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino arch struct1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_arch_struct1.jpg&amp;diff=88158</id>
		<title>File:Padrino arch struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_arch_struct1.jpg&amp;diff=88158"/>
		<updated>2014-09-24T19:44:55Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88157</id>
		<title>File:Padrino profile struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrino_profile_struct1.jpg&amp;diff=88157"/>
		<updated>2014-09-24T19:40:33Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Who_struct1.jpg&amp;diff=88156</id>
		<title>File:Who struct1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Who_struct1.jpg&amp;diff=88156"/>
		<updated>2014-09-24T19:39:44Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88155</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88155"/>
		<updated>2014-09-24T19:24:49Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino_profile.png‎|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino_framework_diag.png‎]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88154</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88154"/>
		<updated>2014-09-24T19:22:36Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino_profile.png‎|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino_framework_diag.png‎]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Padrinoprojstructure struct1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app  &lt;br /&gt;
|---controllers  &lt;br /&gt;
|---helpers  &lt;br /&gt;
|---models  &lt;br /&gt;
|---views  &lt;br /&gt;
|-----layouts  &lt;br /&gt;
|-config  &lt;br /&gt;
|---environments  &lt;br /&gt;
|---initializers  &lt;br /&gt;
|---locales  &lt;br /&gt;
|-db  &lt;br /&gt;
|-doc  &lt;br /&gt;
|-lib  &lt;br /&gt;
|---tasks  &lt;br /&gt;
|-log  &lt;br /&gt;
|-public  &lt;br /&gt;
|---images  &lt;br /&gt;
|---javascripts  &lt;br /&gt;
|---stylesheets  &lt;br /&gt;
|-script  &lt;br /&gt;
|-test  &lt;br /&gt;
|---fixtures  &lt;br /&gt;
|---functional  &lt;br /&gt;
|---integration  &lt;br /&gt;
|---performance  &lt;br /&gt;
|---unit  &lt;br /&gt;
|-tmp  &lt;br /&gt;
|---cache  &lt;br /&gt;
|---pids  &lt;br /&gt;
|---sessions  &lt;br /&gt;
|---sockets  &lt;br /&gt;
|-vendor  &lt;br /&gt;
|---plugin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app    &lt;br /&gt;
|---controllers    &lt;br /&gt;
|---helpers    &lt;br /&gt;
|---views    &lt;br /&gt;
|-----layouts    &lt;br /&gt;
|-config    &lt;br /&gt;
|-lib    &lt;br /&gt;
|-public    &lt;br /&gt;
|---images    &lt;br /&gt;
|---javascripts    &lt;br /&gt;
|---stylesheets    &lt;br /&gt;
|-spec    &lt;br /&gt;
|-tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrinoprojstructure_struct1.png&amp;diff=88153</id>
		<title>File:Padrinoprojstructure struct1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Padrinoprojstructure_struct1.png&amp;diff=88153"/>
		<updated>2014-09-24T19:22:04Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Railsprojstruct_struc1.jpg&amp;diff=88152</id>
		<title>File:Railsprojstruct struc1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Railsprojstruct_struc1.jpg&amp;diff=88152"/>
		<updated>2014-09-24T18:40:48Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: uploaded a new version of &amp;amp;quot;File:Railsprojstruct struc1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88151</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=88151"/>
		<updated>2014-09-24T18:39:20Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]]  &lt;br /&gt;
[[File:Padrino_profile.png‎|442px|thumb|right]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of [http://www.sinatrarb.com Sinatra], but applies some default structure to a new web application.&lt;br /&gt;
Along with the default structure, Padrino also provides a lot of new functionalities like Generators,Loggers and Tag Helpers over Sinatra.&lt;br /&gt;
Padrino is an alternative Ruby framework to the other more popular frameworks like [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] and Nitro for small size web applications.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
Since 2010 Padrino has received a significant number of updates. The version number of the latest stable Padrino release is v0.12.2.&lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where [http://www.padrinorb.com Padrino] framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
*Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with [http://en.wikipedia.org/wiki/Object-relational_mapping ORM] or any library&lt;br /&gt;
&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, Padrino is principally designed for mounting multiple apps in the sense that unlike [http://guides.rubyonrails.org/engines.html Rails Engines] where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
&lt;br /&gt;
*Admin: Built-in Admin interface (like [https://www.djangoproject.com/ Django]).&lt;br /&gt;
&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
==='''Reference diagram for Padrino Features'''===&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino_framework_diag.png‎]]&lt;br /&gt;
&lt;br /&gt;
=='''Development using Padrino'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project creation'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in Padrino and start running it in four simple commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1.	$gem install padrino&lt;br /&gt;
2.	$padrino g project NameofMyApp&lt;br /&gt;
3.	$cd NameofMyApp&lt;br /&gt;
4.	$padrino start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;A detailed description of the above commands:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$gem install padrino&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Installs the gems for Padrino framework. Gems is a keyword that is derived from the term RubyGems.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://rubygems.org/ RubyGems] is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$padrino g project NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;'padrino'&amp;lt;/u&amp;gt; :(create a Padrino based project) &amp;lt;u&amp;gt;'g'&amp;lt;/u&amp;gt; :(short hand for generate) &amp;lt;u&amp;gt;'project NameofMyApp'&amp;lt;/u&amp;gt; :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd NameofMyApp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move to the project directory i.e. the folder name of you application&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;padrino start&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Start the padrino Application Server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:Railsprojstruct struc1.jpg]]&lt;br /&gt;
*App&lt;br /&gt;
:*controllers&lt;br /&gt;
:*helpers&lt;br /&gt;
:*views&lt;br /&gt;
::*layouts&lt;br /&gt;
*Config&lt;br /&gt;
*Public&lt;br /&gt;
:*Images&lt;br /&gt;
:*Javascripts&lt;br /&gt;
:*stylesheets&lt;br /&gt;
*tmp&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Controllers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Views are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;u&amp;gt;Helpers are responsible for:&amp;lt;/u&amp;gt;&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Project Deployment'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we need to add postgresql gem (‘pg’) as a dependency in our Padrino Project.&lt;br /&gt;
&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Opens the web application in the default browser&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Padrino Development IDEs'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definition improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&lt;br /&gt;
Rails Tree Structure&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app  &lt;br /&gt;
|---controllers  &lt;br /&gt;
|---helpers  &lt;br /&gt;
|---models  &lt;br /&gt;
|---views  &lt;br /&gt;
|-----layouts  &lt;br /&gt;
|-config  &lt;br /&gt;
|---environments  &lt;br /&gt;
|---initializers  &lt;br /&gt;
|---locales  &lt;br /&gt;
|-db  &lt;br /&gt;
|-doc  &lt;br /&gt;
|-lib  &lt;br /&gt;
|---tasks  &lt;br /&gt;
|-log  &lt;br /&gt;
|-public  &lt;br /&gt;
|---images  &lt;br /&gt;
|---javascripts  &lt;br /&gt;
|---stylesheets  &lt;br /&gt;
|-script  &lt;br /&gt;
|-test  &lt;br /&gt;
|---fixtures  &lt;br /&gt;
|---functional  &lt;br /&gt;
|---integration  &lt;br /&gt;
|---performance  &lt;br /&gt;
|---unit  &lt;br /&gt;
|-tmp  &lt;br /&gt;
|---cache  &lt;br /&gt;
|---pids  &lt;br /&gt;
|---sessions  &lt;br /&gt;
|---sockets  &lt;br /&gt;
|-vendor  &lt;br /&gt;
|---plugin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app    &lt;br /&gt;
|---controllers    &lt;br /&gt;
|---helpers    &lt;br /&gt;
|---views    &lt;br /&gt;
|-----layouts    &lt;br /&gt;
|-config    &lt;br /&gt;
|-lib    &lt;br /&gt;
|-public    &lt;br /&gt;
|---images    &lt;br /&gt;
|---javascripts    &lt;br /&gt;
|---stylesheets    &lt;br /&gt;
|-spec    &lt;br /&gt;
|-tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with [http://guides.rubyonrails.org/engines.html Engines] which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. &lt;br /&gt;
&lt;br /&gt;
Padrino allows for lightweight mountable apps that can share resource models.&lt;br /&gt;
&lt;br /&gt;
A scenario where we need multiple applications in one project, is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''Further Reading'''= &lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Padrino framework&lt;br /&gt;
:1. http://www.padrinorb.com/guides/blog-tutorial&amp;lt;br&amp;gt;&lt;br /&gt;
:2. https://shellycloud.com/blog/2013/11/how-to-build-and-deploy-a-blog-application-in-padrino&lt;br /&gt;
&lt;br /&gt;
* An introductory video for Padrino &lt;br /&gt;
: 1. https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
&lt;br /&gt;
* A guide to develop a basic Blog application using Ruby on Rails framework&lt;br /&gt;
:1. http://tutorials.jumpstartlab.com/projects/blogger.html&lt;br /&gt;
&lt;br /&gt;
* More information about Ruby on Rails&lt;br /&gt;
:1.http://en.wikipedia.org/wiki/Ruby_on_Rails&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Railsprojstruct_struc1.jpg&amp;diff=88150</id>
		<title>File:Railsprojstruct struc1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Railsprojstruct_struc1.jpg&amp;diff=88150"/>
		<updated>2014-09-24T18:37:50Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=85729</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 2 ss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_2_ss&amp;diff=85729"/>
		<updated>2014-09-16T04:53:59Z</updated>

		<summary type="html">&lt;p&gt;Spuri3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Padrino Framework for Ruby=&lt;br /&gt;
[[File:Padrino_Ruby_Web_Framework.jpg‎|256px|thumb|right|]] &lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework'''==&lt;br /&gt;
[http://www.padrinorb.com Padrino] is an open source web application framework, written in Ruby. Padrino is built upon the rock-solid foundation of Sinatra, but applies some default structure to a new web application.&lt;br /&gt;
&lt;br /&gt;
Padrino was created and [http://en.wikipedia.org/wiki/Open_source open-sourced] in 2010. The framework was originally created by Nathan Esquenazi, Davide D'Agostino, and Arthur Chiu.&lt;br /&gt;
&lt;br /&gt;
Padrino is used as an alternative Ruby framework to the other more popular frameworks like Ruby on Rails and Nitro for small size web applications.  &lt;br /&gt;
&lt;br /&gt;
=='''Background'''==&lt;br /&gt;
The motivation behind Padrino was to develop a lightweight framework based on the foundation of [http://www.sinatrarb.com Sinatra]. Sinatra web library is a micro framework used for simple web applications. Sinatra is simplistic and expressive, but it is lacks a significant number of functionalities provided by other web frameworks such as Rails. This is where padrino framework steps in and provides the missing functionalities like Generators, Database interactions, and Helpers.&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Profile'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Padrino_profile.png‎]] &lt;br /&gt;
&lt;br /&gt;
=='''Padrino Framework features'''==&lt;br /&gt;
&lt;br /&gt;
* Generators: Create Padrino applications, models, controllers with simple commands like :padrino g project&lt;br /&gt;
*Logging: Provides a unified Logger that can interact with ORM or any library&lt;br /&gt;
*Agnostic: Full support for many popular testing, templating, mocking, and database libraries.&lt;br /&gt;
*Asset Helpers: View helpers such as: link_to, image_tag.&lt;br /&gt;
*Mountable: Unlike other Ruby frameworks, principally designed for mounting multiple apps in the sense that unlike Rails Engines where each engine must have separate models Padrino supports simple mountable engines.&lt;br /&gt;
*Routing: Full url named routes, named params, respond_to support, before/after filter support.&lt;br /&gt;
*Tag Helpers: View helpers such as: tag, content_tag, input_tag.&lt;br /&gt;
*Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.&lt;br /&gt;
*Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).&lt;br /&gt;
*Admin: Built-in Admin interface (like Django).&lt;br /&gt;
*Logging: Provide a unified logger that can interact with your ORM or any library.&lt;br /&gt;
*Reloading: Automatically reloads server code during development.&lt;br /&gt;
&lt;br /&gt;
=='''Reference diagram for Padrino'''==&lt;br /&gt;
 &lt;br /&gt;
[[File:Padrino_framework_diag.png‎]]&lt;br /&gt;
=='''Development in Padrino'''==&lt;br /&gt;
Setting up a project on a framework usually requires a lot of configuration and modification. In contrast, Padrino is very easy to setup.&lt;br /&gt;
We can setup a project in padrino and start running it in four simple commands&lt;br /&gt;
&lt;br /&gt;
1.	#gem install padrino &amp;lt;br&amp;gt; &lt;br /&gt;
2.	#padrino g project NameofMyApp &amp;lt;br&amp;gt;&lt;br /&gt;
3.	#cd NameofMyApp &amp;lt;br&amp;gt;&lt;br /&gt;
4.	#padrino start &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A detailed description of the above commands:&lt;br /&gt;
&lt;br /&gt;
1.	'gem install padrino': installs the gems for padrino framework. gems is a keyword that is derived from the term RubyGems. RubyGems is a package manager used in Ruby to standardize the distribution of Ruby programs and libraries.&amp;lt;br&amp;gt;&lt;br /&gt;
2.	'padrino' :(create a padrino based project) 'g' :(short hand for generate) 'project NameofMyApp' :( create a project with the given name)&amp;lt;br&amp;gt;&lt;br /&gt;
3.	'cd NameofMyApp' : move to the project directory&amp;lt;br&amp;gt;&lt;br /&gt;
4.	'padrino start' : Starts the server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Structure in Padrino'''==&lt;br /&gt;
&lt;br /&gt;
*App&lt;br /&gt;
:*controllers&lt;br /&gt;
:*helpers&lt;br /&gt;
:*views&lt;br /&gt;
::*layouts&lt;br /&gt;
*Config&lt;br /&gt;
*Public&lt;br /&gt;
:*Images&lt;br /&gt;
:*Javascripts&lt;br /&gt;
:*stylesheets&lt;br /&gt;
*tmp&lt;br /&gt;
&lt;br /&gt;
'''Details about each head folder:'''&lt;br /&gt;
*App folder → Holds the main application data and organizes it into [controllers], [helpers] and [views].&lt;br /&gt;
&lt;br /&gt;
::*Controllers → Controllers are the logical center of your application.&lt;br /&gt;
::::They coordinate the interaction between the user, the views, and the model.&lt;br /&gt;
&lt;br /&gt;
::::Controllers are responsible for:&lt;br /&gt;
::::*Routing external requests to internal actions.&lt;br /&gt;
::::*Managing Caching&lt;br /&gt;
::::*Managing Sessions&lt;br /&gt;
&lt;br /&gt;
::*Views→ It is a program that shares data with the controllers via shared variables.&lt;br /&gt;
&lt;br /&gt;
::::Views are responsible for:&lt;br /&gt;
::::*Fetching form data&lt;br /&gt;
::::*Displaying content to the users&lt;br /&gt;
::::*Managing User Interactions&lt;br /&gt;
&lt;br /&gt;
::*Helpers→ This component provides a great deal of view helpers related to html markup generation.&lt;br /&gt;
&lt;br /&gt;
::::Helpers are responsible for:&lt;br /&gt;
::::*Generating Tag Helpers&lt;br /&gt;
::::*Generating Form Helpers&lt;br /&gt;
::::*Managing images&lt;br /&gt;
&lt;br /&gt;
*Config folder → Holds project configurations that are used to setup boot processes and to specify the data to be loaded before and after the project. &lt;br /&gt;
*Public folder → Holds the project resources like images, and Java scripts and style sheets for views.&lt;br /&gt;
*Tmp folder → Holds data to be used for testing. Caching and temp locations can also be specified in this folder &lt;br /&gt;
&lt;br /&gt;
=='''Padrino development IDEs'''==&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used integrated development Environments (IDEs) for Padrino &lt;br /&gt;
*1.	[https://netbeans.org/ Netbeans]&lt;br /&gt;
*2.	[http://aptana.com/products/radrails Aptana RadRails]&lt;br /&gt;
*3.	[http://www.jetbrains.com/ruby/ RubyMine]&lt;br /&gt;
*4.	[http://komodoide.com Komodo]&lt;br /&gt;
*5.	[http://www.emacswiki.org/emacs/RubyOnRails EMACS + Rinari]&lt;br /&gt;
*6.	[http://www.easyeclipse.org/site/distributions/ruby-rails.html RDT Ruby Eclipse]&lt;br /&gt;
*7.	[http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview Ruby in Steel (Visual Studio plugin)]&lt;br /&gt;
&lt;br /&gt;
=='''Padrino Project Deployment'''==&lt;br /&gt;
The below steps illustrate how to deploy a Padrino project on [https://www.heroku.com Heroku] &lt;br /&gt;
&lt;br /&gt;
To deploy to Heroku, the application needs to be set up as a [http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository Git repository]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Steps to deploy on Heroku:&lt;br /&gt;
&lt;br /&gt;
1. Move into the Project folder and use the following commands:&lt;br /&gt;
            NameofMyApp $ heroku create ­­stack bamboo­ree­1.8.7&lt;br /&gt;
            NameofMyApp $ git push heroku master&lt;br /&gt;
2. Currently Padrino defaults to SQLite but Heroku only supports PostgreSQL, so we’ll need to add postgresql gem (‘pg’) as a dependency in our   Padrino Project. (http://Steps to Setup pg in padrino)&lt;br /&gt;
3. Running Padrino database migrations and seeds:&lt;br /&gt;
	    NameofMyApp $ heroku rake ar:migrate&lt;br /&gt;
	    NameofMyApp $ heroku rake seed&lt;br /&gt;
4. $heroku open→ Opens the web application in the default browser&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=='''Padrino - Rails trade off'''==&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Routing:'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Padrino uses http verb routing declarations instead of complex routing techniques used in Rails&lt;br /&gt;
Example:&lt;br /&gt;
•	In Padrino we can mention the routing information in the same file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :products do   &lt;br /&gt;
  get :show, :map =&amp;gt; &amp;quot;/this-is/:id/cool&amp;quot; do     &lt;br /&gt;
	@product = Product.find(params[:id])    &lt;br /&gt;
 	render 'products/show' &lt;br /&gt;
  end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
•	Where as to make a similar change in Rails we have to edit two files&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ProductsController &amp;lt; ActionController::Base&lt;br /&gt;
   def show     &lt;br /&gt;
	@product = Product.find(params[:id])&lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open config/routes.rb and add a seo friendly url like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map.connect &amp;quot;/this-is/:id/cool&amp;quot;, :controller =&amp;gt; &amp;quot;products&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Rendering:'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Rails has stringent requirements on naming conventions. We need to know the name of the controller ClientsController or file name clients_controller.rb and be cognizant of conventions to know which template (/clients/new) will be rendered.&lt;br /&gt;
Example:&lt;br /&gt;
In rails, you might see the following action:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ClientsController &amp;lt; ActionController::Base&lt;br /&gt;
   def new     &lt;br /&gt;
	@client = Client.new   &lt;br /&gt;
   end &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Padrino uses a different pattern for describing what actions does the controller support.&lt;br /&gt;
Adding few lines of code to the action definitions improves the readability of the controller.&lt;br /&gt;
&lt;br /&gt;
In Padrino we see the action definitions in the following format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyApp.controller :clients do&lt;br /&gt;
 	    get :new do   &lt;br /&gt;
 	 @client = Client.new     &lt;br /&gt;
	 render 'clients/new'   &lt;br /&gt;
	    end &lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Project Structure:'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The project structure used by Ruby on Rails is refined and optimal for large size applications. However most of these structural aspects become less relevant for a small sized project thus making it too big and less clean.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app  &lt;br /&gt;
|---controllers  &lt;br /&gt;
|---helpers  &lt;br /&gt;
|---models  &lt;br /&gt;
|---views  &lt;br /&gt;
|-----layouts  &lt;br /&gt;
|-config  &lt;br /&gt;
|---environments  &lt;br /&gt;
|---initializers  &lt;br /&gt;
|---locales  &lt;br /&gt;
|-db  &lt;br /&gt;
|-doc  &lt;br /&gt;
|-lib  &lt;br /&gt;
|---tasks  &lt;br /&gt;
|-log  &lt;br /&gt;
|-public  &lt;br /&gt;
|---images  &lt;br /&gt;
|---javascripts  &lt;br /&gt;
|---stylesheets  &lt;br /&gt;
|-script  &lt;br /&gt;
|-test  &lt;br /&gt;
|---fixtures  &lt;br /&gt;
|---functional  &lt;br /&gt;
|---integration  &lt;br /&gt;
|---performance  &lt;br /&gt;
|---unit  &lt;br /&gt;
|-tmp  &lt;br /&gt;
|---cache  &lt;br /&gt;
|---pids  &lt;br /&gt;
|---sessions  &lt;br /&gt;
|---sockets  &lt;br /&gt;
|-vendor  &lt;br /&gt;
|---plugin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Padrino’s generated tree is far more compact in comparison:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|-app    &lt;br /&gt;
|---controllers    &lt;br /&gt;
|---helpers    &lt;br /&gt;
|---views    &lt;br /&gt;
|-----layouts    &lt;br /&gt;
|-config    &lt;br /&gt;
|-lib    &lt;br /&gt;
|-public    &lt;br /&gt;
|---images    &lt;br /&gt;
|---javascripts    &lt;br /&gt;
|---stylesheets    &lt;br /&gt;
|-spec    &lt;br /&gt;
|-tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;'''Mountable Application:'''&amp;lt;/u&amp;gt;===&lt;br /&gt;
Rails does not have a flexible way to create multiple standalone applications in a single project whereas Padrino supports multiple applications in one project. The rails way of doing it is with Engines which are ideally suited for large scale applications and have own models and work as stand alone apps within the parent app. Padrino allows for lightweight mountable apps that can share share resource models etc.&lt;br /&gt;
A scenario where we need multiple applications in one project is that we might need to build simple sites, which act as customer showrooms. All of these sites share the same logic like admin, auths, models, etc.&lt;br /&gt;
In rails we need to create three different projects for this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ rails show_room1&lt;br /&gt;
•	$ rails show_room2&lt;br /&gt;
•	$ rails show_room3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where as in Padrino we can have multiple applications under a single project as shown below&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
•	$ padrino-gen project showrooms -r haml -d mongomapper &lt;br /&gt;
•	$ cd showrooms &lt;br /&gt;
•	$ padrino-gen app show_room_1 &lt;br /&gt;
•	$ padrino-gen app show_room_2 &lt;br /&gt;
•	$ padrino-gen app show_room_3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=='''Padrino Version Stack'''==&lt;br /&gt;
&lt;br /&gt;
Following are the version details of the major Padrino releases:&lt;br /&gt;
*	0.12.3 (August 13th 2014)&lt;br /&gt;
*	0.12.0 (February 9th 2014)&lt;br /&gt;
*	0.12.0.rc1 (December 31st 2013)&lt;br /&gt;
*	0.11.4 (September 24th 2013)&lt;br /&gt;
*	0.11.0 (March 21st 2013)&lt;br /&gt;
*	0.10.7 (June 20th 2012)&lt;br /&gt;
*	0.10.0&lt;br /&gt;
*	0.9.29&lt;br /&gt;
*	0.9.1&lt;br /&gt;
&lt;br /&gt;
=='''Stable release'''==&lt;br /&gt;
&lt;br /&gt;
Stable release&lt;br /&gt;
0.12.2 / 12 May 2014; 4 months ago&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&lt;br /&gt;
*	http://www.padrinorb.com/&lt;br /&gt;
*	https://github.com/padrino/padrino-framework&lt;br /&gt;
*	http://www.wikipedia.org/wiki/Padrino_(web_framework)&lt;br /&gt;
*	https://www.openshift.com/blogs/sinatra-padrino-or-ruby-on-rails-what-ruby-framework-to-use-on-the-cloud&lt;br /&gt;
*	https://www.youtube.com/watch?v=CH_a3yNbYDM&lt;br /&gt;
*	http://www.padrinorb.com/pages/why&lt;br /&gt;
*	http://www.rubyinside.com/padrino-sinatra-webapp-framework-3198.html&lt;br /&gt;
*	http://stackoverflow.com/tags/padrino/info&lt;br /&gt;
*	http://thechangelog.com/post/708173099/episode-0-2-7-padrino-ruby-web-framework&lt;br /&gt;
*       http://www.wikipedia.org/wiki/Open_source&lt;br /&gt;
*       https://www.heroku.com&lt;br /&gt;
*       http://www.sinatrarb.com&lt;br /&gt;
*	 https://netbeans.org/&lt;br /&gt;
*	 http://aptana.com/products/radrails&lt;br /&gt;
*	 http://www.jetbrains.com/ruby/&lt;br /&gt;
*	 http://komodoide.com&lt;br /&gt;
*	 http://www.emacswiki.org/emacs/RubyOnRails&lt;br /&gt;
*	 http://www.easyeclipse.org/site/distributions/ruby-rails.html&lt;br /&gt;
*	 http://www.sapphiresteel.com/Products/Ruby-In-Steel/Ruby-In-Steel-Developer-Overview&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Spuri3</name></author>
	</entry>
</feed>