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
# workaround from | |
# http://stackoverflow.com/questions/1987386/foreign-key-name-in-datamapper-associations | |
field_naming_convention = lambda do |v| | |
if v.name.to_s[0..0] == v.name.to_s[0..0].upcase | |
v.name.to_s | |
else | |
DataMapper::NamingConventions::Field::Underscored.call(v) | |
end | |
end |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-websocket' | |
require 'json' | |
class Connection | |
attr_accessor :socket, :user_id | |
def initialize(socket, user_id) | |
@socket = socket |
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
gem list '\A(?:(?:d[mo])[_-]|data_?(?:mapper|objects)|extlib)' --no-versions \ | |
| xargs gem uninstall -aIx |
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
require 'ducktrap' | |
# Very simple ducktrap without any real world use | |
# | |
# Not transforming. | |
# | |
string = Ducktrap.build do | |
primitive(String) | |
end |
OlderNewer