This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################# | |
# Class: Vash (Ruby Volatile Hash) | |
# Hash that returns values only for a short time. This is useful as a cache | |
# where I/O is involved. The primary goal of this object is to reduce I/O | |
# access and due to the nature of I/O being slower then memory, you should also | |
# see a gain in quicker response times. | |
# | |
# For example, if Person.first found the first person from the database & cache | |
# was an instance of Vash then the following would only contact the database for | |
# the first iteration: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Synchronous (blocking) | |
# Returns the output of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
NewerOlder