3GL - .   4GL -     DB-

Ruby

Ruby - - . , , . Ruby , - Smalltalk. Python, , Dylan CLU. . 1.9.0, 25 2007.

Ruby (Matz) , . Ruby 24 1993 1995 . , Ruby: . pearl , . ruby .
-, , .
:
Ruby 23 1993 . - . (Perl4, Perl5), ( ). - . . , - . OO . , - , , , -, . , .
. , . , , , . . 1995 Ruby 0.95 . , . . , ruby-list, 14789 .
Ruby 1995 , . 1997 Ruby , 1998 ruby-talk. . , . Ruby GNU/Linux, .

, - , , , , -, Python. Ruby , , , .
: , . , Ruby , . , , , .
Ruby . , . , , , , .
, . , , ( , ), .
- , , , . , . , , , .
(. Ruby Way). , , , , , , , , . .

Ruby - . , , . .
Ruby , . , . , , . :
a = "abcdefg"   =>   "abcdefg"
b = a           =>   "abcdefg"
b               =>   "abcdefg"
a[3] = 'R'      =>   "R"
b               =>   "abcRefg"
a b, . , , , - (, , Object Pascal).
Ruby , . ( ) Object, , (, class, to_s, nil?). , Object.
Ruby : ( ), - ( ), ( , , , ). , , .

Ruby

, , Python.
Java Python.
, .
- . Ruby Smalltalk. , Ruby Smalltalk . , 1 Fixnum. .
, , .
. Ruby, .
Ruby - , - API.
.
( { } do end). .
Ruby Fixnum (32-) Bignum ( 32 ) , .
, , nil ( , , ). . : var , @var ( ), @@var , $var .
Ruby , , , (singleton) ( ) (. ).
, .
.
. GNU/Linux, Unix, DOS, Microsoft Windows ( , Win32), Mac OS, BeOS, OS/2 . .

Ruby , . , . , .
                   # :   #      
                   # =   ,
                   #   " - ,     
  str = ""   #    str,  String
                   # def -     
  def str.bye      # str. ,    (  Object)
                   # bye -  ,     ,  
                   #     
    "!"        #       ( - )
  end              #   end     Ruby
                   # puts - ,
                   # str.bye -    bye  str
                   # ,    bye   puts
                   #     
  puts str.bye     #=> !
, Ruby . str.
Ruby . :
                   #  if    , ,   ,
                   #     then  else,   else  end
  puts( if 5 > 3 then "" else "" end )   #=> 
                   #     var,   
                   #    var,    
  puts( var = 5 )                                  #=> 5

Ruby. , .
                           #  
 a = [1, 'hi', 3.14, 1, 2, [4, 5] * 3]
                           # => [1, "hi", 3.14, 1, 2, [4, 5, 4, 5, 4, 5]]
                           #   
 a[2]                      # => 3.14
                           #    ,   
 a.flatten.uniq            # => [1, 'hi', 3.14, 2, 4, 5]
                           #       4
 a.index(4)                # => nil
                           #      -   
                           #  ,  Ruby      
                           #    ,    !,
                           #   
 a.flatten!                # => [1, "hi", 3.14, 1, 2, 4, 5, 4, 5, 4, 5]
 a.index(4)                # => 5

2 :
 { puts "Hello, World!" }
 
 do puts "Hello, World!" end
:
 File.open('file.txt', 'w') { |file| #   file.txt   (w - write)
   file.puts 'Wrote some text.'
 } #      :     
, Ruby ( 0 10 ):
 (0..10).collect{|v| v ** 2 }.select{ rand(2) == 1 }.each_with_index{|v,i| printf "%2d\t%2d\n", i, v }

, , ,

Person, .
 class Person                #       class,  
                             #  
   include Comparable        # [[b:Ruby//Comparable|Comparable]]    
                             #    <, <=, ==, >=, >  between?
                             #   
                             #   <=>
                             #
   @@count_obj = 0           #       
                             # 
                             #       new
   def initialize(name, age) # name, age -  
                             #      @
     @name, @age = name, age # c      1
     @@count_obj += 1
   end
 
   def <=>(person)           #   <=>
                             # (     sort
     @age <=> person.age     #      ,
   end
 
   def to_s                  #     puts
     "#{@name} (#{@age})"    #  #{x}  2-    Ruby  x
   end
 
   def inspect               #   to_s,     
     "<#{@@count_obj}:#{to_s}>"
   end
                             #  :     
                             #  
   attr_reader :name, :age
 end
                             #   
 group = [ Person.new("John", 20),
          Person.new("Markus", 63),
          Person.new("Ash", 16) ]
                      # => [<3:John (20)>, <3:Markus (63)>, <3:Ash (16)>]
                      #     irb    inspect
                      #          
 puts group.sort.reverse # :
                         # Markus (63)
                         # John (20)
                         # Ash (16)
                                    #   ,   
                                    # ( <=>)   Comparable
 group[0].between?(group[2], group[1]) # => true

Ruby : , , JRuby Java, .NET IronRuby ( ), Rubinius Ruby Smalltalk-80 VM.
, Unix, Microsoft Windows ( Windows CE), DOS, Mac OS X, OS/2, Amiga, BeOS, Syllable, Acorn RISC OS .

Ruby

Ruby . irb , ():
 $ irb
 irb(main):001:0> "Hello, World"
 => "Hello, World"
 irb(main):002:0> 2 ** 256             # ** -    
 => 115792089237316195423570985008687907853269984665640564039457584007913129639936
irb =>. =>. irb .
One-Click Installer Windows, 1.8.2-15, fxri, (ri) (irb).

IDE

(Emacs, vim, jEdit, nano, SciTE .), IDE, .

ActiveState Komodo IDE GNU/Linux, Mac OS X, Solaris, Windows http://activestate.com/Products/komodo_ide/
Arachno Ruby IDE Win 2000/XP, GNU/Linux http://www.ruby-ide.com
Aptana (RadRails+RDT) CPL Java http://www.aptana.com/
Eclipse + RDT CPL Java RDT Homepage
FreeRIDE Ruby License Windows, OS X, POSIX http://freeride.rubyforge.org/
IntelliJ IDEA + Ruby plugin ( IDEA), Apache 2.0 (  plugin) Java, JRuby Ruby plugin
KDevelop GNU GPL Linux http://kdevelop.org/
Mondrian Ruby IDE MIT Ruby ( + FOX toolkit) http://www.mondrian-ide.com/
NetBeans IDE CDDL Java http://www.netbeans.org/features/ruby/
RDE Ruby License Windows http://homepage2.nifty.com/sakazuki/rde_en/
Ruby in steel Visual Studio 2005 http://www.sapphiresteel.com/
Xcode 3.1 Mac OS X 10.5 http://developer.apple.com/tools/xcode/

, , Ruby . , , , (XML, XSLT, YAML, PDF, RSS, CSV, WSDL). Ruby -, . , , , , , , . ..

  • Object
Ruby. 1.0
  • Array
, 0. 1.0
  • Binding
( , . .). . 1.2
  • Continuation
, (. . ). 1.4
  • Data
, . 1.0
  • Dir
. . 1.0
  • Exception
( 30 ) 1.0
  • FalseClass
false . 1.0
  • Hash
-; . 1.0
  • IO
-. 1.0
  • File
. 1.0
  • MatchData
    ( 1.6 MatchingData)
. , $&, $', $`, $1, $2 . . 1.0
  • Method
, ( ). . 1.2
  • Module
. 1.0
  • Class
; Ruby , Class (). 1.0
  • NilClass
nil. nil false . . 1.0
  • Numeric
. 1.0
  • Integer
. . 1.0
  • Bignum
. Fixnum, . 1.0
  • Fixnum
, (32 ). , Bignum. 1.0
  • Float
. 1.0
  • Proc
(), . 1.0
  • Range
: , . 1.0
  • Regexp
. 1.0
  • String
. 1.0
  • Struct
; , . 1.0
  • Symbol
:name. . 1.6
  • Thread
, Ruby. 1.0
  • ThreadGroup
. ThreadGroup. . 1.6
  • Time
. 1.0
  • TrueClass
true . 1.0
  • UnboundMethod
, . Method.. 1.6

Ruby , , .
Ruby DBI ( SQLite, Oracle, ODBC, MySQL, DB2, MS SQL, InterBase, ADO .). , . ORM , ActiveRecord, DataMapper Sequel.
FxRuby FOX, wxRuby ( c wxWidgets C++), QtRuby/Korundum Qt KDE , Tk Gtk. OpenGL, .
Win32utils Win32 API.
Rmagick , 90 ( ImageMagick GraphicsMagick).
Ruport (Ruby reports) CSV. PDF, HTML, CSV TXT.
RuTils Ruby. . 231.propisju(2) => 341.propisju_items(1, , , ) => . .
Ruby RubyGems (. gems, gem ).
Ruby RAA (Ruby Application Archive). 2007 . , Ruby, RubyForge, .
FreeRIDE IDE Ruby, FxRuby. (LGPL, Ruby) .

RDoc Ruby . - , Ruby.
Ruby Unix ri. , Ruby. - http://www.ruby-doc.org.

Ruby NASA, NOAA ( ), Motorola . Ruby ( ).
RPG Maker (RPG Maker XP) RGSS (Ruby Game Scripting System)
Amarok
SketchUp
XChat

KOffice Kross, , Ruby.
WATIR (. Web Application Testing in Ruby) - .

Ruby :
( ). Ruby - .
( Unix- ), 1.9.
( , 1.9).
. ( Ruby Java .NET , JRuby Ruby.NET). 2.0 YARV, Ruby . , , Rubinus Maglev.

          3GL - .   4GL -     DB-


, , Inheritance - - - , , (-) (-) . .




 10.11.2021 - 12:37: - Personalias -> WHO IS WHO - - _.
10.11.2021 - 12:36: - Conscience -> . ? - _.
10.11.2021 - 12:36: , , - Upbringing, Inlightening, Education -> ... - _.
10.11.2021 - 12:35: - Ecology -> - _.
10.11.2021 - 12:34: , - War, Politics and Science -> - _.
10.11.2021 - 12:34: , - War, Politics and Science -> . - _.
10.11.2021 - 12:34: , , - Upbringing, Inlightening, Education -> , - _.
10.11.2021 - 09:18: - New Technologies -> , 5G- - _.
10.11.2021 - 09:18: - Ecology -> - _.
10.11.2021 - 09:16: - Ecology -> - _.
10.11.2021 - 09:15: , , - Upbringing, Inlightening, Education -> - _.
10.11.2021 - 09:13: , , - Upbringing, Inlightening, Education -> - _.
Bourabai Research -  XXI Bourabai Research Institution