lib/jazzy/config.rb in jazzy-0.2.1 vs lib/jazzy/config.rb in jazzy-0.2.2

- old
+ new

@@ -1,9 +1,10 @@ require 'optparse' require 'pathname' require 'uri' +require 'jazzy/doc' require 'jazzy/podspec_documenter' require 'jazzy/source_declaration/access_control_level' module Jazzy # rubocop:disable Metrics/ClassLength @@ -27,10 +28,11 @@ attr_accessor :podspec attr_accessor :docset_icon attr_accessor :docset_path attr_accessor :source_directory attr_accessor :excluded_files + attr_accessor :template_directory def initialize PodspecDocumenter.configure(self, Dir['*.podspec{,.json}'].first) self.output = Pathname('docs') self.xcodebuild_arguments = [] @@ -42,16 +44,22 @@ self.version = '1.0' self.min_acl = SourceDeclaration::AccessControlLevel.public self.skip_undocumented = false self.source_directory = Pathname.pwd self.excluded_files = [] + self.template_directory = Pathname(__FILE__).parent + 'templates' end def podspec=(podspec) @podspec = PodspecDocumenter.configure(self, podspec) end + def template_directory=(template_directory) + @template_directory = template_directory + Doc.template_path = template_directory + end + # rubocop:disable Metrics/MethodLength def self.parse! config = new OptionParser.new do |opt| opt.banner = 'Usage: jazzy' @@ -157,9 +165,14 @@ end opt.on('--source-directory DIRPATH', 'The directory that contains ' \ 'the source to be documented') do |source_directory| config.source_directory = Pathname(source_directory) + end + + opt.on('t', '--template-directory DIRPATH', 'The directory that ' \ + 'contains the mustache templates to use') do |template_directory| + config.template_directory = Pathname(template_directory) end opt.on('--readme FILEPATH', 'The path to a markdown README file') do |readme| config.readme_path = Pathname(readme)