Ruby best practices:
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Sebastopol, CA
O'Reilly
2009
|
Ausgabe: | 1. Aufl. |
Schlagworte: | |
Online-Zugang: | Inhaltstext Inhaltsverzeichnis |
Beschreibung: | XVI, 309 S. |
ISBN: | 9780596523008 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV035718541 | ||
003 | DE-604 | ||
005 | 20090930 | ||
007 | t | ||
008 | 090910s2009 |||| 00||| eng d | ||
015 | |a 09,N27,0007 |2 dnb | ||
016 | 7 | |a 994782756 |2 DE-101 | |
020 | |a 9780596523008 |c PB. : EUR 34.00 (freier Pr.) |9 978-0-596-52300-8 | ||
024 | 3 | |a 9780596523008 | |
035 | |a (OCoLC)731203884 | ||
035 | |a (DE-599)DNB994782756 | ||
040 | |a DE-604 |b ger |e rakddb | ||
041 | 0 | |a eng | |
049 | |a DE-11 |a DE-739 | ||
050 | 0 | |a QA76.73.R83 | |
082 | 0 | |a 005.133 |2 22 | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a 004 |2 sdnb | ||
100 | 1 | |a Brown, Gregory |e Verfasser |4 aut | |
245 | 1 | 0 | |a Ruby best practices |c Gregory Brown |
250 | |a 1. Aufl. | ||
264 | 1 | |a Sebastopol, CA |b O'Reilly |c 2009 | |
300 | |a XVI, 309 S. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 4 | |a Object-oriented programming (Computer science) | |
650 | 4 | |a Ruby (Computer program language) | |
856 | 4 | 2 | |q text/html |u http://deposit.dnb.de/cgi-bin/dokserv?id=3321503&prov=M&dok_var=1&dok_ext=htm |3 Inhaltstext |
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=017995361&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-017995361 |
Datensatz im Suchindex
_version_ | 1805092894248271872 |
---|---|
adam_text |
Table
of
Contents
Foreword
. ix
Preface
. xi
1.
Driving Code Through Tests
.1
A Quick Note on Testing Frameworks
2
Designing for Testability
2
Testing Fundamentals
10
Well-Focused Examples
10
Testing Exceptions
11
Run the Whole Suite at Once
13
Advanced Testing Techniques
14
Using Mocks and Stubs
14
Testing Complex Output
22
Keeping Things Organized
26
Embedding Tests in Library Files
27
Test Helpers
27
Custom Assertions
29
Conclusions
30
2.
Designing Beautiful APIs
._. 31
Designing for Convenience: Ruport's TableQ feature
31
Ruby's Secret Power: Flexible Argument Processing
35
Standard Ordinal Arguments
36
Ordinal Arguments with Optional Parameters
36
Pseudo-Keyword Arguments
37
Treating Arguments As an Array
38
Ruby's Other Secret Power: Code Blocks
40
Working with Enumerable
41
Using Blocks to Abstract
Pre-
and Postprocessing
43
Blocks As Dynamic Callbacks
45
Blocks for Interface Simplification
47
Avoiding Surprises
48
Use attr_reader, attr_writer, and attr^accessor
48
Understand What method? and method! Mean
50
Make Use of Custom Operators
53
Conclusions
55
3.
Mastering the Dynamic Toolkit
.57
BlankSlate: A BasicObject on Steroids
57
Building Flexible Interfaces
62
Making instance_eval() Optional
63
Handling Messages with method_missing() and send()
65
Dual-Purpose Accessors
69
Implementing Per-Object Behavior
70
Extending and Modifying Preexisting Code
74
Adding New Functionality
75
Modification via Aliasing
79
Per-Object Modification
81
Building Classes and Modules Programmatically
84
Registering Hooks and Callbacks
88
Detecting Newly Added Functionality
89
Tracking Inheritance
91
Tracking Mixins
93
Conclusions
96
4.
Text Processing and File Management
.99
Line-Based File Processing with State Tracking
99
Regular Expressions
103
Don't Work Too Hard
105
Anchors Are Your Friends
105
Use Caution When Working with Quantifiers
106
Working with Files
, 109
Using Pathname and FileUtils
._ 109
The
temprile
Standard Library
112
Automatic Temporary Directory Handling
113
Collision Avoidance
113
Same Old I/O Operations
114
Automatic Unlinking
114
Text-Processing Strategies
, 115
Advanced Line Processing
, 116
Atomic Saves
'. 118
Conclusions
120
5.
Functional Programming Techniques
_. 121
Laziness Can Be a Virtue (A Look at lazy.rb)
121
Minimizing Mutable State and Reducing Side Effects
129
Modular Code Organization
133
Memoization
138
Infinite Lists
145
Higher-Order Procedures
149
Conclusions
152
6.
When Things Go Wrong
.153
A Process for Debugging Ruby Code
153
Capturing the Essence of a Defect
157
Scrutinizing Your Code
160
Utilizing Reflection
160
Improving inspect Output
162
Finding Needles in a Haystack
166
Working with Logger
168
Conclusions
176
7.
Reducing Cultural Barriers
.177
ml7n by Example: A Look at Ruby's CSV Standard Library
178
Portable ml7n Through UTF-8 Transcoding
182
Source Encodings
183
Working with Files
183
Transcoding User Input in an Organized Fashion
185
ml7n in Standalone Scripts
188
Inferring Encodings from Locale
189
Customizing Encoding Defaults
191
m^n-Safe Low-Level Text Processing
193
Localizing Your Code
195
Conclusions
204
8.
Skillful Project Maintenance
._. 205
Exploring a Well-Organized Ruby Project (Haml)
205
Conventions to Know About
210
What Goes
m a
README
211
Laying Out Your Library
213
Exécutables
216
Tests
216
Examples
217
API Documentation via RDoc
219
Basic Documentation Techniques and Guidelines
220
Controlling Output with RDoc Directives
222
The RubyGems Package Manager
227
Writing a Gem
::
Specification
228
Working with Dependencies
231
Rake: Ruby's Built-in Build Utility
234
Conclusions
237
A. Writing Backward-Compatible Code
. 239
B. Leveraging Ruby's Standard Library
.251
C. Ruby
Worst Practices
.283
Index
.299 |
any_adam_object | 1 |
author | Brown, Gregory |
author_facet | Brown, Gregory |
author_role | aut |
author_sort | Brown, Gregory |
author_variant | g b gb |
building | Verbundindex |
bvnumber | BV035718541 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.73.R83 |
callnumber-search | QA76.73.R83 |
callnumber-sort | QA 276.73 R83 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 250 |
ctrlnum | (OCoLC)731203884 (DE-599)DNB994782756 |
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 | 1. Aufl. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>00000nam a2200000 c 4500</leader><controlfield tag="001">BV035718541</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20090930</controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">090910s2009 |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">09,N27,0007</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">994782756</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780596523008</subfield><subfield code="c">PB. : EUR 34.00 (freier Pr.)</subfield><subfield code="9">978-0-596-52300-8</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9780596523008</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)731203884</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB994782756</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakddb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-11</subfield><subfield code="a">DE-739</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.73.R83</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">004</subfield><subfield code="2">sdnb</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Brown, Gregory</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Ruby best practices</subfield><subfield code="c">Gregory Brown</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">1. Aufl.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Sebastopol, CA</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">2009</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVI, 309 S.</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="650" ind1=" " ind2="4"><subfield code="a">Object-oriented programming (Computer science)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Ruby (Computer program language)</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="q">text/html</subfield><subfield code="u">http://deposit.dnb.de/cgi-bin/dokserv?id=3321503&prov=M&dok_var=1&dok_ext=htm</subfield><subfield code="3">Inhaltstext</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=017995361&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-017995361</subfield></datafield></record></collection> |
id | DE-604.BV035718541 |
illustrated | Not Illustrated |
indexdate | 2024-07-20T10:18:50Z |
institution | BVB |
isbn | 9780596523008 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-017995361 |
oclc_num | 731203884 |
open_access_boolean | |
owner | DE-11 DE-739 |
owner_facet | DE-11 DE-739 |
physical | XVI, 309 S. |
publishDate | 2009 |
publishDateSearch | 2009 |
publishDateSort | 2009 |
publisher | O'Reilly |
record_format | marc |
spelling | Brown, Gregory Verfasser aut Ruby best practices Gregory Brown 1. Aufl. Sebastopol, CA O'Reilly 2009 XVI, 309 S. txt rdacontent n rdamedia nc rdacarrier Object-oriented programming (Computer science) Ruby (Computer program language) text/html http://deposit.dnb.de/cgi-bin/dokserv?id=3321503&prov=M&dok_var=1&dok_ext=htm Inhaltstext Digitalisierung UB Passau application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017995361&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Brown, Gregory Ruby best practices Object-oriented programming (Computer science) Ruby (Computer program language) |
title | Ruby best practices |
title_auth | Ruby best practices |
title_exact_search | Ruby best practices |
title_full | Ruby best practices Gregory Brown |
title_fullStr | Ruby best practices Gregory Brown |
title_full_unstemmed | Ruby best practices Gregory Brown |
title_short | Ruby best practices |
title_sort | ruby best practices |
topic | Object-oriented programming (Computer science) Ruby (Computer program language) |
topic_facet | Object-oriented programming (Computer science) Ruby (Computer program language) |
url | http://deposit.dnb.de/cgi-bin/dokserv?id=3321503&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017995361&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT browngregory rubybestpractices |