It was an intoxicating day. The conventions of element data programming, dynamic typing, and the combination of Ruby and rails are better than configurations (Convention over configuration), giving us faster development and cleaner code. has been
1. Install RubyAfter the installation is successful, the input ruby-v will have version information2. Execute gem install rails installation RailsImplementation of the outdated wait, long time no response, after the internet to find out the resource
Because you want to install the latest version, install it by compiling it.Prepare the tools and library files before installing:sudo Yum Install GCC gcc-c++ openssl-devel readline-devel gdbm-devel patchDownload file:Curl-o
RVM is the acronym for Ruby version Manager and is a command-line tool that allows you to easily install, manage, and use multiple versions of Ruby. Different rails projects use RVM to switch freely when using the same version of Ruby and
1. Logical operators(1) Condition 1 | | Condition 2Condition 1 is false , only need to judge condition 2(2) Conditions 1 && conditions 2Condition 1 is true , the condition must be judged 22. Range operator(1) x.. Y from X to Y, including y(2) X...y
Empty? Whether the value of the object is emptyNil? Whether the object itself is emptyRB (Main):015:0>"'.Empty?=>trueIRB (main):016:0>"'.Empty?=>falseIRB (main):017:0>"".Empty?=>trueIRB (main):018:0>" ".Empty?=>falseIRB (main):019:0> Nil.Empty?
The method for creating and parsing XML files in Ruby programs, rubyxml
Use builder to create XML
Builder installation method:
gem install builder
Require 'builder 'X = builder: XmlMarkup. new (: target => $ stdout,: indent => 1) # ": target => $
Ruby basic environment variable settings and common interpreter commands, ruby interpreter
Ruby Environment VariablesThe Ruby interpreter uses the following environment variables to control its behavior. The ENV object contains a list of all
A Simple Method for Blocking spam messages in a blog.
Spam is commonly known as Spam, which is the Spam advertisement that is everywhere in the message box. I believe most people have seen it. In the past, when using WordPress, the anti-Spam
Ruby configures rspec and RestClient to detect the server, rspecrestclient
If you manually test the Restful service, it will be very monotonous. Of course, there are some browser plug-ins that can help you manually test through visual interfaces,
The following is an example of how to use require IN Ruby: rubyrequire.
Files in the same directory, such as/usr/local/ruby/foo. rb and/usr/local/ruby/bar. rb.If it is directly in foo. rb
require 'bar'
Bar. rb is not found during execution.This is
Ruby implements the longest common subsequence algorithm and ruby sequence algorithm.
Longest Common subsequence, LCS, dynamic planning implementation.
#encoding: utf-8#author: xu jin, 4100213#date: Nov 01, 2012#Longest-Commom-Subsequence#to find a
Ruby-based Merge Sorting Algorithm and ruby Sorting Algorithm
The assignment of an algorithm course uses the division and control method to merge and sort.
#encoding: utf-8#author: xu jin, 4100213#date: Oct 27, 2012#MergeSort#to sort an array by
Analysis of DATA Objects in Ruby and RubyDATA objects
Can this code be run? What is this DATA?
Require 'erb' data = DATA. readmax = 15_000title = "hello world! "Content =" hello world! \ N "* 10max. times {ERB. new (data ). result (binding )} _
The usage of the Profiling tool in Ruby, rubyprofiling
The built-in profiler implementation is very simple. In ruby2.2, there are only 150 lines of code. You can see its implementation profile. rb. The built-in profiler is very convenient to use.
A simple example of sending HTTP-based requests in Ruby programs.
1. Establish an HTTP connection (Send request parameters through GET)
Require "open-uri" # Write the GET Request Parameters in the uri url uri = 'HTTP: // uri 'html_response = nil
Detailed description of the structure of the Combination Mode and Its Application in Ruby Design Mode Programming, ruby Design Mode
Definition:It is also called the merging mode or partial-overall mode. It is mainly used to describe the relationship
The template method in the design mode is used in the Ruby application instance, and the ruby application instance.
Instance 1Today, you have started programming as usual.The project manager tells you that you want to add a new function on the
Notes for writing Ruby code Annotations:
Write the code of the self-explanatory document and let this part rest. This does not mean playing.Write comments in English.Use a space to separate comments from symbols.When more than one word is commented,
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service