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

, , Comments Off on Download E-books Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life PDF

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 solution to automate a backup, a construct, or a deployment and simplify your life.

As Ruby seasoned David Copeland explains, writing a command-line software that's self-documenting, strong, adaptable and without end precious is less complicated than it's possible you'll imagine. Ruby is especially fitted to this activity, because it combines high-level abstractions with "close to the steel" method interplay wrapped up in a concise, readable syntax. additionally, Ruby has the aid of a wealthy environment of open-source instruments and libraries.

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

You'll use loose, open resource parsers to create straightforward command-line interfaces in addition to command suites. you will see tips on how to use defaults to maintain concepts basic for daily clients, whereas giving complex clients concepts for extra advanced initiatives.

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

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

What You Need:

All you will have 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

Best Programming books

Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game

Physics is de facto very important to video game programmers who want to know tips on how to upload actual realism to their video games. they should take note of the legislation of physics when growing a simulation or video game engine, quite in 3D special effects, for the aim of constructing the consequences look extra actual to the observer or participant.

C: How to Program (6th Edition)

C tips on how to software, 6e, is perfect for introductory classes in C Programming. additionally for classes in Programming for Engineers, Programming for enterprise, and Programming for expertise. this article presents a precious reference for programmers and somebody attracted to studying the c program languageperiod.

Professional Ruby on Rails (Programmer to Programmer)

Not anything under a revolution within the manner net functions are constructed,Ruby on Rails (RoR) boasts an easy and intuitive nature that avoids programming repetition and makes it infinitely more straightforward to construct for the internet. This booklet captures the present top practices to teach you the best approach to construct a extraordinary internet software with RoR.

Perl Best Practices

Many programmers code through intuition, hoping on handy conduct or a "style" they picked up early on. they don't seem to be aware of all of the offerings they make, like how they layout their resource, the names they use for variables, or the types of loops they use. they're concentrated completely on difficulties they are fixing, suggestions they're developing, and algorithms they're enforcing.

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

Show sample text content

We didn’t contain that during the string given to desc; it’s an extra little bit of documentation the GLI derives for us once we use the default_value option to point out the default worth for a flag. be_helpful/todo/bin/todo desc "Path to the todo dossier" arg_name "todo_file" ➤ default_value "~/. todo. txt" flag :f default_value isn’t really for documentation; it permits us to specify the worth for a flag whilst the consumer omits it from the command line; which means the worth of global_options[:f] aren't nil; it is going to be ~/. todo. txt if the person omits -f on obtain from Wow! publication record erratum • talk about 42 • bankruptcy three. Be precious the command line. GLI helpfully contains this in our aid textual content, which means our documentation and our code will continually be constant. We’ve now discovered how effortless it's to supply support documentation for easy command-line apps and command suites. by way of including a number of additional strings to our code, our apps can simply support clients comprehend what the apps do and the way to take advantage of them. yet now not all apps are so uncomplicated. Command-line apps frequently supply subtle habit that can’t be simply defined within the one or strains of textual content on hand within the integrated support platforms. How will we offer specified documentation past basic support textual content? three. three together with a guy web page As we’ve noticeable, it’s effortless to rfile the choices, arguments, and instructions of a command-line app. this data, and the power to entry it from the app itself, is necessary to copy clients of your app; they could fast the right way to use your app the best way they should get their paintings performed. What if we'd like extra? might be we’d like a few longer examples for brand spanking new clients, or even our app is adequately advanced that we'd like extra space to provide an explanation for issues. Even an easy app like db_backup. rb can take advantage of a couple of examples and a few special documentation (such as a proof of the “iteration backup” idea or why the username needs to be in first. final format). There isn’t sufficient room within the integrated support supplied by means of OptionParser for this data. in addition, those should not information standard person will desire. common clients will simply wish the utilization assertion and suggestions reference through --help and won’t desire tutorials, examples, or distinctive documentation after they simply have to get a listing of thoughts. a standard UNIX app offers this distinct details in a handbook, or guy, web page, which clients entry through the fellow command. when you style guy ls at the command line, you’ll see a pleasant, targeted clarification of the ls command. even though, even supposing you may package a guy web page along with your Ruby commandline app, guy wouldn’t manage to entry it simply end result of the method RubyGems installs apps (we’ll speak extra approximately RubyGems in bankruptcy 7, Distribute Painlessly, on web page 101). no matter if guy may perhaps entry your app’s records, making a guy web page isn't any small feat; it calls for utilizing the nroff2 layout, that's bulky to take advantage of for writing documentation. 2. http:// en. wikipedia. org/wiki/Nroff obtain from Wow!

Rated 4.81 of 5 – based on 37 votes