lib/jazzy/config.rb in jazzy-0.0.20 vs lib/jazzy/config.rb in jazzy-0.1.0
- old
+ new
@@ -1,9 +1,10 @@
require 'optparse'
require 'pathname'
require 'uri'
+require 'jazzy/podspec_documenter'
require 'jazzy/source_declaration/access_control_level'
module Jazzy
# rubocop:disable Metrics/ClassLength
class Config
@@ -21,24 +22,34 @@
attr_accessor :docset_platform
attr_accessor :root_url
attr_accessor :version
attr_accessor :min_acl
attr_accessor :skip_undocumented
+ attr_accessor :podspec
+ attr_accessor :docset_icon
+ attr_accessor :docset_path
+ attr_accessor :source_directory
def initialize
+ PodspecDocumenter.configure(self, Dir['*.podspec{.json,}'].first)
self.output = Pathname('docs')
self.xcodebuild_arguments = []
self.author_name = ''
self.module_name = ''
self.author_url = URI('')
self.clean = false
self.docset_platform = 'jazzy'
self.version = '1.0'
self.min_acl = SourceDeclaration::AccessControlLevel.internal
self.skip_undocumented = false
+ self.source_directory = Pathname.pwd
end
+ def podspec=(podspec)
+ @podspec = PodspecDocumenter.configure(self, podspec)
+ end
+
# rubocop:disable Metrics/MethodLength
def self.parse!
config = new
OptionParser.new do |opt|
opt.banner = 'Usage: jazzy'
@@ -126,9 +137,27 @@
opt.on('--[no-]skip-undocumented',
"Don't document declarations that have no documentation \
comments.",
) do |skip_undocumented|
config.skip_undocumented = skip_undocumented
+ end
+
+ opt.on('--podspec FILEPATH') do |podspec|
+ config.podspec = Pathname(podspec)
+ end
+
+ opt.on('--docset-icon FILEPATH') do |docset_icon|
+ config.docset_icon = Pathname(docset_icon)
+ end
+
+ opt.on('--docset-path DIRPATH', 'The relative path for the generated ' \
+ 'docset') do |docset_path|
+ config.docset_path = docset_path
+ 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('-v', '--version', 'Print version number') do
puts 'jazzy version: ' + Jazzy::VERSION
exit