+ All Categories
Home > Software > An introduction to the ruby ecosystem

An introduction to the ruby ecosystem

Date post: 26-Jun-2015
Category:
Upload: geison-flores
View: 188 times
Download: 1 times
Share this document with a friend
Description:
An introductions to Ruby ecosystem: Ruby Implementations(MRI, Rubinius, Jruby) Interpreters(irb, pry), Version Managers(rbenv, RVM), Package Manager(RubyGems), Bundler, Rake, Web Frameworks(Ruby on Rails, Sinatra), Mobile Development(IronRuby, RubyMotion, Ruboto), Application Servers(Phusion Passenger, Unicorn, Puma), Deployment Automation(Capristano, Chef), Continuos Integration(Semaphorem Jenkins), Tests(TestUnit, minitest, RSpec, Capybara, Cucumber), Security Analiser(Brakeman).
Popular Tags:
19
+ = An Introduction to the Ruby Ecosystem
Transcript
Page 1: An introduction to the ruby ecosystem

+ =An Introduction to the Ruby Ecosystem

Page 2: An introduction to the ruby ecosystem

An Introduction to the Ruby Ecosystem

Page 3: An introduction to the ruby ecosystem

Ruby is an interpreted language which means it needs an… interpreter. In a nutshell, his job is to take your source code as an input and to execute it.The three most popular Ruby interpreter are:

● Matz’s Ruby Interpreter (MRI): the oficial by Matz● Rubinius: a well-known fast Ruby implementation of Ruby● JRuby: a JVM implementation

An Introduction to the Ruby Ecosystem

Page 4: An introduction to the ruby ecosystem

A read–eval–print loop (REPL), also known as an interactive toplevel or language shell, is a simple, interactive computer programming environment that takes single user inputs (i.e. single expressions), evaluates them, and returns the result to the user; a program written in a REPL environment is executed piecewise.The Ruby language have 2 main used REPLs:

● IRB - Ruby built-in shell.● PRY - A powerful alternative to the standard IRB shell for Ruby.

An Introduction to the Ruby Ecosystem

Page 5: An introduction to the ruby ecosystem

Command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.

The Ruby language have 2 main used version managers:

● RVM - Ruby Version Manager.● rbenv - Simple Ruby Version Manager.

An Introduction to the Ruby Ecosystem

Page 6: An introduction to the ruby ecosystem

RubyGems (previously known as Gemcutter) is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.

Example of command to install a gem:

gem install mygem

● https://rubygems.org/

An Introduction to the Ruby Ecosystem

Page 7: An introduction to the ruby ecosystem

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.

Bundler is an exit from dependency hell, and ensures that the gems you need are present in development, staging, and production. Starting work on a project is as simple as bundle install.

An Introduction to the Ruby Ecosystem

source :rubygems

gem "nokogiri"gem "rails", "3.0.0.beta3"gem "rack", ">=1.0"gem "thin", "~>1.1"

gem "thor", path: "../thor"

group :test do gem "rspec"end

Page 8: An introduction to the ruby ecosystem

Rake is a software task management tool. It allows you to specify tasks and describe dependencies as well as to group tasks in a namespace.

It is similar to SCons and Make, but it has a number of differences. The tool is written in the Ruby programming language and the Rakefiles (equivalent of Makefiles in Make) use Ruby syntax. It was originated by Jim Weirich.

Rake uses Ruby's anonymous function blocks to define various tasks, allowing the use of Ruby syntax. It has a library of common tasks: for example, functions to do common file-manipulation tasks and a library to remove compiled files (the "clean" task). Like Make, Rake can also synthesize tasks based on patterns: for example, automatically building a file compilation task based on filename patterns. Rake is now part of the standard library from Ruby version 1.9 onward.

An Introduction to the Ruby Ecosystem

Page 9: An introduction to the ruby ecosystem

namespace :afternoon do task :make_coffee do Rake::Task['morning:make_coffee'].invoke puts "Ready for the rest of the day!" end end

An Introduction to the Ruby Ecosystem

Page 10: An introduction to the ruby ecosystem

Ruby has the most famous web framework and maybe the framework with the larger community, its name is Ruby on Rails. Ruby has a lot of web frameworks, here is listed the 2 most used.

● Ruby on Rails - An open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.

● Sinatra - A DSL for quickly creating web applications in Ruby with minimal effort. Largelly used to create REST Services.

An Introduction to the Ruby Ecosystem

Page 11: An introduction to the ruby ecosystem

Ruby has toolchains that enable Ruby developers create mobile apps natively to iOS, Android and Windows.

● RubyMotion - A revolutionary toolchain that lets you quickly develop and test full-fledged native apps for iPhone, iPad, Mac and Android (beta), all using your favorite editor and the awesome Ruby language you know and love.

● Ruboto - A framework and tool chain to develop native Android apps, using the Ruby language we all know and love.

● IronRuby - An open-source implementation of the Ruby programming language which is tightly integrated with the .NET Framework. IronRuby can use the .NET Framework and Ruby libraries, and other .NET languages can use Ruby code just as easily.

An Introduction to the Ruby Ecosystem

Page 12: An introduction to the ruby ecosystem

An Application Server is a complete server which provides an environment for running the business components in addition to providing the capabilities of a Web Container as well as of a Web Server.

● Phusion Passenger - An application server that is compiled either as an Apache module or compiled directly along with the nginx source code (because nginx doesn't contain a plugin architecture like Apache does). It excels in situations that need multiple low traffic applications running on the same machine.

● Unicorn - An HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between Unicorn and slow clients.

● Puma - A modern, concurrent web server for Ruby.

An Introduction to the Ruby Ecosystem

Page 13: An introduction to the ruby ecosystem

As the amount of services and applications grows, becomes extremely hard to deploy all the services and handle all the configurations. In order to solve this kind of problem Ruby has 2 very good tools.

● Capistrano - A utility and framework for executing commands in parallel on multiple remote machines, via SSH.

● Chef - A configuration management tool designed to bring automation to your entire infrastructure.

An Introduction to the Ruby Ecosystem

Page 14: An introduction to the ruby ecosystem

A very good practice adopted in the development process is the continuous delivery. The process where every time the code is committed to a shared host some tasks are executed on the code in order to validate the quality, and if everything is ok the code is deployed. The 2 most used CI server are:

● Jenkins - An extendable open source continuous integration server.● Semaphore - A hosted continuous integration and delivery solution for open

source and private projects.

An Introduction to the Ruby Ecosystem

Page 15: An introduction to the ruby ecosystem

Testing is a large part of Ruby culture. Ruby comes with its own Unit-style testing framework called minitest (Or TestUnit for Ruby version 1.8.x). There are many testing libraries with different goals.

● TestUnit - Ruby 1.8’s built-in “Unit-style” testing framework● minitest - Ruby 1.9/2.0’s built-in testing framework● RSpec - A testing framework that focuses on expressivity● Capybara - The integration testing framework● Cucumber - A BDD testing framework that parses Gherkin formatted tests

An Introduction to the Ruby Ecosystem

Page 16: An introduction to the ruby ecosystem

A tool responsible to check possible vulnerabilities in a project.

● Brakeman - An open source vulnerability scanner specifically designed for Ruby on Rails applications. It statically analyzes Rails application code to find security issues at any stage of development.

An Introduction to the Ruby Ecosystem

Page 17: An introduction to the ruby ecosystem

An Introduction to the Ruby Ecosystem

Page 19: An introduction to the ruby ecosystem

An Introduction to the Ruby Ecosystem


Recommended