Sha256: e71014f1134726ebc73bb2946253acd21dc0cb7230ae4166d585155691340619
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require 'rubygems' require_gem 'builder' require File.join(File.dirname(__FILE__), 'libxml_loader') module S33r # For manipulating logging directives on resources # (see http://docs.amazonwebservices.com/AmazonS3/2006-03-01/LoggingHowTo.html). # # Creating a LoggingResource instance using new and no arguments will generate a "blank" instance; # this can be put to the ?logging URL for a resource to remove logging from it. class LoggingResource attr_reader :log_target, :log_prefix def initialize(log_target=nil, log_prefix=nil) @log_target = log_target @log_prefix = log_prefix end # Generate a BucketLoggingStatus XML document for putting to the ?logging # URL for a resource. # #-- TODO: test generates correct XML def to_xml xml_str = "" xml = Builder::XmlMarkup.new(:target => xml_str, :indent => 0) xml.instruct! # BucketLoggingStatus XML. xml.BucketLoggingStatus({"xmlns" => RESPONSE_NAMESPACE_URI}) { unless @log_target.nil? and @log_prefix.nil? xml.LoggingEnabled { xml.TargetBucket @log_target xml.TargetPrefix @log_prefix } end } xml_str end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
s33r-0.4.2 | lib/s33r/logging.rb |