tsukasaoishi-miyazakiresistance 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +18 -1
  2. data/initializers/rdb.rb +13 -0
  3. metadata +1 -1
data/README.rdoc CHANGED
@@ -8,7 +8,7 @@ MiyazakiResistance is a library like ActiveRecord to use Tokyo Tyrant.
8
8
 
9
9
  == SYNOPSIS:
10
10
 
11
- require 'miyazaki_resistance'
11
+ require 'miyazakiresistance'
12
12
  class Example < MiyazakiResistance::Base
13
13
  set_server "localhost", 1975, :write
14
14
  set_server "slave", 1975, :standby
@@ -19,6 +19,23 @@ MiyazakiResistance is a library like ActiveRecord to use Tokyo Tyrant.
19
19
  set_column :created_at, :datetime, :index
20
20
  end
21
21
 
22
+ work = Example.new
23
+ work.name = "tsukasa"
24
+ work.age = 34
25
+ work.birthday => Date.today
26
+ work.save
27
+
28
+ Example.create(:name => "oishi", :age => 14, :birthday => Date.today)
29
+
30
+ Example.count
31
+ Example.count(:conditions => ["name = ?", "oishi"])
32
+
33
+ Example.find(1)
34
+ Example.find([1,2])
35
+ Example.find(:first)
36
+ Example.find(:all)
37
+ Example.find(:all, :conditions => ["name = ? age = ?", "tsukasa", 34], :order => "created_at DESC", :offset => 1, :limit => 1)
38
+
22
39
  == REQUIREMENTS:
23
40
 
24
41
  Tokyo Tyrant
@@ -0,0 +1,13 @@
1
+ module TokyoTyrant
2
+ class RDB
3
+ attr_accessor :host, :port
4
+
5
+ def open_with_save_params(host, port = 0)
6
+ @host = host
7
+ @port = port
8
+ open_without_save_params(host, port)
9
+ end
10
+ alias_method :open_without_save_params, :open
11
+ alias_method :open, :open_with_save_params
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsukasaoishi-miyazakiresistance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsukasa OISHI