开发者

How should I capitalize Ruby? [closed]

开发者 https://www.devze.com 2023-03-07 08:33 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

RUBY? Ruby? ruby? What's good style?

I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form.

Also, should I capitalize "gem" as "GEM"?

class TestLanguageName < Test::Unit::TestCase
  def test_language_name
    assert_correct_language_name StackOverflow.new.describ开发者_开发技巧e_language("RuBy")
  end
end

class StackOverflow
  def describe_language(string)
    # Which of the following?
    methods = [:upcase, :capitalize, :downcase]
    string.send(methods[rand(3)])
  end
end


Section 1.9 of ruby-doc.org FAQ says:

Officially, the language is called "Ruby". On most systems, it is invoked using the command "ruby". It's OK to use ruby instead of Ruby. Please don't use RUBY as the language name. Originally, or historically, it was called "ruby".

Either Ruby or ruby is correct.


The programming language is called Ruby (that's how they write it on the official site).

As for gems, the full name of the project is RubyGems, with inner-caps, but the things you produce for it are simply gems (unlike a lot of open-source projects, it doesn't stand for anything — it's just a pun on "Ruby").

As a side note, even though the language is "Ruby", the name of the official Ruby interpreter on most systems is ruby — the capitalization matters here because many filesystems are case-sensitive, so trying to run "Ruby" will get you a whole bunch of nothing. But to distinguish it from other Ruby interpreters, in conversation this implementation is usually called "MRI" (for "Matz's Ruby Interpreter").

0

精彩评论

暂无评论...
验证码 换一张
取 消