Posted by Tim Galyean in Cloud
on Sep 26th, 2010
So I figured I would write this article as a response to some questions and feedback I received from my earlier post “CloudFiles curl example” which outline’s some example usage to interact with the CloudFiles public API as well as some example code.
Ryan over at http://www.ryanuber.com/ brought up some interesting questions that I left out in my original post based off of the assumption that the reading audience was already familiar with CloudFiles.
Here are two very important and relevant questions that he asked:
“What kind of output do you get?”
“What kinds of...
Posted by Tim Galyean in Ruby
on Apr 28th, 2010
Here is a pretty basic example of a ruby script, which contains a function, defining a variable, grabbing data from standard input, and calling the function.
#!/usr/bin/ruby
$variable = STDIN.gets
def function(variable)
puts "Your STDIN is: #{variable}"
end
function($variable)
Example:
[h1tman@h1tman ruby]$ echo "TEST" | ./stdin.rb
Your STDIN is: TEST
[h1tman@h1tman ruby]$