Copyrighted Material

Total Page:16

File Type:pdf, Size:1020Kb

Copyrighted Material 25_081204 bindex.qxp 11/30/06 11:15 PM Page 315 Index :adapter value, 186 • Symbols • Add Interpreter dialog box, 34 && (and) operator, 96 add_comment method, 241 = (assignment) operator, 96 add_keyword method, 253 @ (at sign), instance variables, 114 add_some_keywords form, 254–255 backslash (\), referring to branches, 80 agile activity, 13 ~ ( bit inversion) operator, 91 agile development, 12, 294 [] (brackets), 102, 285 Agile Manifesto, 12 == (comparison) operator, 96 agilealliance.com Web site, 282 { } (curly braces), 122, 285 agilemanifesto.org Web site, 282 <div>. .</div> element, 262 Ajax (Asynchronous JavaScript and XML) ** (exponentiation) operator, 91 introduction, 258 % (modulo) operator, 91 Rails pages, 258–262 ! (not) operator, 96 XMLHttpRequest object, 258 || (or) operator, 96 album2_development, 220 + (overloaded) operator, 92 alignment, using tables for, 142–143 # (pound sign), 90, 197 anchor element, start and end tags ? (question mark), 146 (HTML), 136, 209, 210 “ “ (quotation marks), 94 and (&&) operator, 96 << (shifting) operator, 91 applications, 50 >> (shifting) operator, 91 area, workbench, 67 <%= %> tag, ERb, 168 Array class, 123 <=> (three-way comparison) operator, 91 arrays hotel guest tracking code, 100 indices, 101 • A • introduction, 100 \a escape sequence, 94 loops, 101 absolute names, files, 141 size, 101 Access databases, 36COPYRIGHTEDvalues, MATERIAL 101 ActionMailer: assigning values, 94–95 :Base.server_settings, 265 assignment (=) operator, 96 ActionView: :Helpers module, 201 Asynchronous JavaScript and XML Active Record, 184–185, 295 (Ajax) ActiveRecord: :Base class, 184 introduction, 258 activerecord gem, 185 Rails pages, 258–262 ActiveRecord module, 184–185 XMLHttpRequest object, 258 25_081204 bindex.qxp 11/30/06 11:15 PM Page 316 316 Ruby on Rails For Dummies at sign (@), instance variables, 114 class methods, 187 automatic rendering, 166 classes ActiveRecord: :Base, 184 Array, 123 • B • databases, 116 backslash (\), referring to branches, 80 defining, 114 Beginning Programming with Java For defining, code, 113 Dummies (Burd), 4 instances, 114 belongs_to method, 237 Integer, 121 bit inversion (~) operator, 91 introduction, 113 blocks mailer, 266 curly braces ({}), 122 open, 123, 285–286 overview, 287–288 Photo, 179 blog subclasses, 124–126 comments, 237–242 TimeServiceController, 272 introduction, 233 client computer, 129 keywords, 243–255 close button, 69 visitor input validation, 235–237 collections, iterators, 118 @body assignments, e-mail, 267 collection_select method, 252, 253 borders, invisible, 142 columns brackets ([]), 102, 285 creating, 60 built-in unit testing, 290–291 databases, creating, 180 Burd, Barry (Beginning Programming with date_created, 188 Java For Dummies), 4 headings, displaying, 187–188 id columns, 198–200 names, 60 • C • types, 60 calling, methods, 118 columns method, 187 case-sensitivity, 93, 138 commands, puts, 164 catalogs Comment model, dreaming project, 239 introduction, 48 comments mysql, 47 add_comment method, 241 test, 47 dream blog, 237–242 check boxes HTML, 139 code example, 151 introduction, 90 HTML forms, 151 comparison (==) operator, 96 keywords, 254–255 compiled languages, 15–16 check_box method, 254 concatenation, 92 checkout method, 148 configuration chevron, 70 convention over, 18, 161–162, 294 chomp method, 196 RadRails, 33–36 class keyword, 97 25_081204 bindex.qxp 11/30/06 11:15 PM Page 317 Index 317 configuration files, 17 databases. See also legacy databases configure-service mode, 43 Access, 36 connect method, 311 columns, creating, 180 connections, databases connecting to, 185–187 connecting to, 185–187 connection, troubleshooting, 41–45 troubleshooting, 41–45 creating, 47–50 console, sending text to, 163–165 fields, 38 Console view introduction, 12 introduction, 57 modifying, 188–191 puts command, 164 rows, adding, 194–195 running application, 81 rows, deleting, 193 Container field, 77 rows, displaying, 183 containers, 77 rows, finding, 195–197 controllers servers, 38 creating, 157–159 servers, troubleshooting, 42–43 names, overriding legacy, 303 tables, classes, 116 overview, 156–157 tables, creating, 58–61, 179 values, passing to views, 167–173 tables, creating (code example), 180 views, 167–173 tables defined, 38 convention over configuration, 18, tables, enhancing code, 228 161–162, 294 tables, names, overriding legacy, counting coins program, 93 301–303 covert tricks, 170 tables, objects and, 116 create method, 195, 230 traveling, 42 Create New Schema dialog box, 49 version numbers, 190–191 Create Shortcut wizard, 30 date_created column, 188 create_setup method, 266 DB2, 36 CRUD (Create, Read, Update, Destroy) db:migrate task, 180 operations decide_about method, 111 databases, 66 declarations, HTML, 139 inherited methods, 179 def_show, 161 overview, 296 delete method, 123, 148 .csv files, 36 delete_all method, 193 curly braces ({}), 122, 285 deployment, 130 desktop, shortcuts, RadRails, 30 destroy_all method, 193 • D • dialog boxes data, displaying, 187–188 Add Interpreter, 34 Data perspective, 72 Create New Schema, 49 :database value, 186 New File, 182 New Project, 51 25_081204 bindex.qxp 11/30/06 11:15 PM Page 318 318 Ruby on Rails For Dummies dialog boxes (continued) else keyword, 97 New Rails Project, 52 elseif keyword, 97 Preferences, 83–84 e-mail Select a Wizard, 76 @body assignments, 267 Select Perspective, 72 cordial but forceful message, 267 Show View, 74 enabled Web site, 264 Windows Security Alert, 54 mail servers, 263 Workspace Launcher, 32 mailer class, code, 266 DIRT operations, 66 mailer configuration, 264–265 Disable Table Pluralization option, Mailer configuration code, 264 305–306 mailing messages, 265–269 display_cart, 165 mailing messages, code example, 265 displaying messages, 264 data, 187–188 messages, code example, 264 images, 140–141 empty tags (HTML), 137–138 values, 94 end keyword, 97 <div>. .</div> element, 262 end tags (HTML), 136–137 do keyword, 97 enhancing code DOCTYPE declaration (HTML), 139 database table, 228 Don’t Repeat Yourself (DRY), 18, 19, file input field, 228–230 162–163, 293 images, 230 Download link, interpreter, 22 entities (HTML), 138–139 downloads, MySQL Administrator, 40 environment, server, 312–314 Dream model, 234, 247 environment.rb file, 265 dreaming_development database, 234 ERb tags, 205–206 dreams_keywords table, 246 escape sequence, 94 drop-down lists establish_connection method, 185 keywords, 252 exponentiation (**) operator, 91 populating, 180 expressions DRY (Don’t Repeat Yourself), 18, 19, interpolated, 92 162–163, 293 introduction, 91 duck typing, 286 regular expressions, 243 dynamic typing, 14–15 ternary, 99 extensions, filenames, 29 • E • each iterator, 192 • F • each method, 118–120 false keyword, 97 each_plus_interest method, 123 fields editing, files, 80–81 databases, 38 editor, workbench, 68 hidden (HTML), 152 elements (HTML), 137 filenames, extensions, 29 25_081204 bindex.qxp 11/30/06 11:15 PM Page 319 Index 319 files gif files, 140 absolute names, 141 Google search engine, 145 class files, 81 configuration files, 17 editing, 80–81 • H • importing easy way, 214–215 habtm (has_and_belongs_to_many) importing geeky way, 216–218 relationship, 244 importing, Import Wizard, 216–218 hashes relative names, 140 [] (brackets), 102, 285 renaming, 159–161 {} (curly braces), 285 fill method, 123 code example, 102 find method, 187, 195 entries, 102 find_by_sql method, 198 format string, 103 Firebird, 36 loops, 103 flow of photo album application, 226–227 passing to methods, 108–109 folders, workspace, 32 has_many :comments, 241 for loop, 99 hidden fields (HTML), 152 form elements (HTML) host computer, 130 check boxes, 151 :host value, 186 fields, hidden, 152 hostingrails.com Web site, 282 text areas, 147–149 href attribute, start tags (HTML), 136 forms HTML (hypertext markup language) add_some_keywords, 254–255 anchor elements, 209 HTML, 144–146 check boxes, 151 parameters, 172–173 comments, 139 frameworks, 13 declarations, 139 DOCTYPE declaration, 139 elements, 137 • G • empty tags, 136–137 gem end tags, 136–137 installer, 27 entities, 138–139 session, 27 fields, hidden, 152 gems, activerecord, 185 form elements, 147–152 Generators view forms, 144–146 creating projects, 78–79 forms, text field code example, 144 model creation, 57 image elements, 140–141, 231–232 options, 56 introduction, 134–136 scaffolds, 61 link_to method, 209 get method, 148 option selectors, 149–150 get_picture method, 221, 232 paired tags, 137–138 gets method, 96–97, 196 permissiveness, 138 get_time method, 271, 273 25_081204 bindex.qxp 11/30/06 11:15 PM Page 320 320 Ruby on Rails For Dummies HTML (hypertext markup language) importing files (continued) easy way, 214–215 simple code example, 132 Import wizard, 216–218 start tags, 136 inheritance table, code example, 142 CRUD operations, 179 table header elements, 143 Photo class, 179 tables, 142–143 subclasses, 124 tag example code, 134–135 initialize method, 115 text area creation code example, 147 input text field, 146 keyboard, 96–97 Web pages, 132–133 validating, 235–237 HTML-safe method, 209 validating, code example, 235 HTTP (hypertext transfer protocol) insert method, 123 description, 131 installation methods, 148–149 components, 23 transactions, 131 gem, 27 hypertext markup language. See HTML interpreter, 22–26 irb, 25 Java, 27–28 • I • MySQL, 36–39 id numbers, 198–200 MySQL Administrator, 40–45 IDE (integrated development RadRails, 28–36 environment), 27 RadRails, troubleshooting, 33 idempotence, 148–149 Rails, 26–27 if keyword, 97 set path,
Recommended publications
  • Product End User License Agreement
    END USER LICENSE AGREEMENT If you have another valid, signed agreement with Licensor or a Licensor authorized reseller which applies to the specific Licensor Software, Software Services, Maintenance or Consulting Services you are downloading, accessing or otherwise receiving, that other agreement shall control; otherwise by using, downloading, installing, copying, or accessing Licensor Software, Software Services, Maintenance or Consulting Services, or by clicking on "I accept" on or adjacent to the screen where these Master Terms may be displayed, you hereby agree to be bound by and accept these Master Terms. These Master Terms shall also apply to any Maintenance or Consulting Services you later acquire from Licensor relating to the Software or Software Services. You may place orders under these Master Terms by submitting separate Order Form(s). Capitalized terms used in these Master Terms and not otherwise defined, are defined at https://terms.tibco.com/posts/845635-definitions. 1. License Models, License Grant, Rights and Restrictions. Licensor provides Software on a Perpetual, or Term basis, embedded and delivered as part of Equipment, as Software Services and on a Subscription basis. The Supplemental Terms, include, but are not limited to, the license grant, rights and restrictions for each of the foregoing (including for evaluation purposes) which are located at https://terms.tibco.com. The availability of Software in one or more of the foregoing license models is at Licensor's sole discretion. Additional license requirements and notices, if any, if not included at https://terms.tibco.com, shall be contained in the Documentation that is delivered with the applicable Software.
    [Show full text]
  • Rails 4 En Windows Y Linux Ubuntu – V 1.0.5 Beta – Pag 1/200 - Actualizado Al 7/10/ 2016 Sergio A
    Sergio A. Alonso - Rails 4 en Windows y Linux Ubuntu – v 1.0.5 Beta – pag 1"#00 - a$tuali%ado al &"10" 201' Sergio A. Alonso - Rails 4 en Windows y Linux Ubuntu – v 1.0.5 Beta – pag #"#00 - a$tuali%ado al &"10" 201' ¡Ud podría estar leyendo una copia vieja! ()equee la versión en el en$abe%ado de las )o,as- $ontra la última en el sitio o.$ial- )tt!/""r0uw.)ero1u.$o2 3esde allí en$ontrará el vín$ulo )acia la versión 2as actual- y un listado 2uy útil de erratas- $orrec$iones- e in$luso una sec$ión donde !ostear errores y sugeren$ias. Este libro es tan gratis como una cerveza (free-as-a-beer) (uente sie2!re con la 6ltima versión dis!onible en P38. Mi ob,etivo es que lo lea la mayor cantidad posible de personas, y que éstas me retornen sus im!resiones, errores encontrados y sugerencias en general. De he$ho, ne$esito de estos re!ortes para obtener un nivel a!re$iable de $alidad, tal *ue el libro sea digno de ser llevado a una im!renta. Una ve% que el libro este listo, pretendo seguir de,5ndolo libre, publicarlo en la editorial Bubok ;i2!resión a de2anda<- y *uedar2e como mu$ho con u=s 5 de regalías por libro... al menos para ha$erle creer a mi es!osa que hago dinero con esto. Creo que si el libro lo mere$e, la gente se cansar5 de leerlo en !antalla- y querr5 tener un e,e2!lar en pa!el.
    [Show full text]
  • Roles in a Networked Software Development Ecosystem: a Case Study in Github Patrick Wagstrom IBM TJ Watson Research Center Hawthorne, NY, [email protected]
    University of Nebraska - Lincoln DigitalCommons@University of Nebraska - Lincoln CSE Technical reports Computer Science and Engineering, Department of 2012 Roles in a Networked Software Development Ecosystem: A Case Study in GitHub Patrick Wagstrom IBM TJ Watson Research Center Hawthorne, NY, [email protected] Corey Jergensen University of Nebraska-Lincoln, [email protected] Anita Sarma University of Nebraska-Lincoln, [email protected] Follow this and additional works at: http://digitalcommons.unl.edu/csetechreports Wagstrom, Patrick; Jergensen, Corey; and Sarma, Anita, "Roles in a Networked Software Development Ecosystem: A Case Study in GitHub" (2012). CSE Technical reports. 149. http://digitalcommons.unl.edu/csetechreports/149 This Article is brought to you for free and open access by the Computer Science and Engineering, Department of at DigitalCommons@University of Nebraska - Lincoln. It has been accepted for inclusion in CSE Technical reports by an authorized administrator of DigitalCommons@University of Nebraska - Lincoln. Roles in a Networked Software Development Ecosystem: A Case Study in GitHub Patrick Wagstrom Corey Jergensen, Anita Sarma IBM TJ Watson Research Center Computer Science and Engineering Department 19 Skyline Dr University of Nebraska, Lincoln Hawthorne, NY, USA 10532 Lincoln, NE, USA 68588 [email protected] {cjergens,asarma}@cse.unl.edu ABSTRACT tiple languages and utilizing multiple different development Open source software development has evolved beyond single frameworks and libraries, For example, development of a web projects into complex networked ecosystems of projects that application may use the JavaScript library jQuery for the user share portions of their code, social norms, and developer commu- interaction, Ruby on Rails for the backend processing, and Rack nities.
    [Show full text]
  • Extending Facter and Puppet
    Pro Puppet James Turnbull Jeffrey McCune Pro Puppet Copyright © 2011 by James Turnbull and Jeffrey McCune All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN 978-1-4302-3057-1 ISBN 978-1-4302-3058-8 (eBook) Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Frank Pohlmann Technical Reviewer: Jessica Fraser Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Anita Castro Copy Editor: Seth Kline Compositor: Bytheway Publishing Services Indexer: John Collin Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013.
    [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]
  • 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]
  • The Ruby Programming Language... It's Really Fun and It Feels Good!
    The Ruby Programming Language... it's really fun and it feels good! Dr. John Pagonis Pragmaticomm Limited, Athens Ruby Meetup #9, March 31st 2012 twitter: @greekrubymeetup @johnpagonis 1 1 Menu Why I got into Ruby? In search of a better way to code Ruby in twenty minutes (or thereabouts:-)‏ Why we should all have a look at it? 2 2 Before we start… a word ! A reminder from Fred. P. Brooks ‘’ No Silver Bullet - essence and accidents of software engineering’’,1986 ! ! There is NO silver bullet! 3 3 My experience with Ruby (mostly First got involved in 'Skunkworks' while at Symbian :-)‏ Ported with Pragmaticomm the Ruby 1.9.0.0 and Ruby 1.9.1p1 VM and some extensions to Symbian OS v9.1 (for Nokia's Symbian Research dept.)‏ I've used it for mobile programming, text filtering, classification, Web apps, machine learning, database access and Genetic Algorithm related work 4 4 Lately in my life (does it look familiar to you?)‏ There is a a lot of stuff I need to automate There are a lot of stuff I want to develop There are a lot of platforms I need to be using I need to be more efficient when coding. I have realised that my time and memory is MUCH more expensive than my CPUs’ time and RAM. I haven’t been getting any younger I haven’t been getting much smarter :-)‏ I think faster than I code! I am running out of time…. 5 5 Consequently Life is too short, to not have fun… !! ! I have to cheat! !There must be a better way to program… there must be!! 6 6 There must be a better way to program… there must be!! ..to clarify that !There must be a much better
    [Show full text]
  • Rubywrite: a Ruby-Embedded Domain-Specific Language for High-Level Transformations
    RubyWrite: A Ruby-Embedded Domain-Specific Language for High-Level Transformations Andrew Keep, Arun Chauhan, Chun-Yu Shei, and Pushkar Ratnalikar Indiana University, Bloomington, IN 47405, USA fakeep,achauhan,cshei,[email protected] Abstract. We introduce a Domain Specific Language (DSL), called RubyWrite, embedded within Ruby, with the goal of providing an ex- tensible, effective, portable, and easy to use framework for encoding source-level transformations. Embedding within Ruby provides access to the powerful features of Ruby, including its purely object-oriented design and meta-programming capabilities. The syntactic flexibility and advanced language features of Ruby drove our choice of it as the host lan- guage. Easy integration of external C interfaces seamlessly within Ruby lets us move performance critical operations to C, or link with external libraries. RubyWrite was developed to aid our compiler research where it provides the core of three compiler infrastructure development projects, and is used as a teaching aid in a graduate-level compilers course. We expect RubyWrite to be widely applicable and a proof of concept in leveraging an existing modern language to write a portable compiler in- frastructure core. 1 Introduction We describe a Domain Specific Language (DSL), embedded within Ruby, aimed at simplifying the task of source-level transformations through term-rewriting. The DSL, called RubyWrite, is motivated by the need for a compiler development environment that allows easy integration of source-level transformations with program analysis. After spending frustrating months trying to develop a compiler for matlab in C++ a few years ago, we made the decision to move to a domain-specific lan- guage for compiler development.
    [Show full text]
  • An Introduction to Ruby and Rails
    An Introduction to Ruby and Rails This paper was originally presented at the Southwest Fox conference in Gilbert, Arizona in October, 2010. http://www.swfox.net An Introduction to Ruby and Rails Rick Borup Information Technology Associates 701 Devonshire Dr, Suite 127 Champaign, IL 61820 Voice: (217) 359-0918 Fax: (217) 398-0413 Email: [email protected] Ruby is a powerful, object-oriented, open-source language with a clean and easily understandable syntax. Originally released to the public in 1995, wide-spread interest in the Ruby language really began to take off in 2003 with the release of the Ruby on Rails® framework. Also known as "RoR" or simply "Rails", Ruby on Rails is an open-source Web framework that makes it possible to quickly and easily create data-based Web applications. Together, the Ruby language and the Ruby on Rails framework can become an exciting and powerful addition to any developer's toolbox. This session introduces both the Ruby language and the Rails framework, focusing on their installation and use on a Windows® platform with a perspective geared toward experienced Visual FoxPro® developers. © 2010 Rick Borup Page 1 of 64 An Introduction to Ruby and Rails Table of Contents Introduction............................................................................................................................................................ 4 Installing Ruby and Rails on Windows......................................................................................................... 4 Installing Instant Rails
    [Show full text]
  • An Empirical Study of Static Typing in Ruby
    Work In Progress: an Empirical Study of Static Typing in Ruby Mark T. Daly Vibha Sazawal Jeffrey S. Foster University of Maryland, College Park fmdaly,vibha,[email protected] Abstract tural object types, and optional and variable type lists for In this paper, we present an empirical pilot study of four method signatures. Prior experience shows that DRuby finds skilled programmers as they develop programs in Ruby, a errors in a range of existing Ruby programs, when used by popular, dynamically typed, object-oriented scripting lan- DRuby’s authors [Furr et al. 2009b,a]. In our study, we aim guage. Our study compares programmer behavior under the to understand whether DRuby’s static type system actually standard Ruby interpreter versus using Diamondback Ruby helps typical Ruby programmers find and fix errors—if not, (DRuby), which adds static type inference to Ruby. The aim why not, and if so, how could we improve DRuby’s type of our study is to understand whether DRuby’s static typing system to better serve programmers’ needs? is beneficial to programmers. We found that DRuby’s warn- Based on qualitative analysis of participant experiences, ings rarely provided information about potential errors not we made three tentative findings. First, using an open coding already evident from Ruby’s own error messages or from technique [Strauss 1987] to classify DRuby error messages presumed prior knowledge. We hypothesize that program- produced during participant trials, we found that under 20% mers have ways of reasoning about types that compensate of DRuby’s error messages were informative. Second, in in- for the lack of static type information, possibly limiting terviews, participants reported that they did use types as part DRuby’s usefulness when used on small programs.
    [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]
  • Ruby Programming
    Ruby Programming Wikibooks.org December 1, 2012 On the 28th of April 2012 the contents of the English as well as German Wikibooks and Wikipedia projects were licensed under Creative Commons Attribution-ShareAlike 3.0 Unported license. An URI to this license is given in the list of figures on page 249. If this document is a derived work from the contents of one of these projects and the content was still licensed by the project under this license at the time of derivation this document has to be licensed under the same, a similar or a compatible license, as stated in section 4b of the license. The list of contributors is included in chapter Contributors on page 243. The licenses GPL, LGPL and GFDL are included in chapter Licenses on page 253, since this book and/or parts of it may or may not be licensed under one or more of these licenses, and thus require inclusion of these licenses. The licenses of the figures are given in the list of figures on page 249. This PDF was generated by the LATEX typesetting software. The LATEX source code is included as an attachment (source.7z.txt) in this PDF file. To extract the source from the PDF file, we recommend the use of http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ utility or clicking the paper clip attachment symbol on the lower left of your PDF Viewer, selecting Save Attachment. After extracting it from the PDF file you have to rename it to source.7z. To uncompress the resulting archive we recommend the use of http://www.7-zip.org/.
    [Show full text]