64. class String
def hello(name)
"#{self}, #{name}"
end
end
65. class String
def hello(name)
"#{self}, #{name}"
end
end
"Hello".hello "Fabio"
=> "Hello, Fabio"
66. class String
def hello(name)
"#{self}, #{name}"
end
end
"Hello".hello "Fabio" Classes
=> "Hello, Fabio"
Abertas!
67. module Legal
def bu!
"Buuu!"
end
end
class String
include Legal
end
class Fixnum
include Legal
end
"foo".bu!
=> "Buuu!"
10.bu!
=> "Buuu!"
68. module Legal
def bu!
"Buuu!"
end
end
class String
include Legal
end
class Fixnum
include Legal
end
"foo".bu!
=> "Buuu!"
10.bu!
=> "Buuu!"
69. module Legal
def bu!
"Buuu!"
end
end
class String
include Legal
end
class Fixnum
Module
include Legal
end Mixin
"foo".bu!
=> "Buuu!"
10.bu!
=> "Buuu!"
70. module Legal
def bu!
"Buuu!"
end
end
class String
include Legal
end
class Fixnum
Module
include Legal
end Mixin
"foo".bu!
=> "Buuu!"
10.bu!
=> "Buuu!"
71. module Legal
def bu!
"Buuu!"
end
end
class String
include Legal
end
class Fixnum
Module
include Legal
end Mixin
"foo".bu!
=> "Buuu!"
10.bu!
=> "Buuu!"
93. require 'builder'
xml = Builder::XmlMarkup.new
xml.instruct! :xml <?xml version="1.1"
encoding="US-ASCII"?>
xml.Hello "World!" <Hello>World!</Hello>
xml.date do <date>
xml.year "2006" <year>2006</year>
xml.month "01" <month>01</month>
xml.day "01" <day>01</day>
end </date>
94. require 'builder'
xml = Builder::XmlMarkup.new
xml.instruct! :xml <?xml version="1.1"
encoding="US-ASCII"?>
xml.Hello "World!" <Hello>World!</Hello>
xml.date do <date>
xml.year "2006" <year>2006</year>
xml.month "01" <month>01</month>
xml.day "01" <day>01</day>
end </date>
95. require 'builder'
xml = Builder::XmlMarkup.new
xml.instruct! :xml <?xml version="1.1"
encoding="US-ASCII"?>
xml.Hello "World!" <Hello>World!</Hello>
xml.date do <date>
xml.year "2006" <year>2006</year>
xml.month "01" <month>01</month>
xml.day "01" <day>01</day>
end </date>
96. require 'builder'
xml = Builder::XmlMarkup.new
xml.instruct! :xml <?xml version="1.1"
encoding="US-ASCII"?>
xml.Hello "World!" <Hello>World!</Hello>
xml.date do <date>
xml.year "2006" <year>2006</year>
xml.month "01" <month>01</month>
xml.day "01" <day>01</day>
end </date>
97. require 'builder'
xml = Builder::XmlMarkup.new
xml.instruct! :xml <?xml version="1.1"
encoding="US-ASCII"?>
xml.Hello "World!" <Hello>World!</Hello>
xml.date do <date>
xml.year "2006" <year>2006</year>
xml.month "01" <month>01</month>
xml.day "01" <day>01</day>
end </date>
98.
99. require 'rubygems'
require 'mechanize'
a = Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
end
a.get('http://google.com/') do |page|
search_result = page.form_with(:name => 'f') do |search|
search.q = 'Hello world'
end.submit
search_result.links.each do |link|
puts link.text
end
end
100. require 'rubygems'
require 'mechanize'
a = Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
end
a.get('http://google.com/') do |page|
search_result = page.form_with(:name => 'f') do |search|
search.q = 'Hello world'
end.submit
search_result.links.each do |link|
puts link.text
end
end
101. require 'rubygems'
require 'mechanize'
a = Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
end
a.get('http://google.com/') do |page|
search_result = page.form_with(:name => 'f') do |search|
search.q = 'Hello world'
end.submit
search_result.links.each do |link|
puts link.text
end
end
102. require 'rubygems'
require 'mechanize'
a = Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
end
a.get('http://google.com/') do |page|
search_result = page.form_with(:name => 'f') do |search|
search.q = 'Hello world'
end.submit
search_result.links.each do |link|
puts link.text
end
end
103.
104. class Twitter
include HTTParty
base_uri 'twitter.com'
basic_auth 'username', 'password'
end
Twitter.post('/statuses/update.json',
:query => {
:status => "It's an HTTParty and everyone is invited!"
})
105. class Twitter
include HTTParty
base_uri 'twitter.com'
basic_auth 'username', 'password'
end
Twitter.post('/statuses/update.json',
:query => {
:status => "It's an HTTParty and everyone is invited!"
})
106.
107.
108.
109.
110.
111.
112.
113. 1990 1995
PostScript level 2 PostScript level 3
1992 september 11, 1996
OO Forth
Forth 1987
986
ect Logo Tcl Tcl/Tk
1986 mid 1988 end 1988
Fortran 90 ISO
1991
A A+
1988 1992
J K
MPS (FIPS) 1990 MUMPS ISO 1996
M M ANSI Open M
1986 1992 1994 dec 8, 1995 dec 11, 1995
Modula 3 Delphi
1988 march 2, 1995 APL96
1996
ABC
1987
Python
Borland 1991
Object Pascal
1985 Turbo Pascal
ANSI Rexx
f
Oberon Oberon-2
1987 1991
Modula-2 ISO
Ada 95 june 1, 1996
Ada ISO
1987 1995
NetRexx
1991
ANSI C ISO C ISO C
(C89) (C90) (C95)
1989 december 15, 1990 april 1, 1996 JScrip
may 19
Cmm LiveScript JavaScript
1992 1995 december 1995
ARM C++
1989
Oak Java 1
june 1991 may 23, 1995
Ruby
february 24, 1993 Ruby 0.95
december 1995
Self Self 4.0
Eiffel Eiffel 2 Eiffel 3 july 10, 1995 Eiffel 4
1986 1988 1993 december 11, 1996
PHP/FI
1995
Sather 0.1 Sather 1.0 Sather 1.1
june 1991 mid-1994 september 1995
Perl 1.000 Perl 2.000 Perl 3.000 Perl 4.000 Perl 5.000
ecember 18, 1987 january 5, 1988 october 18, 1989 march 21, 1991 october 18, 1994
Objective Caml
1996
sic 1.0 QuickBasic 4.5 MS Basic PDS 7.0 MS PDS 7.1 Visual Basic 3.0 Visual Basic 4.0
1989 Visual Basic 1.0 Visual Basic 2.0
5 1988 1990 may 20, 1991 march 1992 june 93 september 1995
Clos
1989 Common Lisp ANSI
december 8, 1994
Scheme IEEE
1990
Haskell 1.0 Haskell 1.1 Haskell 1.2 Haskell 1.3
1987 april 1, 1990 march 1992 may 1996
SML ‘90
1990
ml Caml 2-6.1 Caml 3.1
87 1991 1993
114. 1990 1995
PostScript level 2 PostScript level 3
1992 september 11, 1996
OO Forth
Forth 1987
986
ect Logo Tcl Tcl/Tk
1986 mid 1988 end 1988
Fortran 90 ISO
1991
A A+
1988 1992
J K
MPS (FIPS) 1990 MUMPS ISO 1996
M M ANSI Open M
1986 1992 1994 dec 8, 1995 dec 11, 1995
Modula 3 Delphi
1988 march 2, 1995 APL96
1996
ABC
1987
Python
Borland 1991
Object Pascal
1985 Turbo Pascal
ANSI Rexx
f
Oberon Oberon-2
1987 1991
Modula-2 ISO
Ada 95 june 1, 1996
Ada ISO
1987 1995
NetRexx
1991
ANSI C ISO C ISO C
(C89) (C90) (C95)
1989 december 15, 1990 april 1, 1996 JScrip
may 19
Cmm LiveScript JavaScript
1992 1995 december 1995
ARM C++
1989
Oak Java 1
june 1991 may 23, 1995
Ruby
february 24, 1993 Ruby 0.95
december 1995
Self Self 4.0
Eiffel Eiffel 2 Eiffel 3 july 10, 1995 Eiffel 4
1986 1988 1993 december 11, 1996
PHP/FI
1995
Sather 0.1 Sather 1.0 Sather 1.1
june 1991 mid-1994 september 1995
Perl 1.000 Perl 2.000 Perl 3.000 Perl 4.000 Perl 5.000
ecember 18, 1987 january 5, 1988 october 18, 1989 march 21, 1991 october 18, 1994
Objective Caml
1996
sic 1.0 QuickBasic 4.5 MS Basic PDS 7.0 MS PDS 7.1 Visual Basic 3.0 Visual Basic 4.0
1989 Visual Basic 1.0 Visual Basic 2.0
5 1988 1990 may 20, 1991 march 1992 june 93 september 1995
Clos
1989 Common Lisp ANSI
december 8, 1994
Scheme IEEE
1990
Haskell 1.0 Haskell 1.1 Haskell 1.2 Haskell 1.3
1987 april 1, 1990 march 1992 may 1996
SML ‘90
1990
ml Caml 2-6.1 Caml 3.1
87 1991 1993
115. 1954 1957 1960 1965 1970 1975 1980 1985
PostScript
1982
Forth FIG-Forth Forth-83 ANS Forth
1968 1978 1983 1986
Logo Object L
1968 1986
FORTRAN I FORTRAN II FORTRAN III FORTRAN IV FORTRAN IV FORTRAN V
FORTRAN (Fortran 66 ANS) (Fortran 77 ANSI)
november 1954 october 1956 1957 end-1958 1962
1966 april 1978
Prolog Prolog II Prolog III
1970 october 1982 1984
Sharp APL
JOSS TELCOMP MUMPS MUMPS (ANSI) MUMPS (
1964 1965 1966 september 15, 1977 1986
APL APL 2
1960 august 1984
B
1981
Obj
B-O Flow-Matic COBOL COBOL 61 COBOL 61 COBOL COBOL 68 ANS COBOL 74 ANSI COBOL 85 ISO/ANSI
1957 1958 1959 1961 Extended 1965 1968 1974 1985
1962 Rex 1.00 Rex 2.00 Rex 3.00 Rexx 3.20
may 1979 1980 1982 1984
Pascal Pascal AFNOR
1970 1983
PL/M Modula Modula 2
1972 1975 1979
Ada Ada 83 ANSI
1979 january 1983
PL/I PL/1 ANS
1964 1976 Concurrent C
1984
CPL BCPL B C C (K&R)
july 1967 1978 Classic C
1963 1969 1971
JOVIAL JOVIAL I JOVIAL II JOVIAL 3 Objective-C
1959 1960 1961 1965 1983
CORAL 64 CORAL 66 C with Classes
1964 1966 C++
april 1980 july 1983
CLU
Simula 67 1974
Simula I
1964 1967
ALGOL W Mesa
ALGOL 58 ALGOL 60 1966 ALGOL 68 1977
IAL Cedar
1958 1958 1960 december 1983
1968
GOGOL GOGOL III Smalltalk Smalltalk-72 Smalltalk-74 Smalltalk-76 Smalltalk-78 Smalltalk-80
1964 1967 1971 1972 1974 1976 1978 1980
sed
Sail 1973 Mainsail
1968 1975
ISWIM awk nawk
1966 1978 1985
KRC
1981
csh
SASL october 1978
Per
1976 Miranda decemb
1982
sh
1969
BASIC MS Basic 2.0 BASICA GW-Basic QuickBasic 1.0
may 1, 1964 july 1975 1981 1983 1985
Lisp Lisp 1 Lisp 1.5 Common Lisp
1958 1959 1962 1984
Scheme Scheme MIT Scheme 84
1975 1978 1984
ML SML
1973 1984
SL5 Icon
Languages SNOBOL SNOBOL 2 SNOBOL 3 SNOBOL 4 1976 1977
february 27, 2011 Caml
1962 april 1964 1965 1967 1987
! Éric Lévénez 1999-2011
<http://www.levenez.com/lang/>
1 2 3 4