The Book of Ruby

Total Page:16

File Type:pdf, Size:1020Kb

The Book of Ruby THE BOOK OF RUBY HUW COLLINGBOURNE THE BOOK OF RUBY Copyright © 2009 Huw Collingbourne The right of Huw Collingbourne to be identified as the Author of the Work has been asserted by him in accordance with the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this publication may be reproduced, stored in a re- trieval system, or transmitted in any form or by any means without the prior writ- ten permission of the publisher, nor be otherwise circulated in any form of binding or cover other than that in which it is published and without a similar condition be- ing imposed on the subsequent purchaser. Author’s web site: http://www.sapphiresteel.com/ ABOUT THE AUTHOR ABOUT THE AUTHOR Huw Collingbourne is Technology Director of SapphireSteel Software (http://www.sapphiresteel.com/), developers of the ‘Ruby In Steel’ Ruby and Rails IDE for Visual Studio and the ‘Amethyst’ IDE for Adobe Flex. Huw is a well known technology writer in the UK and has written numerous opinion and programming columns, including tutorials on C#, Delphi, Java, Smalltalk and Ruby for a number of computer magazines such as Computer Shopper, PC Pro and PC Plus. He is author of the free ebook, The Little Book Of Ruby, and is the editor the online computing magazine, Bitwise (www.bitwisemag.com). Huw has an MA in English from the University of Cambridge. THE BOOK OF RUBY INTRODUCTION Getting Started With Ruby As you are now reading a book on Ruby, I think it is safe to work on the assump- tion that you don’t need me to persuade you of the merits of the Ruby language. Instead I’ll take the somewhat unconventional step of starting with a warning: many people are attracted to Ruby by its simple syntax and its ease of use. They are wrong. Ruby’s syntax may look simple at first sight but, the more you get to know the language the more you will realize that it is, on the contrary, extremely complex. The plain fact of the matter is that Ruby has a number of pitfalls just waiting for unwary programmers to drop into. In this book it is my aim to guide you safely over the pitfalls and lead you through the choppy waters of Ruby’s syntax and class libraries. In the process, I’ll be exploring both the smooth, well-paved highways and the gnarlier, bumpy little byways of Ruby. By the end of the journey, you should be able to use Ruby safely and effectively without getting caught out by any unexpected hazards along the way. The Book Of Ruby concentrates principally on version 1.8.x of the Ruby lan- guage. While a version 1.9 of Ruby has been released, Ruby 1.8 is still far more widely used. Ruby 1.9 may be regarded as a stepping stone towards Ruby 2.0. In most respects the syntax of Ruby 1.9 is close to that of Ruby 1.8 but you should be aware that there are some differences and complete compatibility is not guaranteed. i THE BOOK OF RUBY HOW TO READ THIS BOOK The book is divided up into bite-sized chunks. Each chapter introduces a theme which is subdivided into sub-topics. Each programming topic is accompanied by one or more small self-contained, ready-to-run Ruby programs. If you want to follow a well-structured ‘course’, read each chapter in sequence. If you prefer a more hands-on approach, you can run the programs first and refer to the text when you need an explanation. If you already have some experience of Ruby, feel free to cherry-pick topics in any order that you find useful. There are no monolithic applications in this book so you don’t have to worry that you might ‘lose the plot’ if you read the chapters out of order! DIGGING DEEPER Every chapter apart from the first includes a section called ‘Digging Deeper’. This is where we explore specific aspects of Ruby (including a few of those gnarly byways I mentioned a moment ago) in greater depth. In many cases you could skip the Digging Deeper sections and still learn all the Ruby you will ever need. On the other hand, it is in the Digging Deeper sections that we often get closest to the inner workings of Ruby so, if you skip them, you are going to miss out on some pretty interesting stuff. MAKING SENSE OF THE TEXT In The Book Of Ruby, any Ruby source code is written like this: def saysomething puts( "Hello" ) end When there is a sample program to accompany the code, the program name is shown in a box on the right-hand side of the page, like this: helloname.rb ii INTRODUCTION Explanatory notes (which generally provide some hints or give a more in-depth explanation of some point mentioned in the text) are shown in a box like this: This is an explanatory note. You can skip it if you like – but if you do so, you may miss something of interest<! iii THE BOOK OF RUBY Ruby and Rails WHAT IS RUBY? Ruby is a cross-platform interpreted language which has many features in common with other ‘scripting’ languages such as Perl and Python. It has an ‘English language’ style syntax which looks somewhat Pascal-like at first sight. It is thoroughly object oriented, and has a good deal in common with the great- granddaddy of ‘pure’ OO languages, Smalltalk. It has been said that the lan- guages which most influenced the development of Ruby were: Perl, Smalltalk, Eiffel, Ada and Lisp. The Ruby language was created by Yukihiro Matsumoto (commonly known as ‘Matz’) and it was first released in 1995. WHAT IS RAILS? Currently much of the excitement surrounding Ruby can be attributed to a web development framework called Rails – popularly known as ‘Ruby On Rails’. Rails is an impressive framework but it is not the be-all and end-all of Ruby. Indeed, if you were to leap right into Rails development without first mastering Ruby, you might find that you end up creating applications that you don’t even understand (this is, in fact, all too common among Ruby On Rails novices). Understanding Ruby is a necessary prerequisite of understanding Rails. DOWNLOAD RUBY You can download the latest version of Ruby from http://www.ruby-lang.org. Be sure to download the binaries (not merely the source code). On a PC you can install Ruby using the Ruby Installer for Windows: http://rubyinstaller.rubyforge.org/wiki/wiki.pl Alternatively, if you are using the Ruby In Steel IDE, you can install Ruby, Rails, Ruby In Steel and all the other tools you will need using the Ruby In Steel ‘All-in- one installer’ available on the site’s Download page: http://www.sapphiresteel.com/ iv INTRODUCTION GET THE SOURCE CODE OF THE SAMPLE PROGRAMS All the programs in every chapter in this book are available for download as a Zip archive from http://www.sapphiresteel.com/The-Book-Of-Ruby. When you unzip the programs you will find that they are grouped into a set of directories – one for each chapter. For the benefit of programmers using Ruby In Steel (the Visual Studio IDE developed by the author of this book’s company), you will be able to load the programs as Visual Studio solutions into Ruby In Steel For Visual Studio 2008, with the programs for each chapter arranged on the branches of a tree in the Project Manager. If you are using another editor or IDE, load each Ruby program, one by one, as it is needed. Users of Ruby In Steel for Visual Studio 2005 may import or convert the projects (via the File New/Open menu). RUNNING RUBY PROGRAMS It is often useful to keep a command window open in the source directory containing your Ruby program files. Assuming that the Ruby interpreter is correctly pathed on your system, you will then be able to run programs by entering ruby <program name> like this: ruby 1helloworld.rb If you are using Ruby In Steel you can run the programs in the interactive console by pressing CTRL+F5 or run them in the debugger by pressing F5. THE RUBY LIBRARY DOCUMENTATION The Book Of Ruby covers many of the classes and methods in the standard Ruby library - but by no means all of them! At some stage, therefore, you will need to refer to documentation on the full range of classes used by Ruby. Fortunately, the Ruby class library contains embedded documentation which has been extracted and compiled into an easily browsable reference which is available in several formats. For example, refer to this online documentation which is shown in a multi-pane web page: http://www.ruby-doc.org/core/ v THE BOOK OF RUBY Alternatively, here you can browse the library alphabetically: http://www.ruby-doc.org/stdlib/ The above page contains instructions for downloading the documentation for offline browsing. There is also a page from which the library (and other) docu- mentation may be downloaded in various formats, versions and languages: http://www.ruby-doc.org/downloads OK, that’s enough of the preamble – let’s get down to work. Time to move straight on to Chapter One< vi INTRODUCTION The Book Of Ruby is sponsored by SapphireSteel Software, makers of the Ruby In Steel IDE for Visual Studio. http://www.sapphiresteel.com vii CHAPTER ONE Strings, Numbers, Classes and Objects The first thing to know about the Ruby language is that it’s easy to use.
Recommended publications
  • Konzeption Und Implementierung Eines Gamification Services Mit Ruby
    Konzeption und Implementierung eines Gamification Services mit Ruby Reinhard Buchinger MASTERARBEIT eingereicht am Fachhochschul-Masterstudiengang Interaktive Medien in Hagenberg im Dezember 2012 © Copyright 2012 Reinhard Buchinger Diese Arbeit wird unter den Bedingungen der Creative Commons Lizenz Namensnennung–NichtKommerziell–KeineBearbeitung Österreich (CC BY- NC-ND) veröffentlicht – siehe http://creativecommons.org/licenses/by-nc-nd/ 3.0/at/. ii Erklärung Ich erkläre eidesstattlich, dass ich die vorliegende Arbeit selbstständig und ohne fremde Hilfe verfasst, andere als die angegebenen Quellen nicht benutzt und die den benutzten Quellen entnommenen Stellen als solche gekennzeich- net habe. Die Arbeit wurde bisher in gleicher oder ähnlicher Form keiner anderen Prüfungsbehörde vorgelegt. Hagenberg, am 3. Dezember 2012 Reinhard Buchinger iii Inhaltsverzeichnis Erklärung iii Kurzfassung vii Abstract viii 1 Einleitung 1 1.1 Motivation und Zielsetzung . .1 1.2 Inhaltlicher Aufbau . .2 2 Grundlagen 3 2.1 Gamification . .3 2.1.1 Verfolgte Ziele . .3 2.1.2 Geläufige Spielemechanismen . .4 2.1.3 Frühere Formen . .4 2.2 Apache Cassandra . .6 2.2.1 Datenmodell im Vergleich zu RDBMS . .6 2.2.2 Vorteile im Clusterbetrieb . .7 2.3 Apache ZooKeeper . .7 2.4 RabbitMQ . .9 2.5 Memcached . 10 2.6 Ruby . 11 2.6.1 JRuby . 11 2.6.2 Gems . 12 2.7 Domänenspezifische Sprachen . 14 2.7.1 Vorteile . 14 2.7.2 Nachteile . 15 2.7.3 DSL in Ruby . 15 2.8 runtastic . 15 2.8.1 Produktpalette . 16 2.8.2 Infrastruktur . 16 3 Verwandte Systeme und Anforderungen 19 3.1 Verwandte Systeme . 19 iv Inhaltsverzeichnis v 3.1.1 Gamification Systeme .
    [Show full text]
  • Snow Blocks Rescuers in West Coast Flood
    . ^ * A r t n g m Daflj Net PrcM Rim The Weather War tka Week Dniled r o n e u l of U. S. WeMher Were— Deeeilibee U , 1»M ' Fair, cidder tonight, low ih>-SS; 14,151 fair, HMIe temperature ehaiige to­ Memhnr at the Audit morrow, high in Ma. Poi ee u of ClreoUtion Manehe»ter^-^A CUy o f ViUage Charm VOL. LXXXIV, NO. 74 (TWENTY-FOUR PAGES—TWO SECTIONS) MANCHESTER, CONN., MONDAY, DECEMBER 28, 1964 (Claaslfied Advertialng on Page tZ) PRICE SEVEN CENTS Events In State Snow Blocks Rescuers State Denies Bus Request In West Coast Flood For Enfield --------- \ HARTFORD (A P )— The SAN FRANCISCO (AP)-*'n"t take off from Stead Alr^ Oregon reported 18 deaths<^day halted helicopter flights fa Stale has denied a bus Force Base in Nevada because from '1“flood '' action." " " — the area. The prediction was for — A heavy snowfall block of the storm. line’s request to serve En- ed flood relief flights in The Red Cross listed 16.300 contin\ied snow today. The turn to cold dropped the families as suffering major loss­ "W e’ll have to airlift supplies n iield commuters who work Northern California today snow level to 1,000 feet eleva­ es to homes, businesses or or evacuate soon.” Sowle said. in East Hartford but ap­ and prolonged the isolation tion. farms in Oregon, California, He called those isolated In the proved a similar request ordeal of sTOnded refugees The Columbia dropped enough Idaho and Washington, mountainous, heavily wooded from a competitor. into an eighth day.
    [Show full text]
  • Instant Messaging Video Converter, Iphone Converter Application
    Web Browsing Mozilla Firefox The premier free, open-source browser. Tabs, pop-up blocking, themes, and extensions. Considered by many to be the world's best browser. Download Page Video Player, Torrents, Podcasting Miro Beautiful interface. Plays any video type (much more than quicktime). Subscribe to video RSS, download, and watch all in one. Torrent support. Search and download from YouTube and others. Download Page IM - Instant Messaging Adium Connect to multiple IM accounts simultaneously in a single app, including: AOL IM, MSN, and Jabber. Beautiful, themable interface. Download Page Video Converter, iPhone Converter Miro Video Converter Convert any type of video to mp4 or theora. Convert any video for use with iPhone, iPod, Android, etc. Very clean, easy to use interface. Download Page Application Launching Quicksilver Quicksilver lets you start applications (and do just about everything) with a few quick taps of your fingers. Warning: start using Quicksilver and you won't be able to imagine using a Mac without it. Download Page Email Mozilla Thunderbird Powerful spam filtering, solid interface, and all the features you need. Download Page Utilities The Unarchiver Uncompress RAR, 7zip, tar, and bz2 files on your Mac. Many new Mac users will be puzzled the first time they download a RAR file. Do them a favor and download UnRarX for them! Download Page DVD Ripping Handbrake DVD ripper and MPEG-4 / H.264 encoding. Very simple to use. Download Page RSS Vienna Very nice, native RSS client. Download Page RSSOwl Solid cross-platform RSS client. Download Page Peer-to-Peer Filesharing Cabos A simple, easy to use filesharing program.
    [Show full text]
  • Carbon Copy Cloner Documentation: English
    Carbon Copy Cloner Documentation: English Getting started with CCC System Requirements, Installing, Updating, and Uninstalling CCC CCC License, Registration, and Trial FAQs Trouble Applying Your Registration Information? Establishing an initial backup Preparing your backup disk for a backup of Mac OS X Restoring data from your backup What's new in CCC Features of CCC specific to Lion and greater Release History Carbon Copy Cloner's Transition to a Commercial Product: Frequently Asked Questions Credits Example backup scenarios I want to clone my entire hard drive to a new hard drive or a new machine I want to backup my important data to another Macintosh on my network I want to backup multiple machines or hard drives to the same hard drive I want my backup task to run automatically on a scheduled basis Backing up to/from network volumes and other non-HFS volumes I want to back up my whole Mac to a Time Capsule or other network volume I want to defragment my hard drive Backup and archiving settings Excluding files and folders from a backup task Protecting data that is already on your destination volume Managing previous versions of your files Automated maintenance of CCC archives Advanced Settings Some files and folders are automatically excluded from a backup task The Block-Level Copy Scheduling Backup Tasks Scheduling a task and basic settings Performing actions Before and After the backup task Deferring and skipping scheduled tasks Frequently asked questions about scheduled tasks Email and Growl notifications Backing Up to Disk Images
    [Show full text]
  • Rubabel: Wrapping Open Babel with Ruby Rob Smith1*, Ryan Williamson1, Dan Ventura1 and John T Prince2*
    Smith et al. Journal of Cheminformatics 2013, 5:35 http://www.jcheminf.com/content/5/1/35 SOFTWARE Open Access Rubabel: wrapping open Babel with Ruby Rob Smith1*, Ryan Williamson1, Dan Ventura1 and John T Prince2* Abstract Background: The number and diversity of wrappers for chemoinformatic toolkits suggests the diverse needs of the chemoinformatic community. While existing chemoinformatics libraries provide a broad range of utilities, many chemoinformaticians find compiled language libraries intimidating, time-consuming, arcane, and verbose. Although high-level language wrappers have been implemented, more can be done to leverage the intuitiveness of object-orientation, the paradigms of high-level languages, and the extensibility of languages such as Ruby. We introduce Rubabel, an intuitive, object-oriented suite of functionality that substantially increases the accessibily of the tools in the Open Babel chemoinformatics library. Results: Rubabel requires fewer lines of code than any other actively developed wrapper, providing better object organization and navigation, and more intuitive object behavior than extant solutions. Moreover, Rubabel provides a convenient interface to the many extensions currently available in Ruby, greatly streamlining otherwise onerous tasks such as creating web applications that serve up Rubabel functionality. Conclusions: Rubabel is powerful, intuitive, concise, freely available, cross-platform, and easy to install. We expect it to be a platform of choice for new users, Ruby users, and some users of current solutions. Keywords: Chemoinformatics, Open Babel, Ruby Background tasks. Though it allows the user to access the functionality Despite the fact that chemoinformatics tools have been of the component libraries from one Python script, Cin- developed since the late 1990s [1], the field has yet to fony does not automatically manage underlying data types rally in support of a single library.
    [Show full text]
  • UNIVERSITY of CALIFORNIA, SAN DIEGO Toward Understanding And
    UNIVERSITY OF CALIFORNIA, SAN DIEGO Toward Understanding and Dealing with Failures in Cloud-Scale Systems A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Computer Science by Peng Huang Committee in charge: Professor Yuanyuan Zhou, Chair Professor Tara Javidi Professor Ranjit Jhala Professor George Porter Professor Stefan Savage 2016 Copyright Peng Huang, 2016 All rights reserved. The Dissertation of Peng Huang is approved and is acceptable in quality and form for publication on microfilm and electronically: Chair University of California, San Diego 2016 iii DEDICATION To my parents, brother and fiancée for their unconditional love and support. iv EPIGRAPH Quis custodiet ipsos custodes? (But who can watch the watchmen?) Juvenal Anything that can go wrong, will go wrong. Murphy’s law Those who fail to learn from the mistakes are doomed to repeat them. George Santayana In the middle of the night, [...] He would awaken and find himeself wondering if one of the machines had stopped working for some new, unknown reason. Or he would wake up thinking about the latest failure, the one whose cause they’d been looking for a whole week and sitll hadn’t found. The bogeyman—la machine—was there in his bedroom. Tracy Kidder, The Soul of a New Machine v TABLE OF CONTENTS SignaturePage...................................... .................. iii Dedication ......................................... .................. iv Epigraph........................................... .................. v TableofContents
    [Show full text]
  • Ichat DEMO + Q&A!!
    The Newsletter for Sonoma County’s Mac and Windows Users March 2009 Vol .1 No 3 iCHAT DEMO + Q&A!! Date: Saturday, 2/14/2009 Place: Sonoma Public Library Time: 9 am to noon 755 West Napa Street Table of Contents User Group Benefits . 2 Add New Locations to iMovie ‘09 . 24 iCHAT - March Meeting Demo . 3 iBank Finance Software Review . 26 Pumped About Painter . 6 Mac Book Recommendations . 27 Finding E-Mail Easily with Flags . .11 Online Photo Storage Tip . 13 Mac Q&A at 9 a.m. Slow Mail Delete . 13 iCHAT demo at 9:30 a.m. Adobe Acrobat Reader Problem . 14 Office Type Program Recommendations . 14 SEE YOU SATURDAY Making the Move to Mac Easier . 15 You are welcome to bring coffee, tea, Search Tips . 15 snacks for yourself or to share! Using Disk Utility to Encyrpt Files . 16 Invite a friend. 1 Extracting Audio from Movies with iLife . 17 1 REMINDER: time to pay DUES! Troubleshooting OS X Startups . 20 Sonoma Valley DONATING USED Computer Group COMPUTER EQUIPMENT OFFICERS FOR 2008 - 2009 President Beth Pickering The URL listed is for the Computer Recycling Center. All of the [email protected] info needed (and then some) is listed on the site. Secretary Kathy Aanestad http://www.crc.org/ [email protected] Treasurer Joan Fabian SVCG USER GROUP [email protected] Newsletter Kathy Aanestad BENEFITS & DISCOUNTS [email protected] Members-at-Large George Pick O’REILLY [email protected] Members receive a 20% discount on O'Reilly books and conferences. Elizabeth Palmer Contact Kathy for the code.
    [Show full text]
  • Hbase: the Definitive Guide
    HBase: The Definitive Guide HBase: The Definitive Guide Lars George Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo HBase: The Definitive Guide by Lars George Copyright © 2011 Lars George. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editors: Mike Loukides and Julie Steele Indexer: Angela Howard Production Editor: Jasmine Perez Cover Designer: Karen Montgomery Copyeditor: Audrey Doyle Interior Designer: David Futato Proofreader: Jasmine Perez Illustrator: Robert Romano Printing History: September 2011: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. HBase: The Definitive Guide, the image of a Clydesdale horse, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-39610-7 [LSI] 1314323116 For my wife Katja, my daughter Laura, and son Leon.
    [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]
  • Prioritizing Pull Requests
    Prioritizing pull requests Version of June 17, 2015 Erik van der Veen Prioritizing pull requests THESIS submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in COMPUTER SCIENCE by Erik van der Veen born in Voorburg, the Netherlands Software Engineering Research Group Q42 Department of Software Technology Waldorpstraat 17F Faculty EEMCS, Delft University of Technology 2521 CA Delft, the Netherlands The Hague, the Netherlands www.ewi.tudelft.nl www.q42.com c 2014 Erik van der Veen. Cover picture: Finding the pull request that needs the most attention. Prioritizing pull requests Author: Erik van der Veen Student id: 1509381 Email: [email protected] Abstract Previous work showed that in the pull-based development model integrators face challenges with regard to prioritizing work in the face of multiple concurrent pull requests. We identified the manual prioritization heuristics applied by integrators and ex- tracted features from these heuristics. The features are used to train a machine learning model, which is capable of predicting a pull request’s importance. The importance is then used to create a prioritized order of the pull requests. Our main contribution is the design and initial implementation of a prototype service, called PRioritizer, which automatically prioritizes pull requests. The service works like a priority inbox for pull requests, recommending the top pull requests the project owner should focus on. It keeps the pull request list up-to-date when pull requests are merged or closed. In addition, the service provides functionality that GitHub is currently lacking. We implemented pairwise pull request conflict detection and several new filter and sorting options e.g.
    [Show full text]
  • Debugging at Full Speed
    Debugging at Full Speed Chris Seaton Michael L. Van De Vanter Michael Haupt Oracle Labs Oracle Labs Oracle Labs University of Manchester michael.van.de.vanter [email protected] [email protected] @oracle.com ABSTRACT Ruby; D.3.4 [Programming Languages]: Processors| Debugging support for highly optimized execution environ- run-time environments, interpreters ments is notoriously difficult to implement. The Truffle/- Graal platform for implementing dynamic languages offers General Terms an opportunity to resolve the apparent trade-off between Design, Performance, Languages debugging and high performance. Truffle/Graal-implemented languages are expressed as ab- Keywords stract syntax tree (AST) interpreters. They enjoy competi- tive performance through platform support for type special- Truffle, deoptimization, virtual machines ization, partial evaluation, and dynamic optimization/deop- timization. A prototype debugger for Ruby, implemented 1. INTRODUCTION on this platform, demonstrates that basic debugging services Although debugging and code optimization are both es- can be implemented with modest effort and without signifi- sential to software development, their underlying technolo- cant impact on program performance. Prototyped function- gies typically conflict. Deploying them together usually de- ality includes breakpoints, both simple and conditional, at mands compromise in one or more of the following areas: lines and at local variable assignments. The debugger interacts with running programs by insert- • Performance: Static compilers
    [Show full text]
  • James Reynolds What Is a Ruby on Rails Why Is It So Cool Major Rails Features Web Framework
    Ruby On Rails James Reynolds What is a Ruby on Rails Why is it so cool Major Rails features Web framework Code and tools for web development A webapp skeleton Developers plug in their unique code Platforms Windows Mac OS X Linux Installation Mac OS X 10.5 will include Rails Mac OS X 10.4 includes Ruby Most people reinstall it anyway From scratch Drag and drop Locomotive Databases Mysql Oracle SQLite Firebird PostgreSQL SQL Server DB2 more Webservers Apache w/ FastCGI or Mongrel LightTPD WEBrick "IDE's" TextMate and Terminal (preferred) RadRails jEdit Komodo Arachno Ruby Has "inspired" Grails CakePHP Trails PHP on TRAX Sails MonoRail Catalyst TrimPath Junction Pylons WASP ColdFusion on Wheels And perhaps more... Why is it so cool? Using the right tool for the job y = x^2 vs y = x^0.5 Right tool Rails is the most well thought-out web development framework I've ever used. And that's in a decade of doing web applications for a living. I've built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before. James Duncan Davidson, Creator of Tomcat and Ant y = x ^ 2 vs y = x ^ 0.5 Features Features Work Work Typical Rare y = x ^ 2 vs y = x ^ 0.5 Feature ceiling Features Features Work Work This is a no-brainer... Ruby on Rails is a breakthrough in lowering the barriers of entry to programming. Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days.
    [Show full text]