Enum::Value lets you create immutable value object instances from your Enum::Base subclasses. These Value instances delegate to the Enum::Base subclass for all read and write operations. Additionally, these instances are comparable with each other AND with strings, symbols, and integers (the integers representing enum indexes).
class Side < Enum::Base
values :left, :right, :whole
This file contains 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
# Swappable datastore example | |
ROM_ADAPTER = :sql # or :memory | |
# ...setup | |
class UsersSql < ROM::Relation[:sql] | |
dataset :users | |
def by_name(name) |
This file contains 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
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Forked from bkimble's gist https://gist.github.com/bkimble/1365005 | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
# Currently resides at https://gist.github.com/ginjo/aaa4a4395fcdbbad3d29 | |
# | |
# This fork separates the server query code from results presentation. | |
# The primary function of this script is to return an array of hashes of | |
# key items from any number of provided memcached servers. |
This file contains 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
user@host01:~$ rvm get head | |
Downloading https://get.rvm.io | |
Downloading https://github.com/wayneeseguin/rvm/archive/master.tar.gz | |
Upgrading the RVM installation in /usr/local/rvm/ | |
Can not update 'scripts/zsh/Completion/_rvm', it's a conflict between Zsh and multiuser installation, prefix the command with 'rvmsudo' to update this file. | |
Can not update 'scripts/extras/completion.zsh/_rvm', it's a conflict between Zsh and multiuser installation, prefix the command with 'rvmsudo' to update this file. | |
Found 5384 files not belonging to 'rvm', | |
use `--debug` to see the list, run `rvmsudo rvm get stable` to fix it., prefix the command with 'rvmsudo' to fix it, if the situation persist report a bug. | |
Found 1103 directories with mode different then '775', |
This file contains 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
user@host:~/$ rvm repair wrappers | |
Regenerating all wrappers... | |
Regenerating wrappers for ruby-1.8.7-head................................................................. | |
Error running '__rvm_with ruby-1.8.7-head run_gem_wrappers_regenerate', | |
showing last 15 lines of /usr/local/rvm/log/1411540848/wrappers.regenerate.ruby-1.8.7-head.log | |
+ gem install gem-wrappers -v '>=1.2.4' --no-ri --no-rdoc | |
ERROR: Error installing gem-wrappers: | |
ERROR: Failed to build gem native extension. | |
/usr/local/rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb |
This file contains 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
# # # # # scheduled_job.rb - recurring schedules for delayed_job.rb # # # # # | |
# | |
# This file is version controlled at https://gist.github.com/ginjo/3688965 | |
# | |
# Forked from https://gist.github.com/kares/1024726 | |
# | |
# This is an enhanced version of the original scheduled_job.rb | |
# It was born out of the need to schedule a whole bunch of simple jobs. | |
# I started with the sample below and quickly found that I was repeating | |
# a lot of code. So I created the Delayed::Task pseudo-class that allows |
NewerOlder