• 商品
  • 详情
  • 评价
  • 联系
  • 推荐
立即购买 分享好友 商城首页 商城分类 切换频道 秒杀活动 购物车
1/5
Ruby图1

Ruby

10广东
价格 48.00
发货 广东东莞市
数量
-+
库存 100
商品详情

内容简介

你能够编写真正优雅的Ruby代码吗?《Ruby*实践》正是为想要像专家那样使用Ruby的程序员所准备的。《Ruby *实践(影印版)》由Ruby项目Prawn的开发者所著,简洁地向你阐释如何使用Ruby编写优美的应用程序接口和领域特定语言。此外,还包括如何应用函数式编程的思想和技术,使代码更简洁,使你更。通过《Ruby *实践(影印版)》,你将会学到如何编写可读性更高,表达能力更强的代码,以及许多其他方面的内容。
《Ruby*实践》将会帮助你:
* 理解Ruby代码块所蕴含的神秘力量
* 学习如何在不破坏原有Ruby代码的情况下进行调整,例如运行时在模块内糅合
* 探究测试与调试中的细节,以及如何从易测性出发进行设计
* 学习通过让事情保持简单来编写快速代码
* 用于文本处理和文件管理的开发策略,包括正则表达式
* 理解为什么会发生错误以及错误是如何发生的
* 利用Ruby的多语言特性减少文化障碍
《Ruby *实践(影印版)》还包含多个章节对测试代码、设计应用程序接口以及项目维护做了全面介绍。《Ruby*实践》将陪伴你学习如何将这门丰富、优美的语言发挥到。

目录

Foreword
Preface
1. Driving Code Through Tests
A Quick Note on Testing frameworks
Designing for Testability
Testing Fundamentals
Well-Focused Examples
Testing Exceptions
Run the Whole Suite at once
Advanced Testing Techniques
Using Mocks and Stubs
Testing Complex Output
Keeping Things Organized
Embedding Tests in Library Files
Test Helpers
Custom Assertions
Conclusions
2. Designing Beautiful APIs
Designing for Convenience: Ruport’s Table( ) feature
Ruby’s Secret Power: Flexible Argument Processing
Standard Ordinal Arguments
Ordinal Arguments with Optional Parameters
Pseudo-Keyword Arguments
Treating Arguments As an Array
Ruby’s Other Secret Power: Code Blocks
Working with Enumerable
Using Blocks to Abstract Pre- and Postprocessing
Blocks As Dynamic Callbacks
Blocks for Interface Simplification
Avoiding Surprises
Use attr_reader, attr_writer, and attr_accessor
Understand What method? and method! Mean
Make Use of Custom Operators
Conclusions
3. Mastering the Dynamic Toolkit
BlankSlate: A BasicObject on Steroids
Building Flexible Interfaces
Making instance_eval( ) Optional
Handling Messages with method_missing( ) and send( )
Dual-Purpose Accessors
Implementing Per-Object Behavior
Extending and Modifying Preexisting Code
Adding New Functionality
Modification via Aliasing
Per-Object Modification
Building Classes and Modules Programmatically
Registering Hooks and Callbacks
Detecting Newly Added Functionality
Tracking Inheritance
Tracking Mixins
Conclusions
4. Text Processing and File Management
Line-based File Processing with State Tracking
Regular expressions
Don’t Work Too Hard
Anchors Are Your Friends
Use Caution When Working with Quantifiers
Working with Files
Using Pathname and FileUtils
The tempfile Standard Library
Automatic Temporary Directory Handling
Collision Avoidance
Same Old I/O Operations
Automatic Unlinking
Text-Processing Strategies
Advanced Line Processing
Atomic Saves
Conclusions
5. Functional Programming Techniques
Laziness Can Be a Virtue (A Look at lazy.rb)
Minimizing Mutable State and Reducing Side Effects
Modular Code Organization
Memoization
Infinite Lists
Higher-Order Procedures
Conclusions
6. When Things Go Wrong
A Process for Debugging Ruby Code
Capturing the Essence of a Defect
Scrutinizing Your Code
Utilizing Reflection
Improving inspect Output
Finding Needles in a Haystack
Working with Logger
Conclusions
7. Reducing Cultural Barriers
m17n by Example: A Look at Ruby’s CSV Standard Library
Portable m17n Through UTF-8 Transcoding
Source Encodings
Working with Files
Transcoding User Input in an Organized Fashion
m1

摘要与插图

Rake is a very powerful tool that deserves its own chapter or even its own cookbook.There are a ton of useful recipes out there in the wild, so be sure to make the Rakefileone of your first stops in any new codebase you need to review. Understanding andusing Rake effectively is key to successfully managing any moderately complex Rubyproject, so be sure not to overlook its significance and practical utility.
  If you want to make the most out of this tool, there are just a few things to keep in mind:Rake provides custom tasks for common needs such as generating RDoc, runningunit tests and packaging up a project for distribution. Because these tasks are highlyconfigurable, it is better to use them than to reinvent the wheel.
  Any other repetitive action that is necessary for maintaining your project can bewrapped in a task to simplify things. Typically, any lengthy command that needsto be run in the shell is fair game for this sort of simplification.Any task that has a preceding desc() call will be listed with a meaningful messagein the rake ——tasks output for your project.
  Rakes ability to define prerequisite tasks allows you to build dependency-basedworkflows that allow you to model multiple-step tasks as needed.Namespaces can be used to segment off tasks into their own subspaces, minimizingthe risk of naming clashes.
  Ive tried to stick mainly to the easily overlooked aspects of Rake here, but there is awhole lot that we could have covered and didnt. Be sure to consult the Rake docu-mentation if youre interested in finding out more.
  Depending on what you were looking for, this chapter may have been a bit differentfrom what you were expecting based on the title. However, what you will find is thatthe things weve discussed here will really take you far when it comes to improving themaintainability of your projects. Though far from glamorous, things like good docu-mentation, well-organized folders and files, and a way to automate as much of the gruntwork as possible does a whole lot for your projects.
  Poorly maintained projects can be a huge drain on developer productivity and morale,yet nicely curated code can be downright enjoyable to work with, even if youre brand-new to a project. The tools and techniques weve discussed so far arent going to makemaintenance completely painless, but will still provide a solid foundation to work offof that will grow over time.
点赞 0
举报
收藏 0
分享 0
买家评价
正在加载评价详情...
联系方式
加关注0

新图书资料发布

VIP会员第2年
资料通过认证
保证金未缴纳

0成交¥45.00

新图书资料发布吕不韦传奇

0成交¥52.00

新图书资料发布中国历代张天师评传:卷三

0成交¥68.00

新图书资料发布中国历代张天师评传:卷四

0成交¥52.00

新图书资料发布中国历代张天师评传:卷五

0成交¥78.00

新图书资料发布检察实践的理论思考

0成交¥49.80

新图书资料发布地狱小子:4:毁灭的右手

0成交¥42.00

新图书资料发布新时期大学生思想政治教育改革与创新探究

0成交¥36.00

新图书资料发布机电一体化系统设计与应用

0成交¥39.80

新图书资料发布王大绩精讲高考语文 检索加工

0成交¥28.00

新图书资料发布国老师讲堂:手把手教你写作文 议论文 (高考语文阅卷组名师、新东方席语文名师国家玮,专为考生“量身打造”,抢占语文备考制高点!俞敏洪、孔庆东、李亮联合!)
客服 商铺 购物车