By David B. Copeland
Speak on to your procedure. With its uncomplicated instructions, flags, and parameters, a well-formed command-line software is the fastest method to automate a backup, a construct, or a deployment and simplify your lifestyles. With this publication, you are going to research particular how you can write command-line purposes which are effortless to exploit, install, and preserve, utilizing a collection of transparent top practices and the Ruby programming language. This publication is designed to make any programmer or process administrator extra efficient of their activity. Now up-to-date for Ruby 2.
Writing a command-line program that is self-documenting, powerful, adaptable and ceaselessly beneficial is less complicated than it's possible you'll imagine. Ruby is especially fitted to this job, since it combines high-level abstractions with "close to the steel" method interplay wrapped up in a concise, readable syntax. Plus, Ruby has the aid of a wealthy surroundings of open resource instruments and libraries.
Ten insightful chapters each one clarify and reveal a command-line top perform. you will see the right way to use those instruments to raise the lowliest automation script to a maintainable, polished program. you are going to use loose, open resource parsers to create effortless command-line interfaces in addition to command suites. you will see tips on how to use defaults to maintain innovations uncomplicated for daily clients, whereas giving complicated clients innovations for extra advanced projects. there isn't any this is why a command-line software may still lack documentation, even if it truly is a part of a support command or a guy web page; you can find out whilst and the way to exploit either. Your trip from command-line amateur to professional ends with a glance at worthwhile techniques to trying out your apps, and comprises a few enjoyable recommendations for outside-the-box, colourful interfaces that would pride your users.
With Ruby, the command line isn't lifeless. lengthy stay the command line.
Read or Download Build Awesome Command-Line Applications in Ruby 2: Control Your Computer, Simplify Your Life PDF
Similar protocols & apis books
This leading edge new publication, from major specialists Gunnar Heine and Holger Sagkob, explains how GPRS permits growth of current GSM networks to fulfill the calls for of recent cellular info functions. It teaches you the way the packet facts usual GPRS can assist to extend your community in the direction of 3rd iteration, assembly the calls for of the most-sophisticated cellular facts functions.
This textbook offers an in depth creation to the necessities of networking and communications applied sciences. Revised and up to date, this new version keeps the step by step procedure of the unique, organised to assist these and not using a robust wisdom of the subject material. good points: presents chapter-ending summaries and evaluate questions, an Appendix on TCP/IP packet codecs and an improved word list; provides supplementary fabric on the linked Springer web site, together with instructing slides, strategies to the end-of-chapter questions and supplementary routines with strategies; provides a better emphasis on cellular computing and community safety, and prolonged insurance of IPv6 (NEW); discusses networking versions and criteria, neighborhood quarter and huge region networks, community protocols, TCP/IP-based networks, community administration and instant communications; examines grid and cloud computing, microblogging, cellular advert hoc networks, near-field communique, energy over Ethernet and the floor Positioning process (NEW).
Publication by means of ok. N. King
- Cloud Computing and Digital Media: Fundamentals, Techniques, and Applications
- Snort 2.1 : intrusion detection
- Wireless All In One For Dummies
- Sams Teach Yourself Networking in 24 Hours 4th
- Building wireless sensor networks : theoretical and practical perspectives
Extra info for Build Awesome Command-Line Applications in Ruby 2: Control Your Computer, Simplify Your Life
If the argument is also provided, the app will list only those commands that match the argument. Since our bash function is given an optional second argument representing what the user has entered thus far on the command line, we can use that to pass to help. The end result is that your users can use tab completion with your app, and the chance of entering a nonexistent command is now very minimal—all without having to lift a finger! Note that for this to work, you must have todo installed in your PATH (we’ll see how users can do this in Chapter 7, Distribute Painlessly, on page 101).
Do |user| options[:user] = user end The presence of a regular expression as an argument to on indicates to OptionParser that it should validate the user-provided argument against this regular expression. Also note that if you include any capturing groups in your regexp (by using parentheses to delineate sections of the regexp), those values will be extracted and passed to the block as an Array. The raw value from the command line will be at index 0, and the extracted values will fill out the rest of the array.
1 Documenting a Command-Line Interface An experienced command-line user will try one or two things on the command line to discover how to use an app: they will run it without arguments or give it a help switch, such as -h or --help (-help is also a possibility because many X-Windows apps respond to this for help). In each case, the user will expect to see a one-screen summary of the app’s usage, including what arguments the app accepts or requires and what options are available. 1. org/wiki/Principle_of_least_astonishment Download from Wow!
Build Awesome Command-Line Applications in Ruby 2: Control Your Computer, Simplify Your Life by David B. Copeland