易截截图软件、单文件、免安装、纯绿色、仅160KB

Ruby 程序员的挚友

历史背景[1]
诞生于1993年2月24日的Ruby(红宝石),由日本人松本行弘(Yuki Matsumoto)于1994年12月发布。 Ruby 作为一种纯面向对象的脚本程序设计语言,吸收了Smalltalk和Perl两种程序语言的特性。
Ruby理念[2]
1.首先考虑的是,减少编程时不必要的琐碎时间,令编写程序的人高兴;
2.其次是良好的界面设计;
3.强调系统设计必须人性化,而不是一味从机器的角度设想。
Linux中安装Ruby[3]
依赖于您所使用的Linux发行版本,有一些安装Ruby的方法。首选方法是简单地下载源代码并亲自编译。而在一些操作系统平台中,用安装包管理解决方法,可以极其简单地安装Ruby。
例如,在Debian或Ubuntu中apt-get工具提供了一种简易而优美的解决方案:
% sudo apt-get install ruby1.9.1-full
上述命令安装目前稳定的Ruby版本1.9.1。如果您喜欢安装Ruby1.8版本,您可以使用以下命令安装:
% sudo apt-get install ruby-full
程序示例
#!/usr/bin/env ruby
# hello.ry
puts "Hello, world!"
端中输入以下命令:
$chmod a+x hello.ry
$hello.ry
结果输出显示是:
Hello, world!
资源
Ruby官方网:http://www.ruby-lang.org/en/
Ruby正体中文网:http://www.ruby-lang.org/zh_TW/
Ruby简体中文网:http://www.ruby-lang.org/zh_cn/
Rails中Ruby程序设计指南:
http://www.meshplex.org/wiki/Ruby/Ruby_on_Rails_programming_tutorials
参考文献
1.维基百科http://zh.wikipedia.org/wiki/Ruby
2.Ruby官方网站http://www.ruby-lang.org/en/


相关文档:

自动化测试之路(三) ruby里的get与set方法

照例可以先看端程序
class Person
 
  def initialize( name,age=18 )
    @name = name
    @age = age
    @motherland = "China"
  end
 
  def talk
    puts "my name is "+@name+", age is "+@age.to_s
 &n ......

Ruby学习笔记二——数组

#一、数组引用
arr=[3,4,5,6,7,8,9]
puts arr[0] #3
puts arr.first #3
puts arr[arr.length-1] #9
puts arr[arr.size-1] #9
puts arr.last #9
puts arr[-1] #9
puts arr[-2] #8
print arr[1..3] ,"\n" #456
print arr[-3,4] ,"\n" #789,从-3开始 ,打印4个元素,这里只有三个
#Ruby的数组大小是动态的,你能够 ......

转载——Ruby字符串处理

转自:http://developer.51cto.com/art/200912/170762.htm 
Ruby字符串处理函数总结列表分享
Ruby字符串处理函数包括返回字符串长度函数;判断字符串中是否包含另一个串函数;字符串插入;字符串分隔,默认分隔符为空格等等。
 
str.length => integer 
str.include? other_str
&nbs ......

Install Cassandra with Ruby 1.9.1 on Windows

To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
  You may know that the Ruby gem cassandra will do it for you.
  ......

ruby 连接操作 sql2005


The following is improved version of the code created by David Mullet, from
http://rubyonwindows.blogspot.com/2007/03/ruby-ado-and-sqlserver.html
require 'win32ole'
class SqlServer
# This class manages database connection and queries
attr_accessor :connection, :data, :fields
attr_wr ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号