(→Enlaces externos: quito enlace a wikilibros que aquí no funciona) |
(cambio categoría en plantilla) |
||
| (No se muestran 2 ediciones intermedias realizadas por 2 usuarios) | |||
| Línea 4: | Línea 4: | ||
| versión_estable = 1.9.0 | | versión_estable = 1.9.0 | ||
| fecha_versión_estable = 25 de diciembre de 2007 | | fecha_versión_estable = 25 de diciembre de 2007 | ||
| − | | género = [[:Categoría:lenguajes|Lenguaje de programación]] | + | | género = [[:Categoría:lenguajes de programación|Lenguaje de programación]] |
| licencia = [[w:software libre|libre]] ([http://www.ruby-lang.org/es/about/license.txt Ruby]) | | licencia = [[w:software libre|libre]] ([http://www.ruby-lang.org/es/about/license.txt Ruby]) | ||
| web = [http://www.ruby-lang.org/es/ www.ruby-lang.org] | | web = [http://www.ruby-lang.org/es/ www.ruby-lang.org] | ||
| Línea 34: | Línea 34: | ||
#! /usr/bin/env ruby | #! /usr/bin/env ruby | ||
| − | def hola(nombre) | + | def hola(nombre) |
puts "Hola #{nombre.capitalize}" | puts "Hola #{nombre.capitalize}" | ||
| + | end | ||
hola("usuario") | hola("usuario") | ||
| Línea 52: | Línea 53: | ||
* [http://www.ruby-lang.org/es/ Sitio web oficial de Ruby]. | * [http://www.ruby-lang.org/es/ Sitio web oficial de Ruby]. | ||
| − | [[Categoría:Lenguajes]] | + | [[Categoría:Lenguajes de programación]] |
| Ruby | |
|---|---|
| Desarrollador:
|
Yukihiro Matsumoto |
| Género:
|
Lenguaje de programación |
| Licencia:
|
libre (Ruby) |
| En Español:
|
No |
| Sitio Web:
|
www.ruby-lang.org |
Ruby es un lenguaje de programación interpretado y orientado a objetos, de alto nivel, desarrollado principalmente por Yukihiro Matsumoto. Dispone de un intérprete interactivo, y también puede ejecutar scripts.
Contenido |
Para tener el intérprete de Ruby, instala los paquetes ruby e irb del repositorio main de Ubuntu.
Para iniciar el intérprete interactivo de Ruby desde terminal, ejecuta el siguiente comando:
irb
Si quieres ejecutar un script en Python, debes ejecutar este otro comando:
ruby <fichero.rb>
Un ejemplo de programa en Ruby:
#! /usr/bin/env ruby
def hola(nombre)
puts "Hola #{nombre.capitalize}"
end
hola("usuario")
Esto mostraría por pantalla el siguiente mensaje:
Hola Usuario