First, Introduction Ruby is an open-source, object-oriented programming server-side scripting language that was designed and developed by as まつもとゆきひろ/yukihiro Matsumoto in Japan in the mid 1990s. In the Ruby community, Matsumoto is also known as
CMD under: ruby-v successInstallation using SASS1: Removing the http://rubygems.org sourceGem Sources--remove https://rubygems.org/2: Add Taobao sourceGem Sources-a https://ruby.taobao.org/3: See if the first two steps were successfulGem Sources-l4:
1.Capistrano IntroductionWhat is it? ---a deployment tool. (The deployment is to install the application on the production server, or update the latest version, the Web server start restart and stop, the site into a maintenance state or restore it
1. Relationship of classes and instancesUse "instance. Class" To see which class an object belongs toUse "instance. Instance_of (class name)" To determine whether the instance belongs to a classUse "instance. Instance_methods" To view all instance
1. Invocation of the methodObject. Method name (parameter 1, parameter 2, ...). ) can omit the parameter list ()Object. Method name (parameter 1, ...). ) do | Variable 1, variable 2,...| You can omit the parameter ()Block contentEndObject.
OrderRecently tried a bit coffeescript, and sass, have to say that these two together is indeed a good choice, familiar with the development is relatively fast.Of course to develop this first need to build the environment, here will need to have
Open source, cross-platform (Windows, Linux, UNIX, etc.)scripting language (less efficient), no need to compile, run directlyGrammar Nature, IntroductionEverything is an object.Flexible language design (feel free to change the original
Singleton is a design pattern in the software engineering. Ruby has it own special feature to declare Singleton class. I'll demonstrate II examples as below:Class Logger def initialize @log = File.Open ("Log.txt", "a") end @ @instance =
Requirements: input fractions from the keyboard, judging by this, 0-59 for failing, print "You did not pass, please work hard next time!", 60-79 for passing, print "Your grades pass, please try harder!" ", 80-100 for good results, print" Your score
#Encoding:utf-8require"Open-uri"require"Timeout"require'RubyGems'require"Nokogiri"URI="http://api.map.baidu.com/direction/v1?mode=driving&origin=&destination= Peking University &origin_region= Beijing &destination_region= Five Street, &output=xml&ak=
OneOverview
Range represents a range in Ruby. Represents the method "..." and "...". The former indicates a closing interval:
The elements in range can be numbers, strings, and custom interval objects
(1..10). Each{|i| puts i} #1 2 3
Demand:Xiao Ming let Xiao Li Chase for him (send doll, send flowers, send chocolate)Code with no proxy:#-*-encoding:utf-8-*-#Suitor ClassclassPursuit attr_accessor:mmdefInitialize (mm) @mm=mm EnddefGive_dolls puts"#{mm.name} give you a
Demand:Give people a different outfitCode version One#-*-encoding:utf-8-*-classPerson attr_accessor:namedefInitialize (name) @name=Name EnddefWear_t_shirts puts'Large T-shirt'EnddefWear_big_trouser puts'Pants'EnddefWear_sneakers puts'Broken Sneakers'
Chapter IIClass inheritance, properties, class variables1. How to declare a subclassclass Treasure This way the attribute name,description in the thing class is inherited by Treasure2. What are the parameters of the following three ways to pass in
Programmers learn any new language and always start by writing a Hello World in a new language, and we are no exception to writing a minimalist Hello world with Ruby first.Say minimalism deserves to be deserved because there is only one line of code:
How to Improve Ruby On Rails performance (1)
1 Introduction to Introduction
It is always said that Rails is so slow that it has become a common issue in the Ruby and Rails communities. However, this statement is not true. As long as you use Rails
Use the Markdown method in Ruby on Rails, railsmarkdown
The Redcarpet and pygments. rb are used to implement Markdown syntax and code syntax highlighting respectively:
Https://github.com/vmg/redcarpetHttps://github.com/tmm1/pygments.rbHttps://github.
In Ruby, you can use the mechanism to batch download photos from the School Intranet,
You have nothing to do with it. You have used "machize" to create a code that can download photos of on-campus albums.
It's a little simple to write .... It mainly
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.