background preloader

Ruby

Facebook Twitter

Lisp

Space. Ruby Strings. A String object in Ruby holds and manipulates an arbitrary sequence of one or more bytes, typically representing characters that represent human language.

Ruby Strings

The simplest string literals are enclosed in single quotes (the apostrophe character). The text within the quote marks is the value of the string: 'This is a simple Ruby string literal' Ruby quickies and useful idioms. Using the Ruby MySQL Module. Paul DuBoispaul@kitebird.com Document revision: 1.06 Last update: 2007-05-26 Table of Contents Introduction Programs that access MySQL databases can be written in the Ruby scripting language by using Tomita Masahiro's MySQL module.

Using the Ruby MySQL Module

This module provides a Ruby client API; it is implemented as a wrapper around the MySQL C client API. Obtaining and Installing the MySQL Module To use the Ruby MySQL module, first make sure that you have the MySQL C client API header files and libraries installed. The Ruby MySQL module can be obtained from the following site: The module is distributed as a compressed tar file, which you should unpack after downloading it. . % tar zxf mysql-ruby-2.7.1.tar.gz % gunzip < mysql-ruby-2.7.1.tar.gz | tar xf - After unpacking the distribution, change location into its top-level directory and configure it using the extconf.rb script in that directory: Ruby Tutorial. RubyLearning.com Helping Ruby Programmers become Awesome!

Ruby Tutorial

Ruby Study Notes: TOC Core Ruby Programming Introduction InstallationWhat is Ruby? Downloading Ruby and an EditorRuby Programming Environment First Ruby Program Features Numbers in RubyOperators and PrecedenceDifference between or and || operator Fun with Strings Variables and Assignment Summary 1 ScopeGlobal scope and global variablesBuilt-in global variablesLocal scope Getting Input Names in Ruby More on Ruby Methods Writing own Ruby MethodsBang (!) Note: The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto.

. © 2006-2017 RubyLearning.com - A Ruby Tutorial Page Updated: 1st Jan. 2016 | Design: Erwin Aligam | Valid: XHTML | CSS Home | Privacy | Sitemap. Ruby Essentials. Extending Ruby with C. Extending Ruby with C by Garrett Rooney 11/18/2004 Ruby, if you've never heard of it, is an object-oriented scripting language, similar in many ways to Perl and Python. It originates from Japan and is young, as far as programming languages go. There are many really good reasons you might want to use the Ruby language; I'm not going to go into all of them here, but the one at the core of this article is the ease with which you can write Ruby extensions in C. I'm a big fan of the so-called agile programming languages.

The standard response to these sort of arguments is that you can easily write an extension that bridges the gap between your old C code and your new Perl or Python, or whatever agile language is hot this week, code. When I first looked at doing the same kind of thing for Ruby, a whole new world opened up. GenX GenX is a simple C library for generating correct, canonical XML. Justification Some Basic Functionality require 'mkmf' dir_config("genx4r") create_makefile("genx4r") Try ruby! (in your browser) Documentation. Here you will find pointers to manuals, tutorials and references that will come in handy when you feel like coding in Ruby.

Documentation

Installing Ruby Unless you only want to try Ruby in the browser (see the links below) you need to have Ruby installed on your computer. You can check whether Ruby already is available by opening a terminal and typing This should output some information on the installed Ruby version.