The Well-Grounded Rubyist, Fourth Edition by David A Black and Joseph Leo III

by David A Black and Joseph Leo III · Views: 150 · Format: EPUB · Language: English (en)

Cover of The Well-Grounded Rubyist, Fourth Edition by David A Black and Joseph Leo III — Free EPUB on AnyEbooksEPUB

Example of usage -c Checks the syntax of a program file without executing the program ruby -c c2f.rb -w Gives warning messages during program execution ruby -w c2f.rb -e Executes the code provided in quotation marks on the command line ruby -e 'puts "Code demo!"' -l Line mode: prints a newline after every line of output ruby -le 'print "+ newline!"' -rname Requires the named feature ruby –rprofile -v Shows Ruby version information and executes the program in verbose mode ruby –v --version Shows Ruby version information ruby –-version -h Shows information about all command-line switches for the interpreter ruby –h Let’s look at each of these switches in more detail. Check syntax (-c) The -c switch tells Ruby to check the code in one or more files for syntactical accuracy without executing the code. It’s usually used in conjunction with the -w flag. Turn on warnings (-w) Running your program with -w causes the interpreter to run in warning mode. This means you’ll see more warnings printed to the screen than you otherwise would, drawing your attention to places in your program that, although not syntax errors, are stylistically or logically suspect. It’s Ruby’s way of saying, “What you’ve done is syntactically correct, but it’s weird. Are you sure you meant to do that?” Even without this switch, Ruby issues certain warnings, but fewer than it does in full warning mode. Execute literal script (-e) The -e switch tells the interpreter that the command line includes Ruby code in quo

★★★★★

Rate this eBook

File Name:195d71ddaa2ff68838bd6e3fe40d4d29.epub
Original Title:The Well-Grounded Rubyist, Fourth Edition
Creator / Author:David A Black and Joseph Leo III
Language:English (en)
Identifier:ASIN:392916
Publisher:David A Black and Joseph Leo III Publishing
Category:Non-fiction
Format:📗 EPUB eBook
File Size:3.5 MB

Community Reviews

Loading verified community reviews...

Related Non-fiction Titles