이미지 검색을 사용해 보세요
검색창 이전화면 이전화면
최근 검색어
인기 검색어

소득공제 수입
직수입양서 Ruby Best Practices: Increase Your Productivity - Write Better Code
Paperback
Brown, Gregory
O'Reilly Media 2009.06.01.
가격
60,790
18 49,840
YES포인트?
2,500원 (5%) 마니아추가적립
5만원 이상 구매 시 2천원 추가 적립
결제혜택
최대 2,000원 즉시할인

이미 소장하고 있다면 판매해 보세요.

책소개

목차

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 Table() 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 Mixins93

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 tempfile 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

m17n by Example: A Look at Ruby's CSV Standard Library 178

Portable m17n Through UTF-8 Transcoding 182

Source Encodings 183

Working with Files 183

Transcoding User Input in an Organized Fashion 185

m17n in Standalone Scripts 188

Inferring Encodings from Locale 189

Customizing Encoding Defaults 191

m17n-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 in a README 211

Laying Out Your Library 213

Executables 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

관련 분류

품목정보

발행일
2009년 06월 01일
쪽수, 무게, 크기
쪽수확인중 | 크기확인중
ISBN13
9780596523008

리뷰/한줄평0

리뷰

첫번째 리뷰어가 되어주세요.

한줄평

첫번째 한줄평을 남겨주세요.

상품정보안내

직수입외서의 경우, 해외거래처에서 제공하는 정보가 부족하여 제목, 표지, 가격, 유통상태 등의 정보가 미비하거나 변경되는 경우가 있습니다. 정확한 확인을 원하시는 경우, 일대일 상담으로 문의하여 주시면 답변 드리겠습니다.
(판형과 판수 등이 다양한 도서는 찾으시는 도서의 ISBN을 알려 주시면 보다 빠르고 정확한 안내가 가능합니다.)

해외거래처에서 품절인 경우, 2차 거래선을 통해 유럽과 미국 출판사로 직접 수입이 진행될 수 있습니다.
수입 진행 시점으로 부터 2~3주가 추가로 소요되며, 해외에서도 유통이 원활하지 않은 도서는 품절 안내가 지연될 수 있습니다.
해당 경우, 문자와 메일로 별도 안내를 드리고 있사오니 마이페이지에서 휴대전화번호와 메일주소를 다시 한번 확인해주시기 바랍니다.
49,840
1 49,840