The Rich Get Richer: RAILS 3

Total Page:16

File Type:pdf, Size:1020Kb

The Rich Get Richer: RAILS 3 HASHROCKET EXPERTLY CRAFTED WEB The Rich Get Richer: RAILS 3 PRESENTED BY OBIE FERNANDEZ Sunday, December 5, 2010 About 20k USD Sunday, December 5, 2010 About 45k USD Sunday, December 5, 2010 About 200k USD Sunday, December 5, 2010 “a few million dollars” Sunday, December 5, 2010 Sunday, December 5, 2010 HASHROCKET EXPERTLY CRAFTED WEB OMG RAILS 3 ROCKS SO MUCH MORE THAN RAILS 2!!! PRESENTED BY OBIE FERNANDEZ Sunday, December 5, 2010 How is Rails 3 Richer? mainstream adoption maturity performance open-source mindshare CAUTION: JUST A METAPHOR Sunday, December 5, 2010 Sunday, December 5, 2010 The Rich Get Richer: RAILS 3 OBIE FERNANDEZ Presentation Overview • History and Context • What’s new • ActiveRecord Performance • Impact on Application Development Sunday, December 5, 2010 Sunday, December 5, 2010 Ezra Zygmuntovich Sunday, December 5, 2010 merb [...] clocks in at 17,291 [loc]. Rails clocks in at 47,195. As you can see, it’s a tie. Sunday, December 5, 2010 Yehuda Katz Sunday, December 5, 2010 December 23, 2008 Sunday, December 5, 2010 David Heinemeir Hansson Sunday, December 5, 2010 Tom Mornini Photo Credit: Sebastian Delmont Sunday, December 5, 2010 Tom Mornini Photo Credit: Sebastian Delmont Sunday, December 5, 2010 Sunday, December 5, 2010 Sunday, December 5, 2010 Q: How do you prevent bloating? Ryan Sanchez's "Violet Beauregarde" ("Charlie and the Chocolate Factory") Photo by Tera Heater/ MTV News Sunday, December 5, 2010 A: Decoupling http://yestheykeepmebusy.blogspot.com/2009/11/willy-wonka- halloween.html Sunday, December 5, 2010 A: Modularity http://superpunch.blogspot.com/2009/10/lego-violet-beauregarde-and- more.html Sunday, December 5, 2010 require 'active_support/concern' require 'active_support/ordered_options' require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/delegation' module ActiveSupport # Configurable provides a <tt>config</tt> method to store and retrieve # configuration options as an <tt>OrderedHash</tt>. module Configurable extend ActiveSupport::Concern class Configuration < ActiveSupport::InheritableOptions def compile_methods! self.class.compile_methods!(keys.reject {|key| respond_to?(key)}) end # compiles reader methods so we don't have to go through method_missing def self.compile_methods!(keys) keys.each do |key| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{key}; _get(#{key.inspect}); end RUBY end end end ... Sunday, December 5, 2010 Sunday, December 5, 2010 Rails 3.0 August 29, 2010 Sunday, December 5, 2010 SAVE YOURSELF, I’LL HOLD THEM BACK RIGHT NOW, I HOPE YOU’RE READY FOR A FIREFIGHT | ’CAUSE THE DEVIL’S GOT YOUR NUMBER TONIGHT | THEY SAY! | WE’RE NEVER LEAVING THIS PLACE ALIVE | BUT IF YOU SING THESE WORDS WE’LL NEVER DIE | GET OFF THE LEDGE AND DROP THE KNIFE | NOT A VICTIM OF A VICTIM’S LIFE | BECAUSE! | THIS AIN’T A ROOM FULL OF SUICIDES | WE’RE BELIEVERS. I BELIEVE TONIGHT | WE CAN LEAVE THIS WORLD LEAVE IT ALL BEHIND | WE CAN STEAL THIS CAR IF YOUR FOLKS DON’T MIND | WE CAN LIVE FOREVER IF YOU’VE GOT THE TIME | IF YOU SAVE YOURSELF TONIGHT | IF YOU SAVE YOURSELF TONIGHT | I’LL TELL YOU ALL HOW THE STORY ENDS | WHERE THE GOOD GUYS DIE AND THE BAD GUYS WIN | WHO CARES! | IT AIN’T ABOUT ALL THE FRIENDS YOU MADE | BUT THE GRAFFITI THEY WRITE ON YOUR GRAVE | FOR ALL OF US WHO’VE SEEN THE LIGHT | SALUTE THE DEAD AND LEAD THE FIGHT | HAIL HAIL! | WHO GIVES A DAMN IF WE LOSE THE WAR? | LET THE WALLS COME DOWN | LET THE ENGINES ROAR! | WE CAN LEAVE THIS WORLD LEAVE IT ALL BEHIND | WE CAN STEAL THIS CAR IF YOUR FOLKS DON’T MIND | WE CAN LIVE FOREVER IF YOU’VE GOT THE TIME | I’M THE ONLY FRIEND THAT MAKES YOU CRY | YOU’RE A HEART ATTACK IN BLACK HAIR DYE | SO JUST SAVE YOURSELF AND I’LL HOLD THEM BACK TONIGHT | BREAKDOWN | IF YOU SAVE YOURSELF TONIGHT | CAN YOU SAVE YOURSELF TONIGHT | RIGHT NOW! | ’CAUSE I’LL HOLD THEM BACK | WE CAN LEAVE THIS WORLD LEAVE IT ALL BEHIND | WE CAN STEAL THIS CAR IF YOUR FOLKS DON’T MIND | WE CAN LIVE FOREVER IF YOU’VE GOT THE TIME | YOU MOTHERFUCKER | YOU’RE THE BROKEN GLASS IN THE MORNING LIGHT | BE A BURNING STAR IF IT TAKES ALL NIGHT | SO JUST SAVE YOURSELF AND I’LL HOLD THEM BACK TONIGHT | IF YOU SAVE YOURSELF TONIGHT | CAN YOU SAVE YOURSELF TONIGHT? S/C/A/R/E/C/R/O/W MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE | MAKE A WISH WHEN YOUR CHILDHOOD DIES | HERE THE KNOCK KNOCK KNOCK WHEN SHE CRIES | WE’RE ALL ALONE TONIGHT | HOLD YOUR BREATH WHEN THE BLACKBIRD FLIES | COUNT TO 17 AND CLOSE YOUR EYES | I’LL KEEP YOU SAFE INSIDE | HE BURNS | MY SKIN | NEVER MIND ABOUT THE SHAPE I’M IN—I’LL KEEP YOU SAFE TONIGHT | MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE | MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE | BLOW A KISS AT THE METHANE SKIES | SEE THE RUST THROUGH YOUR PLAYGROUND EYES | WE’RE ALL IN LOVE TONIGHT | LEAVE A DREAM WHERE THE FALLOUT LIES | WATCH IT GROW WHERE THE TEARSTAIN DRIES | TO KEEP YOU SAFE TONIGHT | HE BURNS | MY SKIN | NEVER MIND ABOUT THE SHAPE I’M IN—I’LL KEEP YOU SAFE TONIGHT | MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE | MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE | LOVE, LOVE, LOVE WON’T STOP THIS | BOMB, BOMB, LOVE WON’T STOP THIS | BOMB, BOMB, LOVE WON’T STOP THIS BOMB | RUN, RUN, BUNNY, RUN | RUN, RUN, BUNNY, RUN | MOVE YOUR BODY WHEN THE SUNLIGHT DIES | EVERYBODY HIDE YOUR BODY FROM THE SCARECROW | EVERYBODY HIDE The Rich Get Richer: RAILS 3 OBIE FERNANDEZ Notable Plugin Changes • Formtastic 1.1 (made compatible) • InheritedResources 1.1 (rewritten) • Devise (significant upgrades) • RSpec 2 (rewritten) • EmailSpec 1.0 (rewritten) • MetaSearch (instead of Searchlogic) Sunday, December 5, 2010 Sunday, December 5, 2010 Sunday, December 5, 2010 What’s new in Rails 3? Sunday, December 5, 2010 Sunday, December 5, 2010 Sunday, December 5, 2010 config/routes.rb Sunday, December 5, 2010 # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Example::Application config.ru Sunday, December 5, 2010 Rack::Cache ActionDispatch::Static Rack::Lock Rack::Runtime Rails::Rack::Logger ActionDispatch::ShowExceptions ActionDispatch::RemoteIp Rack::Sendfile ActionDispatch::Callbacks ActionDispatch::Cookies ActionDispatch::Flash ActionDispatch::ParamsParser Rack::MethodOverride ActionDispatch::Head Rack::ConditionalGet Rack::ETag ActionDispatch::BestStandardsSupport Rails 3 Middleware “Stack” Sunday, December 5, 2010 Sunday, December 5, 2010 Sunday, December 5, 2010 Sunday, December 5, 2010 gem "rails", "3.0.1" gem 'jquery-rails' gem "mysql" gem "haml", "3.0.18" gem "decent_exposure", "1.0.0.rc1" gem "devise", "1.1.3" gem "chronic", "0.2.3" gem "seed-fu", "1.2.3", :git => "git://github.com/supaspoida/seed-fu.git" gem "block_helpers", "0.3.3" gem "will_paginate", "3.0.pre2" gem "geokit", "1.5.0" group :test do gem "capybara", "0.3.9" gem 'database_cleaner', '0.5.0' gem 'launchy', '0.3.7' gem "rspec-rails", "2.0.1" gem "mocha", "0.9.9" gem "shoulda", "2.11.3" gem "selenium-webdriver" gem "timecop", "0.3.5" gem "watchr" gem "specjour", "0.3.1" gem "email_spec", "1.0.0" end Gemfile Sunday, December 5, 2010 $ bundle Fetching source index for http://rubygems.org Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.1) Using builder (2.1.2) Using i18n (0.4.2) Using activemodel (3.0.1) ... Your bundle is complete! It was installed into /Users/obie/.rvm/gems/ruby-1.9.2- p0@example-application Sunday, December 5, 2010 Sunday, December 5, 2010 Arel by Nick Kallen Sunday, December 5, 2010 Sunday, December 5, 2010 “closure under composition” Sunday, December 5, 2010 User.find :conditions => { :name => "obie" } # in Rails 3 becomes User.where(:name => "obie") Sunday, December 5, 2010 >> u = User.where(first_name: "Pascale"); u.to_sql => "SELECT `users`.* FROM `users` WHERE (`users`.`first_name` = 'Pascale') >> u.where(age: 21).to_sql => "SELECT `users`.* FROM `users` WHERE (`users`.`first_name` = 'Pascale') AND (`users`.`age` = 21)" >> u.order(:name).limit(20).to_sql => "SELECT `users`.* FROM `users` WHERE (`users`.`first_name` = 'Pascale') ORDER BY name LIMIT 20" Sunday, December 5, 2010 class Invitation < ActiveRecord::Base default_scope order("created_at DESC") scope :accepted, where("accepted_at is NOT NULL") scope :pending, where(accepted_at: nil) ... end Scopes Sunday, December 5, 2010 All of my open-sourced projects share two attributes. First, the source code is extremely stylized and meant to be /read/ more than /used/. They are literary arguments in code much more than a useful piece of infrastructure. If you read the source-code to Arel you will see a highly afected "combinator" and "interpreter" style of coding. Nick Kallen Sunday, December 5, 2010 “Holy shit, Rails 3 is slow!” Sunday, December 5, 2010 #5098 Sunday, December 5, 2010 joins = [{:dim_locations=>[:dim_zip, {:dim_city=> {:dim_state=>:dim_country}}]}, :dim_ages, :dim_car_makes, :dim_educations, :dim_employments, :dim_foods, :dim_genders, :dim_get_aways, :dim_home_ownerships, :dim_incomes, :dim_marital_statuses, :dim_teams] conditions = ["(dim_zips.zip_code = ? OR dim_zips.zip_code IS NULL) AND (dim_cities.city = ? OR dim_cities.city IS NULL) AND (dim_states.state_code = ? OR dim_states.state_code IS NULL) AND (dim_states.state = ? OR dim_states.state IS NULL) AND (dim_countries.country_code
Recommended publications
  • Rubicon: Bounded Verification of Web Applications
    Rubicon: Bounded Verification of Web Applications The MIT Faculty has made this article openly available. Please share how this access benefits you. Your story matters. Citation Joseph P. Near and Daniel Jackson. 2012. Rubicon: bounded verification of web applications. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering (FSE '12). ACM, New York, NY, USA, Article 60, 11 pages. As Published http://dx.doi.org/10.1145/2393596.2393667 Publisher Association for Computing Machinery (ACM) Version Author's final manuscript Citable link http://hdl.handle.net/1721.1/86919 Terms of Use Creative Commons Attribution-Noncommercial-Share Alike Detailed Terms http://creativecommons.org/licenses/by-nc-sa/4.0/ Rubicon: Bounded Verification of Web Applications Joseph P. Near, Daniel Jackson Computer Science and Artificial Intelligence Lab Massachusetts Institute of Technology Cambridge, MA, USA {jnear,dnj}@csail.mit.edu ABSTRACT ification language is an extension of the Ruby-based RSpec We present Rubicon, an application of lightweight formal domain-specific language for testing [7]; Rubicon adds the methods to web programming. Rubicon provides an embed- quantifiers of first-order logic, allowing programmers to re- ded domain-specific language for writing formal specifica- place RSpec tests over a set of mock objects with general tions of web applications and performs automatic bounded specifications over all objects. This compatibility with the checking that those specifications hold. Rubicon's language existing RSpec language makes it easy for programmers al- is based on the RSpec testing framework, and is designed to ready familiar with testing to write specifications, and to be both powerful and familiar to programmers experienced convert existing RSpec tests into specifications.
    [Show full text]
  • Rubicon: Bounded Verification of Web Applications
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by DSpace@MIT Rubicon: Bounded Verification of Web Applications Joseph P. Near, Daniel Jackson Computer Science and Artificial Intelligence Lab Massachusetts Institute of Technology Cambridge, MA, USA {jnear,dnj}@csail.mit.edu ABSTRACT ification language is an extension of the Ruby-based RSpec We present Rubicon, an application of lightweight formal domain-specific language for testing [7]; Rubicon adds the methods to web programming. Rubicon provides an embed- quantifiers of first-order logic, allowing programmers to re- ded domain-specific language for writing formal specifica- place RSpec tests over a set of mock objects with general tions of web applications and performs automatic bounded specifications over all objects. This compatibility with the checking that those specifications hold. Rubicon's language existing RSpec language makes it easy for programmers al- is based on the RSpec testing framework, and is designed to ready familiar with testing to write specifications, and to be both powerful and familiar to programmers experienced convert existing RSpec tests into specifications. in testing. Rubicon's analysis leverages the standard Ruby interpreter to perform symbolic execution, generating veri- Rubicon's automated analysis comprises two parts: first, fication conditions that Rubicon discharges using the Alloy Rubicon generates verification conditions based on specifica- Analyzer. We have tested Rubicon's scalability on five real- tions; second, Rubicon invokes a constraint solver to check world applications, and found a previously unknown secu- those conditions. The Rubicon library modifies the envi- rity bug in Fat Free CRM, a popular customer relationship ronment so that executing a specification performs symbolic management system.
    [Show full text]
  • Ruby, Appium, Android, Rspec, Pry, Automation Testing
    GKTCS Innovations Pvt. Ltd. Ruby, Appium, Android, Rspec, Pry, Automation Testing Surendra Panpaliya Director, GKTCS Innovations Pvt. Ltd, Pune. 16 + Years of Experience ( MCA, PGDCS, BSc. [Electronics] , CCNA) Director , GKTCS Innovations Pvt. Ltd. Pune [ Nov 2009 – Till date ] IT Manager and Consultant at Rolta India Ltd, Mumbai [ April 2007 – Oct 2009 ] Associate Professor at Sinhgad Institute , Pune [Jan 2002 – April 2007] Instructor , ITM Bangalore [ May 2000 – Jan 2002 ] Project Trainee, DSYS Software Group, Bangalore [ Jan 1999 to April 2000] Skills ❑ Ruby, Rail,Appium, Python, Jython, Django, Android , PHP, LAMP ❑ Data Communication & Networking, CCNA ❑ UNIX /Linux Shell Scripting, System Programming ❑ CA Siteminder, Autosys, SSO, Service Desk, Service Delivery Author of 4 Books National Paper Presentation Awards at BARC Mumbai 2 Agenda ( Day 1) • Introduction • Ruby installation • What’s New in Ruby • Ruby Data Types/ Data Structure • Ruby Comparison with Other Language ( Java/C+ + ) • Ruby Demo Script • Appium Introduction • Appium Installation Setup • Discussion 3 Agenda ( Day 2) • Android adb commands • About Android AVD • About Appium Architecture • Appium Features • Using Appium to test Android Emulator/ Physical Device • Writing Ruby Scripts to Automate app through Appium • Discussion 4 Agenda ( Day 3) • Manual Testing to Automation using Ruby • Execute and Automate Test • Rspec Introduction • Rspec Installation • Rspec for Automation • Rspec Demo • Pry Introduction • Debugging using Pry • Pry Demo • Discussion 5 Introduction • What is Ruby? • What is difference between Scripting language and Programming Language? • What’s New in Ruby? • Ruby Installation • irb • Ruby Script execution. 6 Appium Introduction What is Appium? • Appium is a mobile UI testing framework supporting cross-platform testing of native, hybrid and mobile-web apps for iOS and Android.
    [Show full text]
  • Ola Bini Computational Metalinguist [email protected] 698E 2885 C1DE 74E3 2CD5 03AD 295C 7469 84AF 7F0C
    JRuby For The Win Ola Bini computational metalinguist [email protected] http://olabini.com/blog 698E 2885 C1DE 74E3 2CD5 03AD 295C 7469 84AF 7F0C onsdag 12 juni 13 Logistics and Demographics onsdag 12 juni 13 LAST MINUTE DEMO onsdag 12 juni 13 JRuby Implementation of the Ruby language Java 1.6+ 1.8.7 and 1.9.3 compatible (experimental 2.0 support) Open Source Created 2001 Embraces testing Current version: 1.7.4 Support from EngineYard, RedHat & ThoughtWorks onsdag 12 juni 13 Why JRuby? Threading Unicode Performance Memory Explicit extension API and OO internals Libraries and legacy systems Politics onsdag 12 juni 13 InvokeDynamic onsdag 12 juni 13 JRuby Differences Most compatible alternative implementation Native threads vs Green threads No C extensions (well, some) No continuations No fork ObjectSpace disabled by default onsdag 12 juni 13 Simple JRuby onsdag 12 juni 13 Java integration Java types == Ruby types Call methods, construct instances Static generation of classes camelCase or snake_case .getFoo(), setFoo(v) becomes .foo and .foo = v Interfaces can be implemented Classes can be inherited from Implicit closure conversion Extra added features to Rubyfy Java onsdag 12 juni 13 Ant+Rake onsdag 12 juni 13 Clojure STM onsdag 12 juni 13 Web onsdag 12 juni 13 Rails onsdag 12 juni 13 Sinatra onsdag 12 juni 13 Trinidad onsdag 12 juni 13 Swing Swing API == large and complex Ruby magic simplifies most of the tricky bits Java is a very verbose language Ruby makes Swing fun (more fun at least) No consistent cross-platform GUI library for Ruby
    [Show full text]
  • Ruby on Rails™ Tutorial: Learn Web Developments with Rails
    ptg8286261 www.it-ebooks.info Praise for Michael Hartl’s Books and Videos on Ruby on RailsTM ‘‘My former company (CD Baby) was one of the first to loudly switch to Ruby on ptg8286261 Rails, and then even more loudly switch back to PHP (Google me to read about the drama). This book by Michael Hartl came so highly recommended that I had to try it, and the Ruby on RailsTM Tutorial is what I used to switch back to Rails again.’’ —From the Foreword by Derek Sivers (sivers.org) Formerly: Founder, CD Baby Currently: Founder, Thoughts Ltd. ‘‘Michael Hartl’s Rails Tutorial book is the #1 (and only, in my opinion) place to start when it comes to books about learning Rails. It’s an amazing piece of work and, unusually, walks you through building a Rails app from start to finish with testing. If you want to read just one book and feel like a Rails master by the end of it, pick the Ruby on RailsTM Tutorial.’’ —Peter Cooper Editor, Ruby Inside www.it-ebooks.info ‘‘Grounded in the real world.’’ —I Programmer (www.i-programmer.info), by Ian Elliot ‘‘The book gives you the theory and practice, while the videos focus on showing you in person how its done. Highly recommended combo.’’ —Antonio Cangiano, Software Engineer, IBM ‘‘The author is clearly an expert at the Ruby language and the Rails framework, but more than that, he is a working software engineer who introduces best practices throughout the text.’’ —Greg Charles, Senior Software Developer, Fairway Technologies ‘‘Overall, these video tutorials should be a great resource for anyone new to Rails.’’ —Michael Morin, ruby.about.com ‘‘Hands-down, I would recommend this book to anyone wanting to get into Ruby on Rails development.’’ —Michael Crump, Microsoft MVP ptg8286261 www.it-ebooks.info RUBY ON RAILSTM TUTORIAL Second Edition ptg8286261 www.it-ebooks.info Visit informit.com/ruby for a complete list of available products.
    [Show full text]
  • Collaborative Topic Modeling for Recommending Github Repositories
    Collaborative Topic Modeling for Recommending GitHub Repositories Naoki Orii School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213, USA [email protected] ABSTRACT While an increase in the number of availble open source software projects certainly benefits the open source ecosys- The rise of distributed version control systems has led to a tem, it has become more difficult for programmers to find significant increase in the number of open source projects projects of interest. In 2009, GitHub hosted a recommenda- available online. As a consequence, finding relevant projects tion contest to recommend repositories to users. The train- has become more difficult for programmers. Item recom- ing dataset was based on 440,000 user-watches-repository mendation provides a way to solve this problem. In this pa- relationships given by over 56,000 users to nearly 121,000 per, we utilize a recently proposed algorithm that combines repositories. The test dataset consisted of 4,800 users (which traditional collaborative filtering and probabilistic topic mod- all of them are in the training data), and the goal is to rec- eling. We study a large dataset from GitHub, a social net- ommend up to 10 repositories for each of the test users. working and open source hosting site for programmers, and compare the method against traditional methods. We also The problem of item recommendation has been studied provide interpretations on the latent structure for users and extensively, especially involving the Netflix Prize. However, repositories. there is a distinct difference between the Netflix Prize and GitHub's recommendation contest. While in both contests we have the user-item matrix, we can also consider source 1.
    [Show full text]
  • Ruby on Rails
    Ruby.learn{ |stuff| } ● What is Ruby? ● What features make it interesting to me (and maybe you)? ● A quick, idiosyncratic tour of the Ruby ecosphere. Tuesday Software Lunch Talk: March 4, 2008 What is it? ● a dynamic, object-oriented, open source programming language... ● with a uniquely (but not too uniquely), expressive syntax ● dynamically or “duck” typed ● influenced by Perl, Smalltalk, Eiffel, Ada and Lisp ● has aspects of functional and imperative programming styles History ● created by Yukihiro “Matz” Matsumoto on Feb 24 1993, released to public in 1995 ● “Ruby” coined in comparison to “Perl” Philosophy (the “Ruby Way”) ● emphasize programmer needs over computer needs ● encourage good design, good APIs ● Principle of Least Surprise (POLS) – the language should behave in such a way as to minimize confusion for experienced users ● “Everything should be a simple as possible, but no simpler.” - Einstein ● orthogonality ● change at runtime is not to be feared Interesting Stuff... ● Is Not a Ruby tutorial – http://tryruby.hobix.com/ – Programming Ruby: The Pragmatic Programmer's Guide – our just google it – you want something totally different? ● http://poignantguide.net/ruby/ ● Is what I find interesting/different/well done about Ruby. Everything's an Object ● no exceptions Falsiness ● only false and nil are falsey. Not 0. Symbols ● labels ● lightweight strings with no behaviour ● often used as hash keys Blocks ● another name for a Ruby block is a “closure” ● clo-sure [kloh-zher] – noun. A function that is evaluated in an environment containing one or more bound variables. Procs ● anonymous subroutines or closures with a life of their own Adding Methods to Classes ● You can add methods to an object at runtime in several ways..
    [Show full text]
  • Getting Started with Appium
    E-BOOK Getting Started With Appium RUBY EDITION 2018.1 LEARN MORE AT SAUCELABS.COM BY JONATHAN LIPPS TABLE OF CONTENTS 3 Preface 20 Chapter 4: Writing Your First Test 4 Chapter 1: Introduction 25 Chapter 5: Introduction to Page Objects 4 The Appium Vision 30 Chapter 6: Android Joins the Party 5 The Appium Drivers 35 Chapter 7: Running Local Tests With Rake 6 The Appium Clients 36 Chapter 8: Running Tests in the Sauce Labs Cloud 7 Chapter 2: Getting Set Up 40 Annotating Tests on Sauce 7 Assumed Knowledge 41 Chapter 9: Automating Test Runs with a CI Server 7 iOS-specific System Setup 41 Setting Up Jenkins 7 Android-Specific System Setup 42 Creating an Android Build 8 Appium Setup 44 Creating an iOS Build 10 Ruby Client Setup 44 Running on Sauce 10 Project Setup 45 Jenkins for Production 11 Known Working Versions 46 Chapter 10: Heading Out on Your Own 12 Chapter 3: Exploring Your App 46 Resources 12 Using the Appium Ruby Console 47 Support 17 Using the Appium Desktop Inspector PREFACE This little e-book will help you get started with Appium using the Ruby programming language. It is a complete revision from the ground up of an earlier guide written by Dave Haeffner, who along with Matthew Edwards deserves a lot of thanks for all the work put into the first edition. Appium is an open source project that is always changing, and guides like this one will never be accurate forever. When possible I will indicate which versions of various software are being used, which might help in ensuring reproducibility of the code samples used here.
    [Show full text]
  • Ruby on Rails Django
    glossarytech.com Ruby A Redis -backed library for creating background jobs, placing those jobs Resque on multiple queues, and processing them later. Active A Ruby library for working with Relational SQL Databases, like MySQL Record and Postgres . It provides an Object Relational Mapping . A security scanner. Checks Ruby on Rails applications for security Brakeman vulnerabilities. Looks at the source code of an application. Ensures Ruby applications run the same code on every machine. Tracks Bundler and installs the exact gems and versions that are needed. Remote server automation and deployment tool written in Ruby . Capistrano C apistrano automates the process of making a new version of an application available on one or more web servers. Automation library that provides a means for controlling a browser. Capybara S imulates scenarios for user stories and automates web application testing for behavior-driven software development. A dynamic, functional language designed for building scalable and maintainable applications. Leverages the Erlang VM, known for the Crystal r unning low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain. Embedded Ruby. A templating language that enables to embed Ruby ERB c ode in an HTML document, similar to ASP, JSP and PHP and other server-side scripting languages. Fast, simple event-processing library for Ruby programs. The most EventMachi p opular library for concurrent computing in the Ruby programming ne language. A software library for the Ruby . Provides factory methods to create test FactoryBot fixtures for automated software testing. REST -like API micro-framework for Ruby .
    [Show full text]
  • Fine Articles on Ruby & Rails
    Rails Magazine MyMagazineIssue 1, Julyfine 2008 articles on Ruby & Rails Extending Rails Through Plugins by John Yerhot Receiving E-Mail With Rails by Jason Seifer Delegation in Ruby by Khaled al Habache Subscription billing with Saasy by Alex MacCaw Making the Switch From RSpec to Shoulda by Dan Pickett Playing Hooky a.k.a. web hooks by John Nunemaker Adhearsion by Jason Goecke & Jay Phillips Rails Performance Analysis by Terry Heath Getting Started with JRuby and JRuby on Rails by Joshua Moore 1 ISSN 1916-8004 http://RailsMagazine.com Editorial2 by Olimpiu Metiu Editorial Contents by Olimpiu Metiu Welcome to the first edition of Rails Magazine, the first and Editorial ...........................................................................2 only free magazine dedicated to the Ruby on Rails community! by Olimpiu Metiu If you are interested in a quality compilation of timely, relevant articles, with editorial oversight and beautiful layout, Extending Rails Through Plugins .................................3 please check out the magazine regularly or subscribe online. by John Yerhot Long before launch, I was impressed with the level of interest and receptiveness. Rails always had a vibrant and dedicated com- Receiving E-Mail With Rails .........................................4 munity, and I hope Rails Magazine will become an appreciated by Jason Seifer resource for those looking for quality information — at the same time providing global exposure to those interested in getting Delegation in Ruby .........................................................8 published. by Khaled al Habache Subscription billing with Saasy ...................................13 Olimpiu Metiu is a Toronto-based architect and by Alex MacCaw the leader of the Emergent Technologies group at Bell Canada. His work includes many of Canada's Making the Switch From RSpec to Shoulda ..............16 largest web sites and intranet portals.
    [Show full text]
  • Qcon Not Just Another JVM Language
    Sun Microsystems, Inc. Agenda • Ruby feature walkthrough • JRuby enhancements and additions • Swing programming • Demo: Swing in Ruby • Web applications • Demo: JRuby on Rails • Persistence • Build automation • Test and behavior-driven development 2 Who am I • Charles Oliver Nutter • Longtime Java developer (10+ yrs) • Engineer at Sun Microsystems for 1 yr • Full-time JRuby developer • Also working on JVM dynlang support • Wide range of past experience > C, C++, C#, Perl, Python, Delphi, Lisp, Scheme > Java EE and ME, JINI, WS 3 Page 1 Sun Microsystems, Inc. What Is Ruby • Dynamic-typed, pure OO language > Interpreted > Open source, written in C > Good: easy to write, easy to read, powerful, “fun” > Bad: green threads, unicode support, libraries, “slow” • Created 1993 by Yukihiro “Matz” Matsumoto > “More powerful than Perl and more OO than Python” • Very active community, wide range of apps • Ruby 1.8.x is current, 1.9 is in development to become 2.0 4 Ruby Quick Tour: Pure OO • Everything is an Object > Circle.new(4) => instance of Circle > “abc”.length => 3 > 1.to_s => “1” • All Objects are instances of Classes > 1.class => Fixnum • Single-Inheritance • Object is base class of all classes 5 Ruby Quick Tour: Basics • Literals > Fixnum: 1 > Float: 1.0 > Bignum: 12345678987654321 > String: “one” 'one' %Q[one] %q[one] ... > Multiline string (“here doc”): x = <<EOS extend across two lines EOS > Symbol: :one, %s[one] > Regexp: /^foo\w+.*bar$/, %r[^foo$] > Array: [1, “ein”, :ichi] > Hash: {:one => 1, :two => 2} 6 Page 2 Sun Microsystems, Inc. Ruby Quick Tour: Basics • String substitution > a = “foo” > b = “bar#{a}baz” => “barfoobaz” • Operator overloading > def +(arg); ..
    [Show full text]
  • Rspec Documentation
    RSPec Documentation Contents: 1. Introduction to Rspec - Installing Rspec Gem (Getting Started) - Terminology used in Rspec 2. Writing Simple Rspec Tests 3. Running Rspec Testfiles 4. Scenario Testing Examples of OAR REST APIs using Rspec 5. Creating Rspec Testsuites 6. Tutorials/References Written by , Narayanan K Gsoc-2010,OAR Testsuites Introduction to Rspec Rspec is a behavior driven test development framework developed for Ruby. Behavior Driven Development(BDD) began its journey as an attempt to better understand and explain the process of Test Driven Development. Behavior driven development is an agile software development technique . Lot of beautiful documentations describing RSpec are available online including the e- book, “The RSpec Book” by David Chelinsky. I have included the sites and the e-book that is available in the reference section of this documentation that really got me testing my codes with RSpec. This documentation specifically deals with how to perform unit/scenario testing of the OAR REST APIs. The RSpec tool is a Ruby package that lets you build a specification alongside your software. This specification is actually a test that describes the behavior of your system. Here's the flow for development with RSpec: • You write a test. This test describes the behavior of a small element of your system. • You run the test. The test fails because you have not yet built the code for that part of your system. This important step tests your test case, verifying that your test case fails when it should. • You write enough code to make the test pass. • You run the tests and verify that they pass.
    [Show full text]