Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life

By David B. Copeland

Speak on to your method. With its easy instructions, flags, and parameters, a well-formed command-line program is the fastest approach to automate a backup, a construct, or a deployment and simplify your life.

As Ruby professional David Copeland explains, writing a command-line software that's self-documenting, powerful, adaptable and eternally precious is simpler than chances are you'll imagine. Ruby is especially fitted to this job, because it combines high-level abstractions with "close to the steel" process interplay wrapped up in a concise, readable syntax. in addition, Ruby has the aid of a wealthy environment of open-source instruments and libraries.

Ten insightful chapters every one clarify and display a command-line most sensible perform. you will see find out how to use those instruments to raise the lowliest automation script to a maintainable, polished software.

You'll methods to use loose, open resource parsers to create trouble-free command-line interfaces in addition to command suites. you will see the best way to use defaults to maintain innovations easy for daily clients, whereas giving complex clients techniques for extra complicated initiatives.

There's no cause a command-line program should still lack documentation, no matter if it is a part of a aid command or a guy web page; you will find out whilst and the way to exploit either. Your trip from command-line amateur to seasoned ends with a glance at necessary methods to trying out your apps, and contains a few enjoyable thoughts for outside-the-box, colourful interfaces that might satisfaction your users.

With Ruby, the command line isn't really useless. lengthy reside the command line.

What You Need:

All you will need is Ruby, and the power to put in a couple of gemstones alongside the way in which. Examples written for Ruby 1.9.2, yet 1.8.7 may still paintings simply as well.

Show description

Preview of Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life PDF

Similar Development books

Introduction to Programming Using Python plus MyProgrammingLab with Pearson eText -- Access Card

Be aware: sooner than paying for, seek advice from your teacher to make sure you decide on the right kind ISBN. numerous models of Pearson's MyLab & studying items exist for every name, and registrations aren't transferable. To check in for and use Pearson's MyLab & learning items, you may as well desire a direction identity, which your teacher will offer.

Ground Control: Fear and Happiness in the Twenty-First-Century City

Whilst the figures say crime is falling, why are we extra fearful than ever? may possibly our cities and towns be growing worry and distrust? extra estate is being in-built Britain than at any time because the moment global conflict - yet it is owned via inner most enterprises, designed for revenue and watched over by means of CCTV.

The Dragon's Gift: The Real Story of China in Africa

Is China a rogue donor, as a few media pundits recommend? Or is China supporting the constructing global pave a pathway out of poverty, because the chinese language declare? within the previous few years, China's relief software has leapt out of the shadows. Media experiences approximately large relief programs, help for pariah regimes, regiments of chinese language exertions, and the ruthless exploitation of employees and common assets in the various poorest nations on the planet sparked fierce debates.

The Coming Prosperity: How Entrepreneurs Are Transforming the Global Economy

Ours is the main dynamic period in human background. some great benefits of 4 centuries of technological and organizational swap are ultimately attaining a formerly excluded international majority. this change will create large-scale possibilities in richer international locations just like the usa simply because it has in poorer international locations now within the ascent.

Extra info for Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life

Show sample text content

Book file erratum • speak about CHAPTER 1 Have a transparent and Concise goal you must resolve an issue. it would be that you simply want structures to speak to one another that weren’t designed for it. otherwise you may have to run a few automatic but complicated job periodically. Or, it's your decision to construct basic productiveness instruments that will help you paintings. this is often the place the command line shines, and those are the types of difficulties you’ll learn how to clear up during this booklet. even though it could seem seen centred, single-purpose app is superior than one with a “kitchen sink” packed with positive factors, it’s specifically very important for command-line apps. the way command-line apps get enter, are configured, and bring output is quite uncomplicated and, in many ways, proscribing. As such, a process of many single-purpose apps is best than a method of fewer (or one) advanced apps. basic, single-purpose apps are more uncomplicated to appreciate, are more straightforward to profit, are more uncomplicated to keep up, and result in extra versatile structures. give some thought to your command-line initiatives as a collection of layers: with the elemental beginning of the traditional UNIX instruments, you could create extra advanced yet nonetheless centred command-line apps. these can be utilized for much more advanced apps, every one equipped on less complicated instruments less than. the preferred model regulate procedure git follows this layout: lots of git’s instructions are “plumbing” and aren't meant for normal use. those instructions are then used to construct “porcelain” instructions, that are nonetheless easy and single-purpose yet are outfitted utilizing the “plumbing. ” This layout turns out to be useful simply because, each now and again, you should utilize the “plumbing” without delay. you are able to do this simply because git was once designed round instruments that every have a transparent and concise function. This bankruptcy will set the level for every thing we’ll be studying within the booklet. We’ll examine universal difficulties and introduce command-line apps to unravel them. As a method of demonstrating extra in actual fact what we suggest through having a “clear and concise purpose,” every one problem-solving app gets an obtain from Wow! book document erratum • speak about 2 • bankruptcy 1. Have a transparent and Concise function generation during this bankruptcy. the 1st model of every app can be naive after which fast revised to be extra single-purpose, if you want to see firsthand the extent of functionality we need our apps to have. 1. 1 challenge 1: Backing Up info believe our small improvement group is beginning paintings on our company’s flagship net program. This software is seriously data-driven and hugely complicated, with many beneficial properties and area instances. to construct it, we’re going to exploit an Agile technique, the place we paintings in two-week “sprints. ” In each one dash, we’ll have a listing of “user tales” representing the paintings we’re doing. To formally whole a consumer tale, we’ll have to exhibit that tale functioning appropriately in a shared improvement setting. for you to display operating positive aspects, we’ll have a collection of databases with in particular selected facts which can simulate all of our facet situations and person flows.

Download PDF sample

Rated 4.69 of 5 – based on 34 votes