Everyday Scripting with Ruby: For Teams, Testers, and You

Free Download

Authors:

Edition: 1

ISBN: 9780977616619, 0977616614

Size: 3 MB (2746677 bytes)

Pages: 426/426

File format:

Language:

Publishing Year:

Category:

Brian Marick9780977616619, 0977616614

Are you a tester who spends more time manually creating complex test data than using it? A business analyst who seemingly went to college all those years so you can spend your days copying data from reports into spreadsheets? A programmer who can

Table of contents :
Contents……Page 8
Introduction……Page 13
An Outline of the Book……Page 15
Service After the Sale……Page 17
Acknowledgments……Page 18
Download the Practice Files……Page 19
In the Beginning Was the Command Line……Page 20
Installing Ruby……Page 22
Your Two Basic Tools……Page 23
Prompts, Command Lines, Prompts, and irb……Page 24
It’s Time to Make Mistakes……Page 25
The Basics……Page 29
A Script in Action……Page 30
Objects Send and Receive Messages……Page 31
Variables Name Objects……Page 33
Comparing Arrays……Page 34
Printing to the Screen……Page 35
Making a Script……Page 36
Where Do We Stand?……Page 37
Exercises……Page 38
Ruby Facts: Arrays……Page 39
Command-line Arguments……Page 43
Ignoring Case……Page 45
Methods……Page 49
Dissecting Strings……Page 51
Fixing a Bug……Page 53
Where Do We Stand?……Page 55
Prelude to the Exercises……Page 56
Exercises……Page 58
if …elsif …else……Page 61
A Shorthand Version of if……Page 63
The Question Mark Operator……Page 64
Growing a Script……Page 66
The Project……Page 67
Building a Solution……Page 69
Exercises……Page 91
Precedence……Page 94
Boolean Expressions Can Select Objects……Page 96
Regular Expressions Match Strings……Page 98
Dissecting Strings with Regular Expressions……Page 101
Reordering an Array……Page 102
Exercises……Page 104
Special Characters……Page 106
Taking Strings Apart……Page 108
Regular Expression Options……Page 109
Exercises……Page 110
Classes Bundle Data and Methods……Page 112
Objects Contain Data……Page 115
Exercises……Page 120
Defining Accessors……Page 126
Self……Page 129
Class Methods……Page 133
Exercises……Page 136
Working in a World Full of People……Page 138
Scraping Web Pages with Regular Expressions……Page 139
Treating Web Pages Like Files……Page 140
Restricting Attention to Part of the Page……Page 142
Plucking Out the Title and Authors……Page 144
Hashes Store Named Data……Page 146
Taking the Trip……Page 147
Exercise Yourself……Page 149
Handling XHTML……Page 152
Driving the Browser……Page 154
Direct Access to Underlying Protocols……Page 155
Working with Comma-Separated Values……Page 158
Using Blocks for Automatic Cleanup……Page 159
Applying It All to affinity-trip.rb……Page 160
Discovering and Understanding Classes in the Standard Library……Page 161
Replacing Code with Data……Page 163
Ruby Facts: Hashes……Page 166
Optional Arguments……Page 169
Rest Arguments……Page 170
Keyword Arguments……Page 171
Finding Packages……Page 174
Using setup.rb……Page 175
Using RubyGems……Page 176
Understanding What You’ve Downloaded……Page 178
The Load Path……Page 180
Avoiding Filename Clashes……Page 181
Avoiding Class Name Clashes Using Modules……Page 182
A Script to Do the Work for You……Page 184
Working Without Stepping on Yourself……Page 187
The rakefile……Page 188
Location-independent Tests……Page 191
Exercises……Page 193
Ruby Facts: Modules……Page 195
Nested Modules……Page 196
Including Modules……Page 197
Classes Are Modules……Page 199
When Scripts Run into Problems……Page 201
An Error-handling Strategy……Page 202
Your Exception-handling Options……Page 204
Methods That Use Blocks……Page 208
Exercises……Page 210
The Accomplished Scripter……Page 212
Frameworks: Scripting by Filling in Blanks……Page 213
Using the watchdog Script……Page 214
Inheritance……Page 217
Gathering User Choices……Page 223
The Story of Barker……Page 230
What Happens Where?……Page 234
Modules Instead of Superclasses……Page 239
Final Thoughts……Page 241
The Back of the Book……Page 243
Glossary……Page 244
Solutions for Chapter 3……Page 256
Solutions for Chapter 5……Page 258
Solutions for Chapter 7……Page 261
Solutions for Chapter 9……Page 265
Solutions for Chapter 10……Page 269
Solutions for Chapter 11……Page 270
Solutions for Chapter 12……Page 281
Solutions for Chapter 21……Page 286
Bibliography……Page 288
A……Page 289
D……Page 290
I……Page 291
N……Page 292
R……Page 293
S……Page 294
W……Page 296
Z……Page 297
rubyforge.org……Page 0
Everyday Scripting with Ruby……Page 298
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v1.rb……Page 301
http://media.pragprog.com/titles/bmsft/code/inventory/snapshots/differences-version-1.rb……Page 317
http://media.pragprog.com/titles/bmsft/code/inventory/snapshots/differences-version-5.rb……Page 318
http://media.pragprog.com/titles/bmsft/code/template-for-tests.rb……Page 319
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests.v1.rb……Page 320
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v7.rb……Page 321
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests.v3.rb……Page 322
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v3.rb……Page 323
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v4.rb……Page 324
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests.v4.rb……Page 325
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v5.rb……Page 326
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v6.rb……Page 327
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests.v5.rb……Page 328
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v8.rb……Page 329
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests.v6.rb……Page 330
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn.v7copy.rb……Page 331
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-re.rb……Page 333
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-tests-re.rb……Page 334
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-3-tests.rb……Page 335
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-4-tests.rb……Page 336
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/regexp/exercise-1-tests.rb……Page 337
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-classes.v1.rb……Page 339
http://media.pragprog.com/titles/bmsft/code/churn/snapshots/churn-classes.v2.rb……Page 340
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-3.rb……Page 341
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-5.rb……Page 342
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-7.rb……Page 343
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-8.rb……Page 344
http://media.pragprog.com/titles/bmsft/code/class-facts/more-time.rb……Page 345
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1.v1.rb……Page 346
http://media.pragprog.com/titles/bmsft/code/affinity-trip/affinity-trip.rb……Page 347
http://media.pragprog.com/titles/bmsft/code/scraping-alternatives/xhtml.rb……Page 351
http://media.pragprog.com/titles/bmsft/code/scraping-alternatives/watir.rb……Page 352
http://media.pragprog.com/titles/bmsft/code/scraping-alternatives/http.rb……Page 353
http://media.pragprog.com/titles/bmsft/code/arglist-facts/center.rb……Page 354
http://media.pragprog.com/titles/bmsft/code/module-facts/class-include.rb……Page 355
http://media.pragprog.com/titles/bmsft/code/s4t-utils/lib/s4t-utils/version.rb……Page 356
http://media.pragprog.com/titles/bmsft/code/module-facts/some-module.rb……Page 357
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/bin-skeleton……Page 358
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/test-with.rb……Page 359
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/begin-end.rb……Page 360
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/nesting.rb……Page 361
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/raising2.rb……Page 362
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/logger.rb……Page 363
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/block-examples.rb……Page 364
http://media.pragprog.com/titles/bmsft/code/error-handling/bin/with-pleasant-exceptions.rb……Page 365
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/error-handling/exercise-3-start.rb……Page 366
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/error-handling/exercise-3.rb……Page 367
http://media.pragprog.com/titles/bmsft/code/inheritance/inheritance.rb……Page 368
http://media.pragprog.com/titles/bmsft/code/inheritance/override.rb……Page 369
http://media.pragprog.com/titles/bmsft/code/inheritance/extend.rb……Page 370
http://media.pragprog.com/titles/bmsft/code/inheritance/super-with-arg.rb……Page 371
http://media.pragprog.com/titles/bmsft/code/inheritance/super-no-arg.rb……Page 372
http://media.pragprog.com/titles/bmsft/code/inheritance/instance.rb……Page 373
http://media.pragprog.com/titles/bmsft/code/watchdog/lib/watchdog/choices.rb……Page 374
http://media.pragprog.com/titles/bmsft/code/watchdog/bin/watchdog.rb……Page 379
http://media.pragprog.com/titles/bmsft/code/watchdog/lib/watchdog/barkers.rb……Page 380
http://media.pragprog.com/titles/bmsft/code/watchdog/lib/watchdog/kennel.rb……Page 381
http://media.pragprog.com/titles/bmsft/code/inheritance/module-inclusion.rb……Page 383
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/inventory/exercise-1.rb……Page 384
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/more-inventory/exercise-2.rb……Page 385
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/more-inventory/exercise-3.rb……Page 386
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/more-inventory/exercise-4.rb……Page 387
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/more-inventory/exercise-5.rb……Page 388
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/more-inventory/exercise-5-rejected.rb……Page 389
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-1-tests.rb……Page 390
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-1.rb……Page 391
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-2-tests.rb……Page 393
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-2.rb……Page 394
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-3.rb……Page 395
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn/exercise-3-tests.rb……Page 398
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-1.rb……Page 399
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-1-tests.rb……Page 400
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-2-tests.rb……Page 401
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-2.rb……Page 402
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-3.rb……Page 403
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-regexp/exercise-4.rb……Page 404
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/regexp/exercise-1.rb……Page 405
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/regexp/exercise-2.rb……Page 406
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-2.rb……Page 407
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-4.rb……Page 408
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-6.rb……Page 409
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-7b.rb……Page 410
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-8-tests.rb……Page 411
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-9/churn.rb……Page 412
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-9/annoying-test-all.rb……Page 413
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/churn-classes/exercise-9/test-all.rb……Page 414
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1-tests.rb……Page 415
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1.v2.rb……Page 416
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1.v3.rb……Page 417
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1.v4.rb……Page 418
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-1.v5.rb……Page 419
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-2.rb……Page 420
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-2-tests.rb……Page 421
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-3.rb……Page 422
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-4-tests.rb……Page 423
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/classes/exercise-4.rb……Page 424
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/error-handling/exercise-1.rb……Page 425
http://media.pragprog.com/titles/bmsft/code/exercise-solutions/error-handling/exercise-2.rb……Page 426
Watir – Overview……Page 302
Watir – Documentation……Page 304
Watir – Examples……Page 306
WATIR Example Test Case……Page 307
Watir – Platforms……Page 312
Watir – Community……Page 314
Watir – Source……Page 316

Reviews

There are no reviews yet.

Be the first to review “Everyday Scripting with Ruby: For Teams, Testers, and You”
Shopping Cart
Scroll to Top