Programming Ruby 1.9: the pragmatic programmers' guide
Gespeichert in:
Hauptverfasser: | , , |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Raleigh, NC [u.a.]
The Pragmatic Bookshelf
2011
|
Ausgabe: | 4.0 print. |
Schriftenreihe: | The facets of ruby series
The pragmatic programmers |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | Previous ed.: 2005 |
Beschreibung: | XXII, 920 S. Ill. 23 cm |
ISBN: | 9781934356081 1934356085 |
Internformat
MARC
LEADER | 00000nam a22000002c 4500 | ||
---|---|---|---|
001 | BV039712085 | ||
003 | DE-604 | ||
005 | 20230413 | ||
007 | t | ||
008 | 111118s2011 a||| |||| 00||| eng d | ||
020 | |a 9781934356081 |9 978-1-934356-08-1 | ||
020 | |a 1934356085 |9 1-934356-08-5 | ||
035 | |a (OCoLC)767783425 | ||
035 | |a (DE-599)BVBBV039712085 | ||
040 | |a DE-604 |b ger | ||
041 | 0 | |a eng | |
049 | |a DE-739 |a DE-188 | ||
080 | |a 004.43 | ||
082 | 0 | |a 005.133 |2 22 | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a ST 253 |0 (DE-625)143628: |2 rvk | ||
100 | 1 | |a Thomas, David |e Verfasser |4 aut | |
245 | 1 | 0 | |a Programming Ruby 1.9 |b the pragmatic programmers' guide |c Dave Thomas with Chad Fowler and Andy Hunt |
250 | |a 4.0 print. | ||
264 | 1 | |a Raleigh, NC [u.a.] |b The Pragmatic Bookshelf |c 2011 | |
300 | |a XXII, 920 S. |b Ill. |c 23 cm | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a The facets of ruby series | |
490 | 0 | |a The pragmatic programmers | |
500 | |a Previous ed.: 2005 | ||
650 | 4 | |a Ruby (Computer program language) | |
650 | 0 | 7 | |a Ruby |g Programmiersprache |0 (DE-588)4653817-3 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Ruby |g Programmiersprache |0 (DE-588)4653817-3 |D s |
689 | 0 | |5 DE-604 | |
700 | 1 | |a Fowler, Chad |e Verfasser |0 (DE-588)139216308 |4 aut | |
700 | 1 | |a Hunt, Andrew |d 1964- |e Verfasser |0 (DE-588)133675025 |4 aut | |
856 | 4 | 2 | |m Digitalisierung UB Passau |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=024560422&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-024560422 |
Datensatz im Suchindex
_version_ | 1804148587481792512 |
---|---|
adam_text | Contents
Foreword
xiii
Preface
xv
Why Ruby?
.................................... xv
Ruby Versions
................................... xvi
Changes in the Book
................................ xvi
Resources
..................................... xvii
Acknowledgments
................................. xvii
Notation Conventions
............................... xix
Road Map
xxi
I Facets of Ruby
1
1
Getting Started
3
1.1
The Command Prompt
.......................... 3
1.2
Installing Ruby
.............................. 5
1.3
Running Ruby
.............................. 10
1.4
Ruby Documentation: RDoc and ri
................... 12
2
Ruby.new
15
2.1
Ruby Is an Object-Oriented Language
.................. 15
2.2
Some Basic Ruby
............................. 17
2.3
Arrays and Hashes
............................ 20
2.4
Symbols
.................................. 22
2.5
Control Structures
............................ 23
2.6
Regular Expressions
........................... 24
2.7
Blocks and Iterators
........................... 26
2.8
Reading and Riting
........................... 28
2.9
Command-Line Arguments
....................... 29
2.10
Onward and Upward
........................... 29
Classes,
Objects, and Variables
31
3.1
Objects and Attributes
.......................... 34
3.2
Classes Working with Other Classes
................... 39
3.3
Access Control
.............................. 42
3.4
Variables
................................. 45
Containers, Blocks, and Iterators
47
4.1
Arrays
................................... 47
4.2
Hashes
.................................. 50
4.3
Blocks and Iterators
........................... 54
4.4
Containers Everywhere
.......................... 69
Sharing Functionality: Inheritance, Modules, and Mixins
71
5.1
Inheritance and Messages
........................ 71
5.2
Modules
.................................. 76
5.3
Mixins
................................... 78
5.4
Iterators and the Enumerable Module
.................. 80
5.5
Composing Modules
........................... 80
5.6
Inheritance, Mixins, and Design
..................... 83
Standard Types
85
6.1
Numbers
................................. 85
6.2
Strings
................................... 88
6.3
Ranges
.................................. 92
Regular Expressions
97
7.1
What Regular Expressions Let You Do
................. 97
7.2
Ruby s Regular Expressions
....................... 98
7.3
Digging Deeper
.............................. 100
7.4
Advanced Regular Expressions
..................... 109
More About Methods
117
8.1
Defining a Method
............................ 117
8.2
Calling a Method
............................. 120
Expressions
125
9.1
Operator Expressions
........................... 125
9.2
Miscellaneous Expressions
........................ 127
9.3
Assignment
................................ 128
9.4
Conditional Execution
.......................... 132
9.5
case Expressions
............................. 136
9.6
Loops
................................... 138
9.7
Variable Scope, Loops, and Blocks
................... 142
10
Exceptions, catch,
and throw
145
10.1
The Exception
Class
........................... 145
10.2
Handling
Exceptions
........................... 147
10.3
Raising
Exceptions
............................ 150
10.4
catch
and throw
.............................. 152
11
Basic
Input and Output
155
11.1
What Is
an
IO
Object?..........................
155
11.2
Opening and Closing Files
........................ 156
11.3
Reading and Writing Files
........................ 157
11.4
Talking to Networks
........................... 160
11.5
Parsing HTML
.............................. 162
12
Fibers, Threads, and Processes
163
12.1
Fibers
................................... 163
12.2
Multithreading
.............................. 165
12.3
Controlling the Thread Scheduler
.................... 169
12.4
Mutual Exclusion
............................. 169
12.5
Running Multiple Processes
....................... 173
13
Unit Testing
177
13.1
The Testing Framework
......................... 179
13.2
Structuring Tests
............................. 183
13.3
Organizing and Running Tests
...................... 185
13.4
RSpec and Shoulda
............................ 188
14
When Trouble Strikes!
199
14.1
Ruby Debugger
.............................. 199
14.2
Interactive Ruby
............................. 200
14.3
Editor Support
.............................. 201
14.4
But It Doesn t Work!
........................... 203
14.5
But It s Too Slow!
............................ 206
II Ruby in Its Setting
211
15
Ruby and Its World
213
15.1
Command-Line Arguments
....................... 213
15.2
Program Termination
........................... 217
15.3
Environment Variables
.......................... 217
15.4
Where Ruby Finds Its Libraries
..................... 218
15.5
RubyGems Integration
.......................... 219
15.6
The Rake Build Tool
........................... 224
15.7
Build Environment
............................ 227
16
Namespaces, Source Files, and Distribution
229
16.1
Namespaces
................................ 229
16.2
Organizing Your Source
......................... 230
16.3
Distributing and Installing Your Code
.................. 237
17
Character Encoding
243
17.1
Encodings
................................. 244
17.2
Source Files
................................ 245
17.3
Transcoding
................................ 249
17.4
Input and Output Encoding
........................ 251
17.5
Default External Encoding
........................ 253
17.6
Encoding Compatibility
......................... 254
17.7
Default Internal Encoding
........................ 255
17.8
Fun with Unicode
............................. 255
18
Interactive Ruby Shell
257
18.1
Command Line
.............................. 257
18.2
Commands
................................ 265
19
Documenting Ruby
269
19.1
Adding RDoc to Ruby Code
....................... 269
19.2
Adding RDoc to
С
Extensions
...................... 276
19.3
Running RDoc
.............................. 277
20
Ruby and the Web
283
20.1
Writing CGI Scripts
........................... 283
20.2
Using cgi.rb
................................ 284
20.3
Templating Systems
........................... 287
20.4
Cookies
.................................. 291
20.5
Choice of Web Servers
.......................... 292
20.6
Frameworks
................................ 293
21
Ruby and Microsoft Windows
295
21.1
Running Ruby Under Windows
..................... 295
21.2
Win32API
................................. 296
21.3
Windows Automation
.......................... 296
Ill Ruby Crystallized
303
22
The Ruby Language
305
22.1
Source File Encoding
........................... 305
22.2
Source Layout
.............................. 305
22.3
The Basic Types
............................. 307
22.4
Names
................................... 314
22.5
Variables and Constants
......................... 316
22.6
Expressions, Conditionals, and Loops
.................. 326
22.7
Method Definition
............................ 333
22.8
Invoking a Method
............................ 336
22.9
Aliasing
.................................. 339
22.10
Class Definition
.............................. 340
22.11
Module Definitions
............................ 342
22.12
Access Control
.............................. 343
22.13
Blocks, Closures, and
Proc
Objects
................... 344
22.14
Exceptions
................................ 348
22.15
catch and throw
.............................. 350
23
Duck Typing
351
23.1
Classes Aren t Types
........................... 352
23.2
Coding like a Duck
............................ 356
23.3
Standard Protocols and Coercions
.................... 357
23.4
Walk the Walk, Talk the Talk
....................... 363
24
Metaprogramming
365
24.1
Objects and Classes
............................ 365
24.2
Singletons
................................. 368
24.3
Inheritance and Visibility
......................... 374
24.4
Modules and Mixins
........................... 375
24.5
Metaprogramming Class-Level Macros
................. 378
24.6
Two Other Forms of Class Definition
.................. 382
24.7
instance_eval and class_eval
....................... 385
24.8
Hook Methods
.............................. 389
24.9
One Last Example
............................ 395
24.10
Top-Level Execution Environment
.................... 397
24.11
The Turtle Graphics Program
...................... 398
25
Reflection, ObjectSpace, and Distributed Ruby
401
25.1
Looking at Objects
............................ 401
25.2
Looking at Classes
............................ 403
25.3
Calling Methods Dynamically
...................... 404
25.4
System Hooks
.............................. 406
25.5
Tracing Your Program s
Execution
................... 408
25.6
Behind the Curtain: The Ruby
VM
................... 410
25.7
Marshaling and Distributed Ruby
.................... 411
25.8
Compile Time? Runtime? Anytime!
................... 415
26
Locking Ruby in the Safe
417
26.1
Safe Levels
................................ 418
26.2
Tainted Objects
.............................. 419
26.3
Trusted Objects
.............................. 419
IV Ruby Library Reference
423
27
Built-in Classes and Modules
425
Array:
430
BasicObject:
449
Bignum:
454
Binding:
457
Class:
458
Comparable:
460
Complex:
461 Dir: 466
Encoding:
472
Enumerable:
476
Enumerator:
489
Ermo:
494
Exception:
495
FalseClass:
498
Fiber:
499
File:
500
File::
Stat:
516
FileTest:
523
Fixnum:
524
Float:
528
GC:
533
GC: ¡Profiler:
535
Hash:
536
Integer:
548
IO:
552
Kernel:
573
Marshal:
574
MatchData:
576
Math:
580
Method:
584
Module:
587
Mutex:
606
NilClass:
607
Numeric:
609
Object:
618
ObjectSpace:
652
Proc:
654
Process:
658
Process::GID:
666
Process::Status:
668
Process::Sys:
671
Process::UID:
673
Range:
675
Random:
680
Rational:
681
Regexp:
684
Signal:
689
String:
691
Struct:
720
Struct::Tms:
725
Symbol:
726
Thread:
731
ThreadGroup:
739
Time:
741
TrueClass:
752
UnboundMethod:
753
28
Standard Library
757
Abbrev:
760
Base64:
761
Benchmark:
762
BigDecimal:
763
CGI:
764
CGI-Session: 766
CMath:
767
Complex:
768
Continuation:
769
coverage:
770
CSV:
771
Curses:
773
Date/DateTime:
774
DBM:
775
Delegator:
776
Digest:
777
DL:
778
dRuby:
779
English:
780 erb: 781
Etc:
783
expect:
784
Fcntl:
785
Fiber:
786
FileUtils:
787
Find:
788
Forwardable:
789
GDBM:
790
GetoptLong:
791
GServer:
792
Iconv:
793
IO/Wait:
794
IPAddr:
795
irb:
796
json:
797
Logger:
798
mathn:
799
Matrix:
800
MiniTest:
801
Monitor:
802
Mutex_m:
803
Net::FTP:
804
Net::HTTP:
805
Net::IMAP:
807
Net::POP:
808
Net::SMTP:
809
Net::Telnet:
810
NKF:
811
Observable:
812
open-uri:
813
ОрепЗ:
814
OpenSSL:815 OptionParser:
816
OpenStruct:
818
Pathname:
819
PP:
820
PrettyPrint:
821
prime:
822
Profile:
823
Profiler__:
824
PStore:
825
PTY:
826
Rational:
827
Readune:
828
Resolv:
829
REXML:
830
Rinda:
832
Ripper:
833
RSS:
835
Scanf:
836
SDBM:
837
SecureRandom:
838
Set:
839
Shellwords:
840
Singleton:
841
Socket:
842
StringlO:
843
StringScanner:
844
Syslog:
845 Tempfile: 846
Test::Unit:
847
thread:
848
Threads Wait:
849
Time:
850
Timeout:
851
Tk:
852
tmpdir:
853
Tracer:
854
TSort:
855
un:
856
URI:
857
WeakRef:
858
WEBrick:
859
WIN32OLE:
860
XMLRPC:
861
YAML:
862
Zlib:
863
Support
865
A.l
WebSites................................. 865
Α.
2 Usenet Newsgroup............................ 866
A.3 Mailing
Lists
............................... 866
A.4
Bug Reporting
.............................. 866
Bibliography
865
Index 871
|
any_adam_object | 1 |
author | Thomas, David Fowler, Chad Hunt, Andrew 1964- |
author_GND | (DE-588)139216308 (DE-588)133675025 |
author_facet | Thomas, David Fowler, Chad Hunt, Andrew 1964- |
author_role | aut aut aut |
author_sort | Thomas, David |
author_variant | d t dt c f cf a h ah |
building | Verbundindex |
bvnumber | BV039712085 |
classification_rvk | ST 250 ST 253 |
ctrlnum | (OCoLC)767783425 (DE-599)BVBBV039712085 |
dewey-full | 005.133 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.133 |
dewey-search | 005.133 |
dewey-sort | 15.133 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
edition | 4.0 print. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01712nam a22004452c 4500</leader><controlfield tag="001">BV039712085</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20230413 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">111118s2011 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781934356081</subfield><subfield code="9">978-1-934356-08-1</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1934356085</subfield><subfield code="9">1-934356-08-5</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)767783425</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV039712085</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-739</subfield><subfield code="a">DE-188</subfield></datafield><datafield tag="080" ind1=" " ind2=" "><subfield code="a">004.43</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.133</subfield><subfield code="2">22</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 253</subfield><subfield code="0">(DE-625)143628:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Thomas, David</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Programming Ruby 1.9</subfield><subfield code="b">the pragmatic programmers' guide</subfield><subfield code="c">Dave Thomas with Chad Fowler and Andy Hunt</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">4.0 print.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Raleigh, NC [u.a.]</subfield><subfield code="b">The Pragmatic Bookshelf</subfield><subfield code="c">2011</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXII, 920 S.</subfield><subfield code="b">Ill.</subfield><subfield code="c">23 cm</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">The facets of ruby series</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">The pragmatic programmers</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Previous ed.: 2005</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Ruby (Computer program language)</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Ruby</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4653817-3</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Ruby</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4653817-3</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Fowler, Chad</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)139216308</subfield><subfield code="4">aut</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Hunt, Andrew</subfield><subfield code="d">1964-</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)133675025</subfield><subfield code="4">aut</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=024560422&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-024560422</subfield></datafield></record></collection> |
id | DE-604.BV039712085 |
illustrated | Illustrated |
indexdate | 2024-07-10T00:09:30Z |
institution | BVB |
isbn | 9781934356081 1934356085 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-024560422 |
oclc_num | 767783425 |
open_access_boolean | |
owner | DE-739 DE-188 |
owner_facet | DE-739 DE-188 |
physical | XXII, 920 S. Ill. 23 cm |
publishDate | 2011 |
publishDateSearch | 2011 |
publishDateSort | 2011 |
publisher | The Pragmatic Bookshelf |
record_format | marc |
series2 | The facets of ruby series The pragmatic programmers |
spelling | Thomas, David Verfasser aut Programming Ruby 1.9 the pragmatic programmers' guide Dave Thomas with Chad Fowler and Andy Hunt 4.0 print. Raleigh, NC [u.a.] The Pragmatic Bookshelf 2011 XXII, 920 S. Ill. 23 cm txt rdacontent n rdamedia nc rdacarrier The facets of ruby series The pragmatic programmers Previous ed.: 2005 Ruby (Computer program language) Ruby Programmiersprache (DE-588)4653817-3 gnd rswk-swf Ruby Programmiersprache (DE-588)4653817-3 s DE-604 Fowler, Chad Verfasser (DE-588)139216308 aut Hunt, Andrew 1964- Verfasser (DE-588)133675025 aut Digitalisierung UB Passau application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=024560422&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Thomas, David Fowler, Chad Hunt, Andrew 1964- Programming Ruby 1.9 the pragmatic programmers' guide Ruby (Computer program language) Ruby Programmiersprache (DE-588)4653817-3 gnd |
subject_GND | (DE-588)4653817-3 |
title | Programming Ruby 1.9 the pragmatic programmers' guide |
title_auth | Programming Ruby 1.9 the pragmatic programmers' guide |
title_exact_search | Programming Ruby 1.9 the pragmatic programmers' guide |
title_full | Programming Ruby 1.9 the pragmatic programmers' guide Dave Thomas with Chad Fowler and Andy Hunt |
title_fullStr | Programming Ruby 1.9 the pragmatic programmers' guide Dave Thomas with Chad Fowler and Andy Hunt |
title_full_unstemmed | Programming Ruby 1.9 the pragmatic programmers' guide Dave Thomas with Chad Fowler and Andy Hunt |
title_short | Programming Ruby 1.9 |
title_sort | programming ruby 1 9 the pragmatic programmers guide |
title_sub | the pragmatic programmers' guide |
topic | Ruby (Computer program language) Ruby Programmiersprache (DE-588)4653817-3 gnd |
topic_facet | Ruby (Computer program language) Ruby Programmiersprache |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=024560422&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT thomasdavid programmingruby19thepragmaticprogrammersguide AT fowlerchad programmingruby19thepragmaticprogrammersguide AT huntandrew programmingruby19thepragmaticprogrammersguide |