apache-config-generator/lib/apache/directory.rb

26 lines
777 B
Ruby
Raw Normal View History

2010-05-05 14:44:20 +00:00
module Apache
2010-05-10 19:57:34 +00:00
# Methods to handle directory settings
2010-05-05 14:44:20 +00:00
module Directories
2010-05-10 19:57:34 +00:00
# Create an Options directive
#
# The options passed into this method are Apachified:
# options :exec_cgi, :follow_sym_links #=> Options ExecCGI FollowSymLinks
2010-05-05 14:44:20 +00:00
def options(*opt)
2010-05-18 17:08:17 +00:00
create_options_list('options'.apachify, *opt)
2010-05-05 16:25:07 +00:00
end
2010-05-10 19:57:34 +00:00
# Create an IndexOptions directive
#
# The options passed into this method are Apachified:
# index_options :fancy_indexing, :suppress_description #=> IndexOptions FancyIndexing SuppressDescription
2010-05-05 16:25:07 +00:00
def index_options(*opt)
2010-05-18 17:08:17 +00:00
create_options_list('index_options'.apachify, *opt)
2010-05-05 14:44:20 +00:00
end
2010-05-07 17:56:49 +00:00
private
def create_options_list(tag, *opt)
2010-05-18 16:43:57 +00:00
self << "#{tag} #{opt.collect(&:optionify) * " "}"
2010-05-07 17:56:49 +00:00
end
2010-05-05 14:44:20 +00:00
end
end