public
Description: RelaxDB provides a simple Ruby interface to CouchDB
Homepage:
Clone URL: git://github.com/paulcarey/relaxdb.git
relaxdb / .irbrc
100644 30 lines (22 sloc) 0.933 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'lib/relaxdb'
 
RelaxDB::UuidGenerator.id_length = 4
RelaxDB.configure :host => "localhost", :port => 5984, :design_doc => "scratch_dd", :logger => Logger.new(STDOUT)
RelaxDB.use_db "scratch"
 
# RelaxDB.enable_view_creation # uncomment to create all views
require 'spec/spec_models'
 
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = ".irb_history"
 
IRB.conf[:PROMPT_MODE] = :SIMPLE
 
def use_spec_db
  RelaxDB.configure :host => "localhost", :port => 5984, :design_doc => "spec_doc", :logger => Logger.new(STDOUT)
  RelaxDB.use_db "relaxdb_spec"
  RelaxDB.enable_view_creation
end
 
def new_spec_db
  RelaxDB.configure :host => "localhost", :port => 5984, :design_doc => "spec_doc", :logger => Logger.new(STDOUT)
  RelaxDB.delete_db "relaxdb_spec" rescue "ok"
  RelaxDB.use_db "relaxdb_spec"
  RelaxDB.replicate_db "relaxdb_spec_base", "relaxdb_spec"
  RelaxDB.enable_view_creation
end