欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Ruby
来自开放百科 - 灰狐
(版本间的差异)
小 (→链接) |
|||
(未显示1个用户的62个中间版本) | |||
第1行: | 第1行: | ||
[[Image:Ruby-90x90.gif|right]] | [[Image:Ruby-90x90.gif|right]] | ||
− | |||
− | |||
Ruby是一种功能强大的面向对象的脚本语言,她可以使您方便快捷地进行面向对象编程.Ruby使文本处理和系统管理变得简单,与Perl非常相似.一句话:简单明了,扩展性强,移植性好. | Ruby是一种功能强大的面向对象的脚本语言,她可以使您方便快捷地进行面向对象编程.Ruby使文本处理和系统管理变得简单,与Perl非常相似.一句话:简单明了,扩展性强,移植性好. | ||
− | + | ==简介== | |
+ | [[文件:ruby-is-friend.png]] | ||
− | + | ==功能== | |
+ | Ruby 的几大亮点: | ||
* 语法简单 | * 语法简单 | ||
* 垃圾回收 | * 垃圾回收 | ||
第15行: | 第15行: | ||
* 正则表达式 | * 正则表达式 | ||
− | 将 Ruby 带入企业级应用: [[Enterprise Ruby]] | + | 将 Ruby 带入企业级应用: [[Enterprise Ruby]],[http://cloud.csdn.net/a/20101209/283277.html Salesforce CEO:Ruby是下一代云计算的语言]: |
− | == | + | Marc Benioff的解释到:“云计算的下一个时代,我称之为Cloud 2,将属于移动、社会化和实时。而Ruby是Cloud 2的语言,[http://www.heroku.com/ Heroku]是领先的Cloud 2 Ruby PaaS平台。对Heroku的并购将使Salesforce成为下一代应用程序员的基石。” |
+ | |||
+ | ==新闻== | ||
+ | {{SeeWikipedia|Ruby (programming language)}} | ||
+ | <rss>http://www.ruby-lang.org/en/feeds/news.rss|short|date|max=8</rss> | ||
+ | |||
+ | ==指南== | ||
% ruby -v | % ruby -v | ||
% ruby -e 'puts "hello world"' | % ruby -e 'puts "hello world"' | ||
第42行: | 第48行: | ||
g.salute | g.salute | ||
− | == | + | ==版本== |
+ | 自 2015 年起,团队就开始努力开发 Ruby 3,其目标在更高的性能、并发性和更安全的类型。尤其是性能上,Matz 表示「Ruby 3 会比 Ruby 2 快 3 倍」,也就是 Ruby 3x3。 | ||
+ | |||
+ | [[文件:ruby3x3.png|590px|274px]] | ||
+ | |||
+ | *[https://www.ruby-lang.org/en/news/2021/04/05/ruby-3-0-1-released/ Ruby 3.0.1 Released] | ||
+ | *Ruby 2.7 处于常规维护阶段 | ||
+ | *Ruby 2.6 处于常规维护阶段 | ||
+ | *Ruby 2.5 处于安全维护阶段,支持计划在2021年3月底结束。 | ||
+ | *Ruby 2.4: [https://www.ruby-lang.org/en/news/2020/04/05/support-of-ruby-2-4-has-ended/ 对 Ruby 2.4 系列的支持已经全部结束] (20200405) | ||
*Ruby 1.9 变化 - http://opinion.rubytao.com/ruby/ruby-programming/post/12 | *Ruby 1.9 变化 - http://opinion.rubytao.com/ruby/ruby-programming/post/12 | ||
*Ruby 1.8.5 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz | *Ruby 1.8.5 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz | ||
*Ruby 1.8.4 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz | *Ruby 1.8.4 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz | ||
*Ruby 1.6.8, 1.8.1 - http://rubycn.ce-lab.net/man/index.html | *Ruby 1.6.8, 1.8.1 - http://rubycn.ce-lab.net/man/index.html | ||
− | *Ruby 1.4.6 - http:// | + | *Ruby 1.4.6 - http://docs.huihoo.com/ruby/ruby-man-1.4/ |
==开发指南== | ==开发指南== | ||
+ | *[https://github.com/rubocop/ruby-style-guide The Ruby Style Guide] | ||
+ | *[https://github.com/rubocop/rails-style-guide The Rails Style Guide] | ||
+ | *[https://github.com/rubocop/rubocop RuboCop] is a Ruby static code analyzer and code formatter. | ||
*[[Emacs support for Ruby and Rails]] | *[[Emacs support for Ruby and Rails]] | ||
*[[Ruby Development Tools]] | *[[Ruby Development Tools]] | ||
+ | *[http://ruby-hacking-guide.github.io/ Ruby Hacking Guide]、[http://axgle.github.io/rhg/ Ruby Hacking Guide中文版] | ||
+ | |||
+ | ==函数式编程== | ||
+ | *[http://www.sitepoint.com/functional-programming-techniques-with-ruby-part-i/ Functional Programming Techniques With Ruby: Part I] | ||
+ | *[http://www.sitepoint.com/functional-programming-techniques-with-ruby-part-ii/ Functional Programming Techniques With Ruby: Part II] | ||
+ | *[http://www.sitepoint.com/functional-programming-techniques-with-ruby-part-iii/ Functional Programming Techniques with Ruby: Part III] | ||
+ | |||
==Standard Library== | ==Standard Library== | ||
===XML-RPC=== | ===XML-RPC=== | ||
第68行: | 第93行: | ||
change require_gem to gem | change require_gem to gem | ||
− | == | + | ==RVM== |
− | + | [https://rvm.io/ Ruby Version Manager(RVM)] 通过它来安装、升级Ruby。 | |
− | + | curl -L get.rvm.io | bash -s stable | |
− | + | or curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled | |
+ | source ~/.rvm/scripts/'rvm' | ||
+ | .rvm/bin/rvm version // 修改 vi /etc/profile 加入path 在 Mac OS X | ||
+ | rvm -v | ||
+ | rvm package install readline | ||
+ | rvm package install iconv | ||
+ | rvm package install zlib | ||
+ | rvm package install openssl | ||
+ | rvm install 1.9.3 | ||
+ | rvm list | ||
+ | rvm list known | ||
+ | # MRI Rubies | ||
+ | # JRuby | ||
+ | # Rubinius | ||
+ | ... | ||
+ | [ruby-]2.1[.10] | ||
+ | [ruby-]2.2[.10] | ||
+ | [ruby-]2.3[.8] | ||
+ | [ruby-]2.4[.9] | ||
+ | [ruby-]2.5[.7] | ||
+ | [ruby-]2.6[.5] | ||
+ | [ruby-]2.7[.0] | ||
− | == | + | rvm install 2.0.0 |
+ | rvm use 2.0.0 --default | ||
+ | ruby -version | ||
+ | ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2] | ||
+ | |||
+ | ==Eclipse== | ||
+ | [http://marketplace.eclipse.org/category/free-tagging/ruby Ruby on Eclipse] | ||
+ | *使用 [[Aptana]] 进行 Ruby 应用开发。 | ||
+ | *[http://www.ibm.com/developerworks/cn/opensource/os-eclipse-rdt/ 用 Eclipse 轻松地进行 Ruby 开发] | ||
+ | *[http://www.ibm.com/developerworks/cn/opensource/os-rubyeclipse/ 使用 Eclipse 插件 Ruby Development Tools] | ||
+ | |||
+ | ==文档== | ||
+ | *[http://docs.huihoo.com/ruby/ruby-man-1.4/ Ruby 1.4.6] | ||
+ | *[http://docs.huihoo.com/ruby/rug/ Ruby User's Guide] | ||
+ | *[http://docs.huihoo.com/api/ruby/ Ruby API] | ||
+ | *[http://docs.huihoo.com/api/ruby-on-rails/ Rails API] | ||
+ | |||
+ | ==项目== | ||
+ | *[https://github.com/markets/awesome-ruby Awesome Ruby] [[image:awesome.png]] | ||
+ | *[[Rails|Ruby on Rails]] | ||
+ | *[[Chef]] | ||
+ | *[[Puppet]] | ||
+ | *[https://github.com/ManageIQ/ ManageIQ] | ||
+ | *[https://github.com/rapid7/metasploit-framework Metasploit Framework] | ||
+ | *[[Puma]] | ||
+ | *[[Phusion Passenger]] | ||
+ | *[[Sinatra]] | ||
*[[Rubinius]] | *[[Rubinius]] | ||
− | + | *[[WEBrick]] | |
− | + | ||
− | + | ||
− | *[[ | + | |
*[[mod_ruby]] | *[[mod_ruby]] | ||
− | * | + | *[[OpenNebula]] |
− | + | *[[Homebrew]] | |
− | + | *[[Redmine]] | |
− | + | *[[Huihoo Ruby Applications]] | |
− | + | ||
− | *[ | + | |
− | *[ | + | |
− | *[ | + | |
− | == | + | ==图集== |
[[Image:ruby.gif]] | [[Image:ruby.gif]] | ||
− | + | ==链接== | |
+ | *[http://www.ruby-lang.org Ruby官网] | ||
+ | *[https://github.com/ruby/ruby Ruby @ GitHub] | ||
+ | *[http://www.rubygems.com.cn/ Ruby on Rails学习资料站点] | ||
+ | *http://rubymanual.org/ | ||
+ | *[http://www.rubycocoa.com/ Mac OS X用户] | ||
+ | *[http://www.rubytao.com/ Ruby TAO] | ||
+ | *[http://www.rubyquiz.com Ruby Quiz] | ||
+ | *[http://www.bodhost.com/web-hosting/index.php/2007/07/07/ruby-on-rails/ Ruby on Rails] | ||
+ | *[http://www.igvita.com/ a goal is a dream with a deadline] | ||
+ | *[http://en.wikibooks.org/wiki/Ruby_Programming Ruby Programming Wikibooks] | ||
+ | *[http://blade.nagaokaut.ac.jp/ruby/ ruby mailing lists] | ||
+ | *[https://gist.github.com/dahlia/562017 30 minutes Lisp in Ruby] | ||
− | [[ | + | [[category:programming language]] |
− | [[ | + | [[category:c programming language]] |
+ | [[category:ruby]] | ||
+ | [[category:Huihoo Foundation]] |
2023年6月11日 (日) 02:03的最后版本
Ruby是一种功能强大的面向对象的脚本语言,她可以使您方便快捷地进行面向对象编程.Ruby使文本处理和系统管理变得简单,与Perl非常相似.一句话:简单明了,扩展性强,移植性好.
目录 |
[编辑] 简介
[编辑] 功能
Ruby 的几大亮点:
- 语法简单
- 垃圾回收
- 可移植性
- 动态载入
- 完全免费
- 正则表达式
将 Ruby 带入企业级应用: Enterprise Ruby,Salesforce CEO:Ruby是下一代云计算的语言: Marc Benioff的解释到:“云计算的下一个时代,我称之为Cloud 2,将属于移动、社会化和实时。而Ruby是Cloud 2的语言,Heroku是领先的Cloud 2 Ruby PaaS平台。对Heroku的并购将使Salesforce成为下一代应用程序员的基石。”
[编辑] 新闻
您可以在Wikipedia上了解到此条目的英文信息 Ruby Thanks, Wikipedia. |
自http://www.ruby-lang.org/en/feeds/news.rss加载RSS失败或RSS源被墙
[编辑] 指南
% ruby -v % ruby -e 'puts "hello world"'
% irb // 进入 ruby 的交互模式
% echo "puts 'hello world'" > hello.rb % ruby hello.rb
# The Greeter class class Greeter def initialize(name) @name = name.capitalize end def salute puts "Hello #{@name}!" end end # Create a new object g = Greeter.new("world") # Output "Hello World!" g.salute
[编辑] 版本
自 2015 年起,团队就开始努力开发 Ruby 3,其目标在更高的性能、并发性和更安全的类型。尤其是性能上,Matz 表示「Ruby 3 会比 Ruby 2 快 3 倍」,也就是 Ruby 3x3。
- Ruby 3.0.1 Released
- Ruby 2.7 处于常规维护阶段
- Ruby 2.6 处于常规维护阶段
- Ruby 2.5 处于安全维护阶段,支持计划在2021年3月底结束。
- Ruby 2.4: 对 Ruby 2.4 系列的支持已经全部结束 (20200405)
- Ruby 1.9 变化 - http://opinion.rubytao.com/ruby/ruby-programming/post/12
- Ruby 1.8.5 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz
- Ruby 1.8.4 - ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz
- Ruby 1.6.8, 1.8.1 - http://rubycn.ce-lab.net/man/index.html
- Ruby 1.4.6 - http://docs.huihoo.com/ruby/ruby-man-1.4/
[编辑] 开发指南
- The Ruby Style Guide
- The Rails Style Guide
- RuboCop is a Ruby static code analyzer and code formatter.
- Emacs support for Ruby and Rails
- Ruby Development Tools
- Ruby Hacking Guide、Ruby Hacking Guide中文版
[编辑] 函数式编程
- Functional Programming Techniques With Ruby: Part I
- Functional Programming Techniques With Ruby: Part II
- Functional Programming Techniques with Ruby: Part III
[编辑] Standard Library
[编辑] XML-RPC
require 'xmlrpc/client' require 'pp' server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php") result = server.call("sample.sumAndDifference", 5, 3)
More: http://docs.huihoo.com/ruby/stdlib/
[编辑] gem
gem list # gem update --system # gem update --include-dependencies # gem install --remote rake
/usr/local/ruby/bin/rails:17: undefined method `require_gem' for main:Object (NoMethodError)
vi /usr/local/ruby/bin/rails change require_gem to gem
[编辑] RVM
Ruby Version Manager(RVM) 通过它来安装、升级Ruby。
curl -L get.rvm.io | bash -s stable or curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled source ~/.rvm/scripts/'rvm' .rvm/bin/rvm version // 修改 vi /etc/profile 加入path 在 Mac OS X rvm -v rvm package install readline rvm package install iconv rvm package install zlib rvm package install openssl rvm install 1.9.3 rvm list rvm list known # MRI Rubies # JRuby # Rubinius ... [ruby-]2.1[.10] [ruby-]2.2[.10] [ruby-]2.3[.8] [ruby-]2.4[.9] [ruby-]2.5[.7] [ruby-]2.6[.5] [ruby-]2.7[.0]
rvm install 2.0.0 rvm use 2.0.0 --default ruby -version ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]
[编辑] Eclipse
- 使用 Aptana 进行 Ruby 应用开发。
- 用 Eclipse 轻松地进行 Ruby 开发
- 使用 Eclipse 插件 Ruby Development Tools
[编辑] 文档
[编辑] 项目
- Awesome Ruby
- Ruby on Rails
- Chef
- Puppet
- ManageIQ
- Metasploit Framework
- Puma
- Phusion Passenger
- Sinatra
- Rubinius
- WEBrick
- mod_ruby
- OpenNebula
- Homebrew
- Redmine
- Huihoo Ruby Applications
[编辑] 图集
[编辑] 链接
分享您的观点