diff options
author | Azul <azul@riseup.net> | 2013-09-11 08:31:22 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-09-11 08:31:22 +0200 |
commit | 21fb605e3a57455e4a46c495ffcf36502f8fd1b9 (patch) | |
tree | 7db050580336457c12c3c385bfcb989182a8345e /lib/tapicero/couch_database_creator.rb | |
parent | 3c879a45a0f923e9dc9d7fc25cc04c3be7ffefae (diff) |
write _security to fresh couch
Diffstat (limited to 'lib/tapicero/couch_database_creator.rb')
-rw-r--r-- | lib/tapicero/couch_database_creator.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tapicero/couch_database_creator.rb b/lib/tapicero/couch_database_creator.rb index a4aaa0f..5a2849b 100644 --- a/lib/tapicero/couch_database_creator.rb +++ b/lib/tapicero/couch_database_creator.rb @@ -1,14 +1,19 @@ require 'couchrest' +require 'json' module Tapicero class CouchDatabaseCreator def initialize(host) + @host = host @couch = CouchRest.new(host) end - def create(name) - @couch.database(name).create! + def create(name, security = {}) + db = @couch.create_db(name) + puts security.to_json + puts "-> #{@host}#{name}/_security" + CouchRest.put "#{@host}#{name}/_security", security end end end |