How to use Ruby for Windows shell programming.
For example, create an Internet Explorer instance.
Require
"
Win32ole
"
#
Include library
IE
=
Win32ole. New (
'
Internetexplorer. Application
'
)Ie. Visible
=
This section describes the fileutils module of the file class filetest module of the Dir class.
-------------------------------------------------------------Directory operation: Use the static method of the Dir class or create an Instance Object
Through the previous lecture, we have some knowledge about the basic framework of rest on rails, but how does it return different types of resource representations Based on the client request type? This is what we want to talk about. The secret lies
One project uses the ruby language, which is not supported by sourceinsight by default. The supported methods are as follows:
1. Visit the sourceinsight official website to obtain Ruby language support.
Http://www.sourceinsight.com/public/,
When testing the model, one change was observe. I wanted to test it, but the observer refused to execute it in rspec, but there was no problem with test env in the console.
It took me a day to debug and finally failed to solve the problem. If you
Chapter 2 Ruby Data Types
Number: If fixnum is out of the range, it is automatically converted to bignum. Numeric is the base class for all numeric types, float and integer are the subclasses of numeric, and fixnum and bignum are the
We know what the self of the top-level domain is?
Puts self # mainputs self. class # object
We know that when a method is called, if no object is accepted, the default value is self, for example:
Def tell_me_who puts selfendtell_me_who #
Gem packaging:
Gem build XXX. Rb
Install GEM:
Gem install XXX. Rb
For example:
Run-> cmd-> go to the folder to be packaged-> gem build install. RbInstal. RbCode
Code
Code highlighting produced by Actipro CodeHighlighter
How many methods do you have to create a method? Most people may think of the def keyword Ruby.
Code
# Common method
DefTele_you
Puts"I am anleb"
End
# General method def tele_you puts "I am anleb" End Ruby code
#
"Require" can be merged into. RB proposal, and can be omitted ". RB ". in addition, it will only commit at the first time. If it is "require" again, it will ignore
Code highlighting produced by Actipro CodeHighlighter
Use netbeans debug RubyCode
Netbean debug Ruby
Debug Ruby code in netbeans
1. Get the gems package ruby-debug-ide-0.4.6.gem for ruby-debug-ide now I only see 0.4.6 and 0.4.5 available, and other high versions will always have issues
2.
Life cycle:
Yukihiro Matsumoto was born on February 1, April 14, 1965 in Tokushima Prefecture, Japan. In 1984, he studied at the Department of Information, the third discipline of zhubo University. Two years later, I will be absent from school and
Around_filter: around_action_filter
Protected
Def transaction
Ret = true
Activerecord: Base. Transaction do
Begin
Yield if block_given?
Rescue exception => ex
Set_notice (ex. Message)
Ret = ex. Message
Raise activerecord: rollback,
Ruby automation came into contact with the company. After writing several examples and applications under the company's framework, I also summarized the comparison and feelings between Ruby and Python development in the past. Of course, I know that
Use couchrest_model:
Https://github.com/couchrest/couchrest_model
1. Modify gemfile and add:
gem 'couchrest_model'
Then run bundle install.
2. Run
rails generate couchrest_model:config
Generate the couchdb. yml file in the config directory,
Then
There is a class named open3 in ruby that can be used to execute system commands. However, after Ruby is installed in WINXP, open3 supports Linux by default. If you run the code, the fork () cannot be found () method error.
Fortunately there is a
Use will_paginate for paging and simple query
Run the gem install will_paginate command on the command line. The following result shows that the installation is successful.
Open books_controller.rb (your own Controller)
Comment out all the methods
Ruby on Rails win Installation
I found the new technology Ruby on Rails. I will not talk about it any more. Let's talk about my installation process today!
First, download
Http://rubyforge.org/projects/rubyinstaller/
I got the latest! Then install
Ruby used to learn a lot from perl, one of which is the global magic variable. Among these variables, it is estimated that no $ _ is more strange. For example, the gets method has this effect: while returning the row data you just read, it also
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.