Suppose you have written a rubyProgramFor example, LCX. RB: Now you want to use it to generate an executable file. EXE for a machine without a ruby environment.
Specific Method:
1. Download Ruby GEM: http://rubygems.org/pages/download
2.
ArticleDirectory
About C ++ 0x
Lambda expressions
Ruby code
C ++ code
With regard to C ++ 0x, the new standard C ++ 0x is expected to be launched by the end of next year, although it is nearing the closing stage, there are
Recently, rake was used for database migration. Ruby's activerecord only supports single-primary-key tables, which is very troublesome for the migration of compound-key tables.Assume that table A1 has a Sid primary key, and its storage is as follows:
Generally, the rdoc command is used for RubyProgramGenerate document
Eg:
Rdoc test. Rb
To generate a document for the RB file of the entire project, you only need to run the rdoc command without the file name.
Eg:
Rdoc
If there are classes and
Ruby is an open-source and is freely available on the web, but it is subject to a license .. (Open Source protocol ...)
Ruby is a general-purpose, interpreted programming language. (multi-purpose, interpreted)
Ruby is a true object-oriented
# Encoding: UTF-8 # --------- dynamic execution # execute 2 + 2 puts eval "2 + 2" # = "4 # execute 15*2 (q indicates that double quotation marks will be calculated, Q indicates that single quotes are output as they are.) number = 15 code = % q {#
Development test cases)1. Open the editor2. Use. RB as your file extension3. Write "require 'watir'" in the first sentence of the test file to ensure that the watir tool is accessible.4. Open the browser and go to the application to be
Here, we will talk about installing Ruby through apt-get, which will eliminate the need for self-compiling.
First, you must install both Ruby and ruby-dev when installing Ruby. The current version is 1.8, so you should execute the following command
For the original (English version), see here.
Here are some of my translations and technical background documents:In 1980, I started programming. 2 Basic, 400 steps (I do not know how to translate) 3 in 1988, I met Emacs and shared it with more than
Ruby standard type
I. Numbers
Ruby supports integers and floating-point numbers. integers can be of any length.
Integers within a certain range are stored in binary. They belong to the fixnum type. If they exceed this range, they are
No browser is displayed$ Hide_ie = true
How to obtain the path of the current fileFile. dirname (_ file _). to_s
Read files:Method 1:$ Result = 'd: // rs.txt'File. Open ($ result, "R") Do | file |File. each_line do | Line |If line. length>
Transferred from: http://blog.sina.com.cn/s/blog_4901d7bd0100b6lf.htmlrubyoperator reload
Reprinted tokenRuby's Operator Overloading is very interesting. Ruby allows "+" and other operators to be used as function names. Therefore, it is similar to
It may be a bit outdated, but the 12 tutorials provided by digitalmediaminute are still recognized as the classical required documents in the Ruby on Rails field --
A former student asked me a few days ago how I learned Ruby on Rails. the answer
Many Ruby syntaxes and special dynamic features remind me of oracle.
Ruby can execute dynamic code through eval ("2 + 2") = 4
Eval brother banding:
def eval_first puts eval("2+2") end def binding_elsewhere x=20 return binding end def
In Ruby, thread objects are also used to represent threads.
Threads = [] 10. times do thread = thread. new do 10. times {| I | print I; $ stdout. flush; sleep rand (5)} End threads
The join here is different from the join in the array. The join
I. Common ruby exception information:
Exception name
Common Causes
How to throw
RuntimeError
Default exception thrown by raise
Raise
NoMethodError
The corresponding method cannot be found for the object.
Finally, the full-text search of ferret was completed. It was not easy to get three full-text searches.
The last two times on my mac, ferret has been confused. The main problem is that it cannot be used for Chinese word segmentation, and it is
I,
Ruby Introduction:Ruby is "an interpreted scripting language for quick and easy object-oriented programming ". 1. interpreted scripting language
Ability to make operating system CILS directly
Powerful string operations and regular
Attr_reader: abc
You can use
Instance name. abc obtains the value of this variable, but cannot be modified. It is equivalent
Def abcReturn @ abcEnd
By the way, attr_writer and attr_accessor,Attr_writer: abc, which is equivalent
Def abc = (abc)@
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.