Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Ruby (programming language)

From Simple English Wikipedia, the free encyclopedia
Not to be confused withRuby on Rails.
Ruby
Paradigmmulti-paradigm:object-oriented,imperative,functional,reflective
Designed byYukihiro Matsumoto
DeveloperYukihiro Matsumoto, et al.
First appeared1995
Stable release4.0[1] Edit this on Wikidata / 25 December 2025;54 days ago (25 December 2025)
Typing disciplineduck,dynamic
Scopelexical, sometimes dynamic
OSCross-platform
LicenseRuby License orBSD License[2][3]
Filename extensions.rb, .rbw
Websitewww.ruby-lang.org
Majorimplementations
Ruby MRI,YARV,Rubinius,MagLev,JRuby,MacRuby,RubyMotion,HotRuby,IronRuby,mruby
Influenced by
Ada,[4]C++,[4]CLU,[5]Dylan,[5]Eiffel,[4]Lisp,[5]Perl,[5]Python,[5]Smalltalk[5]
Influenced
D,[6]Elixir,Falcon,Fancy,[7]Groovy,Ioke,[8]Mirah,Nu,[9]Reia,Crystal

Ruby is the name of aprogramming language that was created in the mid-1990s byYukihiro "Matz" Matsumoto inJapan. Like other programming languages, such asPython, itsstructure (the way it works) is very similar to theEnglish language. It has thesequalities:

  • Terse. Short, but still easy to understand.
  • Dynamic. Easy to change, anytime and anywhere.
  • Duck typing. If you think you understand it, you probably understand it.

Many programmers like it because the creator tried to make it easy and nice to use.[10]

Ruby on Rails (RoR) is aweb application framework that is implemented using the Ruby language.[11]

Example

[change |change source]

An exampleHello World program in Ruby:

puts"Hello World!"

An example program in Ruby that asks for your name and then says it:

puts"What's your name?"name=gets.chompputs"Ah hello there,#{name}"

A function in Ruby that joins the 2 strings (or arrays/integers) into one, removes all numbers from it, capitalizes the string and then repeats it 5 times:

defsomefunction(arg1,arg2)# creates a function with 2 arguments. the args can be called anythingarg=arg1+arg2# this joins them into 1 stringarg=arg.tr("1234567890","")# this replaces all the numbers with a nothing. erases them essentially.arg=arg.capitalize# read that out loud5.timesdo# read that out loud tooputsarg# prints it on a new lineendendsomefunction("h1e2l6lo7,"," W5o6r8l9d!3")# does the function

Output:

Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!

References

[change |change source]
  1. https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/.{{cite web}}:Missing or empty|title= (help)
  2. "COPYING in Ruby official source repository". Archived fromthe original on 2017-03-20. Retrieved2013-04-22.
  3. "BSDL in Ruby official source repository". Archived fromthe original on 2022-03-21. Retrieved2013-04-22.
  4. 123Cooper, Peter (2009).Beginning Ruby: From Novice to Professional. Beginning from Novice to Professional (2nd ed.). Berkeley:Apress. p. 101.ISBN 978-1-4302-2363-4.To a lesser extent, Python, LISP, Eiffel, Ada, and C++ have also influenced Ruby.
  5. 123456Bini, Ola (2007).Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java. Berkeley: APress. p. 3.ISBN 978-1-59059-881-8.It draws primarily on features from Perl, Smalltalk, Python, Lisp, Dylan, and CLU.
  6. Intro – D Programming Language 1.0 – Digital Mars
  7. Bertels, Christopher (23 February 2011)."Introduction to Fancy".Rubinius blog. Engine Yard. Archived fromthe original on 2018-12-25. Retrieved2011-07-21.
  8. Bini, Ola."Ioke".Ioke.org. Archived fromthe original on 2011-07-21. Retrieved2011-07-21.inspired by Io, Smalltalk, Lisp and Ruby
  9. Burks, Tim."About Nu™".Programming Nu™. Neon Design Technology, Inc. Archived fromthe original on 2011-07-24. Retrieved2011-07-21.
  10. "About ruby".
  11. "What is the difference between Ruby and Ruby on Rails?".

Other websites

[change |change source]
Wikimedia Commons has media related toRuby programming language.
The EnglishWikibooks has more information on:


Thisshort article abouttechnology can be made longer. You can help Wikipedia byadding to it.
Retrieved from "https://simple.wikipedia.org/w/index.php?title=Ruby_(programming_language)&oldid=9388588"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp