By David B. Copeland

Speak on to your method. With its basic instructions, flags, and parameters, a well-formed command-line program is the fastest method 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 endlessly worthwhile is simpler than you may imagine. Ruby is especially suited for this activity, because it combines high-level abstractions with "close to the steel" method interplay wrapped up in a concise, readable syntax. in addition, Ruby has the help of a wealthy environment of open-source instruments and libraries.

Ten insightful chapters each one clarify and show a command-line most sensible perform. you will see tips on how to use those instruments to raise the lowliest automation script to a maintainable, polished software.

You'll how one can use unfastened, open resource parsers to create hassle-free command-line interfaces in addition to command suites. you will see the way to use defaults to maintain recommendations uncomplicated for daily clients, whereas giving complex clients thoughts for extra advanced projects.

There's no cause a command-line program may still lack documentation, even if it truly is a part of a aid command or a guy web page; you can find out whilst and the way to take advantage of either. Your trip from command-line amateur to seasoned ends with a glance at helpful techniques to checking out your apps, and comprises a few enjoyable ideas for outside-the-box, colourful interfaces that may pride your users.

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

What You Need:

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

Show description

Read or Download Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life PDF

Similar Programming books

Embedded C

For those that are approximately to write down their first embedded application - or were suffering to benefit approximately this crucial zone - this booklet will store weeks of attempt.

Cocoa Design Patterns

“Next time a few child indicates up at my door requesting a code evaluate, this can be the publication that i'm going to throw at him. ”   –Aaron Hillegass, founding father of immense Nerd Ranch, Inc. , and writer of Cocoa Programming for Mac OS X   Unlocking the secrets and techniques of Cocoa and Its Object-Oriented Frameworks   Mac and iPhone builders are frequently beaten via the breadth and class of the Cocoa frameworks.

C++ Primer (5th Edition)

Bestselling Programming educational and Reference thoroughly Rewritten for the recent C++11 common   absolutely up-to-date and recast for the newly published C++11 normal, this authoritative and complete advent to C++ can assist you to benefit the language quickly, and to take advantage of it in sleek, powerful methods.

Operating System Concepts

Hold velocity with the fast-developing international of working structures Open-source working platforms, digital machines, and clustered computing are one of the top fields of working platforms and networking which are swiftly altering. With large revisions and organizational alterations, Silberschatz, Galvin, and Gagne’s working approach strategies, 8th version is still as present and proper as ever, aiding you grasp the elemental suggestions of working platforms whereas getting ready your self for today’s rising advancements.

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

Show sample text content

We’ll find out about this sort of trying out through the use of the preferred Cucumber trying out instrument, besides Aruba, that's an extension to Cucumber designed to aid try command-line functions. popularity exams are an outstanding position to begin as a result usercentered technique, so let’s bounce in and notice how they paintings. when we have a obtain from Wow! publication record erratum • talk about 118 • bankruptcy eight. attempt, try, try out sturdy set of reputation exams, we’ll flip our recognition to unit exams to check part instances that will be challenging to simulate utilizing reputation assessments. eight. 1 trying out consumer habit with popularity assessments in contrast to internet purposes, command-line apps have uncomplicated person interfaces, and their output is much less advanced. This makes the task of simulating enter and trying out output quite uncomplicated. the issues are available in after we think of what our apps do. db_backup. rb takes many years to do its paintings and calls for entry to a database. todo makes irreversible adjustments to its activity checklist. we want how to run our apps that mimics as heavily as attainable the “real-world” eventualities they have been written to resolve yet in a repeatable and predictable means that doesn’t reason everlasting alterations to our surroundings. instead of clear up this challenge on the similar we find out about the mechanics of trying out, let’s take issues one step at a time. should you bear in mind, todo takes a world choice that controls the place the duty record is. we will be able to use that to maintain our checks from messing with our own activity record in our domestic listing. Let’s use that to get a few assessments going. when we see tips on how to attempt our app quite often, we’ll speak about a few innovations to house the “tests messing with our own activity checklist” factor. realizing recognition exams popularity checks are checks that we will use to verify that an app correctly implements convinced positive factors, from a user’s viewpoint. popularity checks more often than not try out basically the subset of the activities clients are inclined to try out (the so-called satisfied path), and so they don’t hide unusual side instances. What recognition assessments should still do is to simulate the methods clients are probably to hire our software to do their task. A todo person, for instance, is probably going to do the subsequent: • • • • upload a brand new activity record projects whole a role Get aid each one activity maps to a command that todo accepts. to check those, we have to use todo simply as a consumer may. we will additionally use todo to ensure its personal habit. for instance, we will execute a todo record, catch the checklist of projects, upload a brand new activity through todo new, after which record the projects back, this time trying to find our new job. lets use a similar strategy to try out todo performed. obtain from Wow! book file erratum • talk about Testing consumer habit with popularity exams • 119 whereas shall we create one other command-line app to run those exams, we don’t have to accomplish that. The popularity checking out instrument Cucumber (explained in nice element within the RSpec booklet [CADH09]) can deal with the elemental infrastructure for operating assessments, and the Cucumber add-on library Aruba will offer us with the instruments we have to run our app and determine its habit.

Rated 4.35 of 5 – based on 49 votes