require 'couch' require 'couch/mapper' require 'couch/core_ext/string/inflections' require 'rubygems' require "rest_client" require 'json' require 'thor/group' module Couch module Actions class Base < Thor::Group attr_reader :mapper include Thor::Actions class_option :database, :type => :string def initialize(*args) super @mapper = Mapper.new(destination_root) end def self.banner "couch #{to_s.split('::').last.underscore}" end private def database options[:database] || Couch.database end def url_for(id) File.join database, id end end end end