Learning a language, I think the most should first understand is how to build the operating environment of this language. If we know the language's running environment, we can find the IDE tools that match the previous development habits, and then
Based on the current knowledge of Ruby and the help of Ruby Standard library, you should be able to build a real-world application.
In the beginning, I provided a sample application that used a lot of the Ruby features we had discussed. This
Input and output
In all this series of articles, a large number of Ruby standard output methods are used when writing Ruby code. Among them, the most common is the print and puts methods, the details of its use no longer repeat.
All of these and
You create an array by listing the elements in square brackets and separating them from each other by commas. The array of Ruby can accommodate different object types
ruby> ary = [1, 2, "3"]
[1, 2, "3"]
Just like the string mentioned earlier.
First, install Ruby under Linux
1-First, we want to get the latest Ruby release version (currently ruby-1.8.2.tar.gz).
Please download it to www.ruby-lang.org/en/20020102.html.
2-then decompression: TAR-ZXF ruby-1.8.2.tar.gz
3-Last Run:
First, in ruby1.8, class variables are shared by all subclasses and parent classes, and you can look at the following code:
class IntelligentLife @@home_planet = nil def self.home_planet @@home_planet end def self.home_planet=(x)
A script that scans all URLs in the current page, written in Ruby, is a good example of learning Ruby's friends.
#scanweb.rb #用法ruby scanweb.rb www.jb51.net 将当前结果保存在c:\1.txt require 'net/http' filename= File.new('c:\1.txt',"w+") if $*[0]==nil puts "
This article mainly introduces the collection of multiple Ruby Traversal folder code instances, this article summed up 4 pieces of code, small series recommend the last method, because it is very simple and elegant, need friends can refer to the
This article mainly introduces the best binary lookup tree algorithm in Ruby, this paper gives the implementation code directly, the need for friends can refer to the following
The pseudo code in the introduction of the algorithm is rewritten,
An active record abstracts the concept of a database connection and helps the application to handle the details of the underlying database links, in lieu of the active record using a generic invocation to delegate the details to a set of database
One of the objects in the ActiveRecord corresponds to a row of tables in the database, and the object's properties correspond to the columns of the table, and you may notice that our order class does not mention anything about the Orders table
In the last content, we completed the preparation of the order. This time we simulate a simple delivery page for the shopping cart's administrator.
1. First, we modify the order table to add a field to him Shipped_at:
CREATE TABLE orders (
ID int
I heard that your company recently launched a new E-book reading application, the market reaction is very good, the application of the book Mall, users can choose to buy their favorite books. Your company also attaches great importance to this
Rails Brochure3.8 UsechangeMethod1. Add a field to a tableRails g Migration Add_column_to_d_groups_equip_numclass Addcolumntodgroupsequipnum ] def change add_column:d _groups,: Equip_num,: Integer endend2. modifying table field typesRails g
Will ozzzzzz die in Java? A standard to measure the mainstream industrial languages in the future is put forward, one of which is very interesting:
Ozzzzzz writes 1. Writing should be standardized, rather than creating different styles like C.
Java
Author liubin http://www.ruby-cn.org/IOC (inversion of control), that is, the inversion of control in Chinese, is also called di (dependency injection), that is, dependent injection. In Java, there are many such containers, such as spring. There are
1. Send email via SMTP
Every week, Holden Glova, Pat eyler, and Phil Thomson submit a ruby Weekly News (RWN) article to the ruby garden website (http://www.rubygarden.org. A ruby script receives this article via email, converts it from the original
Author: Jiangnan Baiyi
When Wang Jiawei met du Kefeng and spring met Ruby. The crraig Wils that came up with this question is definitely a gossip, promoting spring 2. feature integrated with dynamic languages.This feature aims to enable classes
Advantages and disadvantages of Ruby
It seems a bit cool to explain what these are actually doing. But what I want to pass on is the experience when using Ruby. Although you cannot try it yourself, you can see the process on the screen. Now I want
Because I am used to Java, the general syntax will be compared with Java
Variable name: must be a single entity (do not contain spaces), must begin with a letter and underline, case sensitive. Not much different from Java
Numbers and expressions
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.