Leanpub Header

Skip to main content

EMBARGO!

Journalists and bloggers: please do not publish anything about this until the embargo is lifted!

Please contact the author for more information about when this is.

通过实例学Ruby编程

This book is a translation into Chinese (Simplified) of Learn Ruby Programming by Examples which was originally written in English

The authors are letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
199
Pages
13,146Words
About

About

About the Book

2013年12月8日,美国总统奥巴马“要求每一个美国人都要尝试学习编程”,以此拉开计算机科学教育周刊2013年发起的每天学习代码一小时的活动序幕。奥巴马说: “学习这些技能不仅对你的未来十分重要,它对国家的未来也意义重大。” 可见,编程是这个信息时代一个重要的技能。

一个典型的教授如何编程的书将通过编程概念,语法和用简单例子做示范等方式来教学。我以前看过几十本这样的编程语言或工具书,而且在大学任教时也是用这种方式教学。我认为这并不是一种有效的方法,因为它更像是一个老师对学生的知识倾倒。我相信更好的办法是,让学生们通过编程练习循序渐进地学习,并指导他们解决有趣和实用的计算机程序,包括:

  • 求最大公约数

  • 个人所得税计算

  • 随机产生六合彩号码

  • 狼、羊、白菜和农夫过河谜题

每个练习(共43个)都有针对性地引进新的编程概念并适当地巩固先前知识。本书强调实用性并着重培养读者的编程思维能力。书的最后一章介绍了利用编程来做自动化测试,这是在美国评为最幸福职业 “软件测试工程师”的必备技能。

我把我的编程教学思想付诸实践,本书也是在教我的13岁的女儿Courtney学习编程时所做的总结。

Ruby是一种流行的编程语言,它被广泛用于Web应用程序和软件测试。 由于Ruby的简单,优雅和简洁的语法,它被认为是最佳的初学编程语言之一。

Share this book

This book is a translation into Chinese (Simplified) of Learn Ruby Programming by Examples which was originally written in English

Price

Pick Your Price...

Minimum price

$9.99

$19.99

You pay

$19.99

Authors earn

$15.99
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $12.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Authors

Zhimin Zhan

Zhimin Zhan is the founder and principal agile testing coach of AgileWay Pty Ltd, Australia. As an advisor and coach, he helps organisations implement test automation using Continuous Testing with open technologies, such as Selenium WebDriver / Appium. Zhimin is the creator of TestWise, the next-generation functional testing tool that supports functional test refactorings, and BuildWise, an international award-winning Continuous Testing Server. Zhimin is a frequent speaker and author of 14 books on software testing and programming. He shares his test automation and CI experience on Substack and Medium.

Courtney Zhan

Courtney Zhan is a Software Development Engineer at Amazon Australia, with a passion for end-to-end test automation, programming, continuous testing, and graphic design. She shares tips and insights on test automation and continuous testing weekly on Medium and Substack. Courtney is the published author of Selenium WebDriver Recipes in C# by Apress, and 21 of her articles have been featured on software testing newsletters.

Contents

Table of Contents

前言

  1. 本书的独特之处
  2. 谁应该读这本书?
  3. 英文术语
  4. 如何读这本书
  5. 反馈

1.介绍

  1. 1.1在Windows电脑运行Ruby程序
  2. 1.2在苹果电脑(Mac OS X)上运行Ruby程序
  3. 1.3在线Ruby教程
  4. 1.4做练习的步骤
  5. 1.5窗口布局建议
  6. 1.6常见错误
  7. 1.7交互式Ruby (IRB )

2.打印形状

  1. 2.1打印出三角形
  2. 2.2打印半个菱形
  3. 2.3打印菱形
  4. 2.4打印指定大小菱形

3.互动测验

  1. 3.1加法计算器
  2. 3.2加法测验
  3. 3.3减法测验
  4. 3.4猜数字游戏

4.数组(Array)和哈希表(Hash)

  1. 4.1名字排序
  2. 4.2从指定的字母位置获得字符
  3. 4.3计算平均数
  4. 4.4英文单词的生命意义的百分比?

5.实用工具程序

  1. 5.1华氏度到摄氏度的转换
  2. 5.2个人收入所得税计算
  3. 5.3字数统计
  4. 5.4生成六合彩数字
  5. 5.5数字排序

6.趣味数学

  1. 6.1查找约数
  2. 6.2寻找最大公约数
  3. 6.3寻找最小公倍数(LCM)
  4. 6.4查找质数
  5. 6.5斐波那契(Fibonacci) 序列
  6. 6.6连续求和

7.方法 (Method)

  1. 7.1寻找最大公约数(使用Method)
  2. 重构
  3. 7.2生成六合彩号码(使用Method)
  4. 7.3寻找多个数字的LCM(使用Method)

8.文件和网络

  1. 8.1计算平均得分
  2. 8.2计算在文本文件中的单词和行数
  3. 8.3生日派对邀请卡
  4. 8.4重命名多个文件
  5. 8.5实时货币兑换
  6. 8.6发送个人致谢电子邮件

9.面向对象的编程

  1. 9.1计算器(Class)
  2. 9.2教师和学生的年龄
  3. 9.3计算销售税
  4. 9.4图书馆系统
  5. 9.5向日葵战僵尸模拟游戏

10.经典谜题

  1. 10.1谷歌能力倾向面试
  2. 10.2斐波那契数列和HCF(递归)
  3. 10.3计算复合利率
  4. 10.4狼、羊、白菜和农夫过河谜题
  5. 10.5神秘的数学公式(回溯)
  6. 10.6更多练习

11.自动化测试Web App

  1. 11.1最幸福的职业
  2. 11.2安装Selenium WebDriver
  3. 11.3用Selenium WebDriver 驱动 Chrome
  4. 11.4用Selenium WebDriver 驱动 Firefox
  5. 11.5用Selenium WebDriver 驱动 IE
  6. 11.6通过验证来完成测试
  7. 11.7欲了解更多有关测试自动化…

12.本书之后

  1. 12.1更多Ruby
  2. 12.2更多练习
  3. 12.3使用Ruby写自动化测试
  4. 12.4用Ruby on Rails开发Web App
  5. 12.5游戏编程和移动应用程序
  6. 12.6学习另一种编程语言

附录 1 Ruby语法简要

附录 2 答案

  1. 第二章
  2. 第三章
  3. 第四章
  4. 第五章
  5. 第六章
  6. 第七章
  7. 第八章
  8. 第九章
  9. 第十章

资源

  1. 代码编辑器
  2. Ruby 语言
  3. Ruby 教程
  4. 更多练习
  5. 自动化测试

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub