sohm 0.0.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69c6cd0607dd5504902222e7b1f4ba805eed185d
4
- data.tar.gz: 58c03e9e6c90b847489688ec014cad18ada039b6
3
+ metadata.gz: a233394733ef9467944e0803a078e296f14f5a9b
4
+ data.tar.gz: 7c9f2a402a570e18428590d81d4dcf146c2b3f7f
5
5
  SHA512:
6
- metadata.gz: 50f648882a984944b87026d46e368c529fa9434d8df48db087e58e9f240dec6e9c048bb19b6625b60f8d55782feca4859f0319d53ec233e47d277012020db8f8
7
- data.tar.gz: 49f26999c6d7519f7d2b80ef891a179a61f1f24360e3a2cd274d515d6697624a2990daacef21cfd135a454e5bdf96c61d00a0eb5309d7a0c94029a4ed5b4f4df
6
+ metadata.gz: c7397fe0d14eea5851e5b7037590fcc24063a0dbe5dcdd31fccdd3dfff2fec88dd313274f4d233a5c6a73d1d25aaebb1146f8889bfa86139482f77009f08d966
7
+ data.tar.gz: 407951baa343da76d535067e72ac31defa8ab0c763f5d76f283bf4bab99474b415a6894f68b61d58c0a197d7706496cfb5af099d59ea7763fd582d391c676847
data/.travis.gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # This file is only used for TravisCI integration.
2
+
3
+ source 'http://rubygems.org'
4
+
5
+ gem 'redic', '~> 1.4.1'
6
+ gem 'nido', '~> 0.0.1'
7
+ gem 'msgpack', '~> 0.5.11'
8
+
9
+ gem 'cutest', '~> 1.2.2'
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.1
5
+ - 2.2
6
+ - ruby-head
7
+ gemfile: .travis.gemfile
8
+ services:
9
+ - redis-server
10
+ script: "make"
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Sohm
2
2
  ====
3
3
 
4
+ [![Build Status](https://travis-ci.org/xxuejie/sohm.svg?branch=master)](https://travis-ci.org/xxuejie/sohm)
5
+
4
6
  This forks [ohm](https://github.com/soveran/ohm) so as to work with [twemproxy](https://github.com/twitter/twemproxy) or similar systems.
5
7
 
6
8
  `Sohm` means `Slim ohm`.
@@ -0,0 +1,13 @@
1
+ module Sohm
2
+ module AutoId
3
+ def save
4
+ begin
5
+ id
6
+ rescue MissingID
7
+ self.id = redis.call("INCR", model.key["_id"]).to_s
8
+ end
9
+
10
+ super
11
+ end
12
+ end
13
+ end
data/lib/sohm/command.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Ohm
1
+ module Sohm
2
2
  class Command
3
3
  def self.[](operation, head, *tail)
4
4
  return head if tail.empty?
@@ -0,0 +1,18 @@
1
+ module Sohm
2
+ module IndexAll
3
+ def self.included(model)
4
+ model.index :all
5
+ model.extend ClassMethods
6
+ end
7
+
8
+ def all
9
+ "all"
10
+ end
11
+
12
+ module ClassMethods
13
+ def all
14
+ find(all: "all")
15
+ end
16
+ end
17
+ end
18
+ end
data/lib/sohm/json.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "json"
2
2
 
3
- module Ohm
3
+ module Sohm
4
4
  class Model
5
5
  # Export a JSON representation of the model by encoding `to_hash`.
6
6
  def to_json(*args)