全新的 Ruby 文档界面
由 Stan Lo 发表于 2025-12-23
A Programmer's Best Friend
# Output "I love Ruby"
say = "I love Ruby"
puts say
# Output "I *LOVE* RUBY"
say = say.sub("love", "*love*")
puts say.upcase
# Output "I *love* Ruby"
# five times
5.times { puts say }# Ruby knows what you
# mean, even if you
# want to do math on
# an entire Array
cities = %w[ London
Oslo
Paris
Amsterdam
Berlin ]
visited = %w[Berlin Oslo]
puts "I still need " +
"to visit the " +
"following cities:",
cities - visited# 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想了解更多或试试 Ruby? Try Ruby
为什么世界各地的程序员都热爱 Ruby?是什么让它如此有趣?
丰富的 gem 支持各种开发需求。
成熟的工具开箱即用。
Yukihiro "Matz" Matsumoto
Creator of Ruby
易写易读。
像说话一样自然的语法。
David Heinemeier Hansson
Creator of Ruby on Rails
用更少的代码做更多的事。
直观的语法加速开发。
Dave Thomas
Author of "The Pragmatic Programmer"
世界各地的开发者相互支持。
温暖而活跃的社区。
Amanda Perino
Executive Director of Rails Foundation
超越用户身份参与 Ruby 的人被称为 Rubyist。
热爱 Ruby 的 Rubyist 都是很棒的 #rubyfriends。社区活动蓬勃发展且充满乐趣。
通用座右铭是 "MINASWAN" — Matz is nice and so we are nice
由 Stan Lo 发表于 2025-12-23
由 Hiroshi SHIBATA 发表于 2025-12-22
由 naruse 发表于 2025-12-18
由 k0kubun 发表于 2025-12-17
由 hsbt 发表于 2025-10-07
由 naitoh 发表于 2025-09-18
由 mame 发表于 2025-07-08
由 nevans 发表于 2025-04-28
由 hsbt 发表于 2025-02-26
由 nevans 发表于 2025-02-10