Ruby Testing (ruby-script.shtml) | Updated: 21-Jul-2008 - 11:27
Ruby Include Script
BBEdit lets you include scripts written in Perl, Python, Ruby, or any other Unix scripting language.
Including Unix Scripts - Ruby
BBEdit lets you include scripts written in Perl, Python, Ruby, or any other Unix scripting language. The complete path name of the file being processed is passed to the script as its first argument, and any variables in the include statement are passed as additional arguments. (For Perl, all these can be retrieved by your script via @ARGV.)
Any text sent to STDOUT by the script will be taken as the value of the bbinclude operation and inserted into the HTML file. If an error occurs while running the script, the STDERR output, if any, will be inserted into the file along with the STDOUT, and a single line indicating the error will be added to the error browser.
See the dev folder for more examples.
Hello World Ruby Script
bbinclude ":scripts:ruby:HelloWorld.rb"
Hello, Ruby!!!!Getting img file dimensions
1 2 3 4 5 6 7 8 9 10 |
#!/usr/bin/ruby # get the image file and its size and return a <img scr""> tag #get the image file in imageFile = ARGV[2] # TODO - Figure out reading the file for the dimensions puts "<img class=\"book-image\" src=\"" + imageFile + "\">" |
Ruby - Include script test (ruby-script.shtml) | Updated: 2008 Jul 21 - 11:27
.png)
.jpg)












All orders purchased here at CurtSheller.com,
JazzGuitarResources.com, UkuleleResources.com
UkuleleChords.net and
UkuleleForGuitarPlayers.com
are processed using a secure shopping cart system and shipped within 48
hours USPS. Allow 7 to 10 business days for delivery. It is not our
intention to profit from shipping and handling charges. The rates are an
average cost, and intended to cover expenses only. Please do not ask how
long it will takes to get your order. All US orders are shipped USPS
Priority Mail® or USPS First-Class Mail® (under 1lb) and delivery dates
are not predictable. I do not check on an order not received until three
weeks have elapsed since it was shipped. Three weeks is not how long it
takes to get your order. Rather, it is how long it takes to convince us
that something is wrong. Some orders are returned by the USPS and we
have to wait to see if that has happened before any action is taken.
Thanks, Curt Sheller Publications. 

