• Complain

Michael James Fitzgerald - Ruby Pocket Reference

Here you can read online Michael James Fitzgerald - Ruby Pocket Reference full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2007, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover

Ruby Pocket Reference: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Ruby Pocket Reference" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Although Ruby is an easy language to learn, in the heat of action you may find that you cant remember the correct syntax for a conditional or the name of a method. This handy pocket reference offers brief yet clear explanations of Rubys core components, from operators to reserved words to data structures to method syntax, highlighting those key features that youll likely use every day when coding Ruby.
Whether youve come to Ruby because of the Rails web development framework --Rubys killer app -- or simply because its a relatively clean, powerful and expressive language thats useful for a lot of applications, the Ruby Pocket Reference is organized to help you find what you need quickly. This book not only will get you up to speed on how Ruby works, it provides you with a handy reference you can use anywhere, anytime.
In this book, you find essential information on:

  • Reserved words, operators, comments, numbers, variables, ranges, and symbols
  • Predefined variables andglobal constants
  • Conditional statements, method use, classes, and modules (mixins)
  • Lists of methods from the Object, String, Array, and Hash classes and the Kernel module
  • sprintf andtime formatting directories
  • Interactive Ruby (irb) and the Ruby debugger
  • Ruby documentation
You also get information on the RubyGems package utility and Rake, a build tool similar to make.. If youre using Ruby daily and just want the facts-fast-Ruby Pocket Reference is your book.

Michael James Fitzgerald: author's other books


Who wrote Ruby Pocket Reference? Find out the surname, the name of the author of the book and a list of all author's works by series.

Ruby Pocket Reference — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Ruby Pocket Reference" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Ruby Pocket Reference
Michael Fitzgerald
Editor
Simon St. Laurent

Copyright 2009 Michael Fitzgerald

OReilly Media SPECIAL OFFER Upgrade this ebook with OReilly for more - photo 1

O'Reilly Media

SPECIAL OFFER: Upgrade this ebook with OReilly

for more information on this offer!

Please note that upgrade offers are not available from sample content.

Chapter 1. Ruby Pocket Reference

Ruby is an open source, object-oriented programming language created by Yukihiro "Matz" Matsumoto. First released in Japan in 1995, Ruby has gained worldwide acceptance as an easy-to-learn, powerful, and expressive language, especially since the advent of Ruby on Rails, a web application framework written in Ruby (http://www.rubyonrails.org). Ruby's core is written in the C programming language and runs on all major platforms. It is an interpreted rather than compiled language. For more information on Ruby, see http://www.ruby-lang.org.

Conventions Used in This Book

The following font conventions are used in this book:

Italic

Indicates pathnames and filenames (such as program names); Internet addresses, such as domain names and URLs; and emphasized or newly defined terms.

Constant width

Indicates commands and options that should be typed verbatim in a file or in irb ; or names and keywords in Ruby programs, including method, variable, and class names.

Constant width italic

Indicates user-supplied values.

Constant width bold

Used to draw attention to parts of programs.

Comments and Questions

Please address comments and questions concerning this book to the publisher:

O'Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (Fax)

There is a web page for this book, which lists errata, examples, or any additional information. You can access this page at:

http://www.oreilly.com/catalog/9780596514815

To comment or ask technical questions about this book, send email to:

For information about books, conferences, Resource Centers, and the O'Reilly Network, see the O'Reilly web site at:

http://www.oreilly.com
Acknowledgments

This book is dedicated to John H. Atkinson, Jr. (19342007).

I want to thank Simon St.Laurent, Ryan Waldron, and Rachel Monaghan for their help in creating, editing, and producing this book.

Running Ruby

Test to see whether Ruby is running on your computer by typing the following at a shell or command prompt:

ruby --version

An affirmative response will look similar to this (this example is for version 1.8.6 running on Mac OS X):

ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]

You can install Ruby on any of the major platforms. For Ruby file archives and installation instructions, see http://www.ruby-lang.org/en/downloads.

Running the Ruby Interpreter

Usage:

ruby [switches] [--] [program filename] [arguments]

Switches (or command-line options):

-0[octal]

Specify a record separator (\0 if no argument).

-a

Autosplit mode with -n or -p (splits $_ into $F).

-c

Check syntax only.

-Cdirectory

cd to directory before executing your script or program.

-d

Set debugging flags (set predefined variable $DEBUG to true).

-e 'command'

Execute one line of script. Several -es allowed. Omit [program filename].

-Fpattern

split( ) pattern for autosplit (-a).

-i[extension]

Edit ARGV files in place (make backup if extension supplied).

-Idirectory

Specify $LOAD_PATH (predefined variable) directory; may be used more than once.

-Kkcode

Specify the character set. See .

-l

Enable line-ending processing.

-n

Assume 'while gets( ); ... end' loop around your script.

-p

Assume loop like -n but print line also like sed.

-rlibrary

Require the library before executing your script.

-s

Enable some switch parsing for switches after script name.

-S

Look for the script using PATH environment variable.

-T[level]

Turn on tainting checks.

-v

Print version number, then turn on verbose mode (compare --version).

-w

Turn warnings on for your script or program.

-W[level]

Set warning level: 0=silence, 1=medium, and 2=verbose (default).

-x[directory]

Strip off text before #! shebang line, and optionally cd to directory.

--copyright

Print the copyright.

--version

Print the version (compare -v).

Using a Shebang Line on Unix/Linux

A shebang line may appear on the first line of a Ruby program (or other program or script). Its job is to help a Unix/Linux system execute the commands in the program or script according to a specified interpreterRuby, in our case. (This does not work on Windows.) Here is a program named hi.rb with a shebang on the first line:

#!/usr/bin/env rubyputs "Hello, Matz!"

Other alternative shebang lines are #!/usr/bin/ruby or #!/usr/local/bin/ruby. With a shebang in place, you can type the filename (followed by Return or Enter) at a shell prompt without invoking the Ruby interpreter directly:

$ hi.rb
Associating File Types on Windows

Windows doesn't know or care about shebang (#!), but you can achieve a similar effect by creating a file type association with the assoc and ftype commands on Windows (DOS). To find out whether an association exists for the file extension .rb, use the assoc command:

C:\Ruby Code>assoc .rbFile association not found for extension .rb

If it's not found, associate the .rb extension with a file type:

C:\Ruby Code>assoc .rb=rbFile

Then test to see whether the association exists:

C:\Ruby Code>assoc .rb.rb=rbFile

Now test to see whether the file type for Ruby exists:

C:\Ruby Code>ftype rbfileFile type 'rbfile' not found or no open command associatedwith it.

If not found, you can create it with a command like this:

C:\Ruby Code>ftype rbfile="C:\Program Files\Ruby\bin\ruby.exe" "%1" %*
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Ruby Pocket Reference»

Look at similar books to Ruby Pocket Reference. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Ruby Pocket Reference»

Discussion, reviews of the book Ruby Pocket Reference and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.