Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur
Ruby etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Ruby etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

18 Ocak 2012 Çarşamba

Ruby

Yüklü RUBY versiyonunu anlamak

cem@ubuntu:~$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
cem@ubuntu:~$ 

Interactive Ruby Shell (IRB)

is a shell for programming in the object-oriented scripting language Ruby.The program is launched from a command line and allows the execution of Ruby commands with immediate response, experimenting in real-time. It features command history, line editing capabilities, and job control, and is able to communicate directly as a shell script over the Internet and interact with a live server.

IRB ekranını temizlemek

için Mac OSX veya Linux üzerinde Ctrl + L kullanılabilir. Ya da konsol üzerinde irb(main):002:0> system 'clear' çalıştırılabilir.

irb(main):007:0> str = "teach me to code"
=> "teach me to code"
irb(main):008:0> str.capitalize
=> "Teach me to code"
irb(main):009:0> str.upcase
=> "TEACH ME TO CODE"
irb(main):010:0> str.gsub("code","fly")
=> "teach me to fly"
irb(main):002:0> str.gsub(/[aeoiu]/,"*")
=> "t**ch m* t* c*d*"
irb(main):003:0> 

Linux üzerindeki Ruby kurulumlarını öğrenmek

echo PATH
is rub*
pwd

Hangi Ruby ile çalışsın & .rb dosyasını Executable(çalıştırılabilir) hale getirmek

...admin$ chmod a+x hellotest.rb
...admin$ ./hellotest.rb