Loading lib/jsduck/options.rb +20 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ module JsDuck def initialize @input_files = [] @exclude = [] @output_dir = nil @ignore_global = false Loading Loading @@ -161,6 +162,7 @@ module JsDuck def parse!(argv) parse_options(argv) auto_detect_config_file unless @config_option_specified exclude_input_files validate if @custom_tag_paths.length > 0 Loading Loading @@ -268,6 +270,15 @@ module JsDuck JsDuck::Util::IO.encoding = encoding end opts.on('--exclude=PATH', "Exclude input file or directory.", "", "For example to include all the subdirs of", "/app/js except /app/js/new, run JSDuck with:", "", " jsduck /app/js --exclude /app/js/new") do |path| @exclude << path end opts.separator "" opts.separator "Customizing output:" opts.separator "" Loading Loading @@ -854,6 +865,15 @@ module JsDuck end end # When --exclude option used, removes the files matching the # exclude path from @input_files def exclude_input_files @exclude.each do |exclude_path| exclude_re = Regexp.new('\A' + Regexp.escape(canonical(exclude_path))) @input_files.reject! {|f| f =~ exclude_re } end end # Extracts files of first build in jsb file def extract_jsb_files(jsb_file) json = Util::Json.read(jsb_file) Loading Loading
lib/jsduck/options.rb +20 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ module JsDuck def initialize @input_files = [] @exclude = [] @output_dir = nil @ignore_global = false Loading Loading @@ -161,6 +162,7 @@ module JsDuck def parse!(argv) parse_options(argv) auto_detect_config_file unless @config_option_specified exclude_input_files validate if @custom_tag_paths.length > 0 Loading Loading @@ -268,6 +270,15 @@ module JsDuck JsDuck::Util::IO.encoding = encoding end opts.on('--exclude=PATH', "Exclude input file or directory.", "", "For example to include all the subdirs of", "/app/js except /app/js/new, run JSDuck with:", "", " jsduck /app/js --exclude /app/js/new") do |path| @exclude << path end opts.separator "" opts.separator "Customizing output:" opts.separator "" Loading Loading @@ -854,6 +865,15 @@ module JsDuck end end # When --exclude option used, removes the files matching the # exclude path from @input_files def exclude_input_files @exclude.each do |exclude_path| exclude_re = Regexp.new('\A' + Regexp.escape(canonical(exclude_path))) @input_files.reject! {|f| f =~ exclude_re } end end # Extracts files of first build in jsb file def extract_jsb_files(jsb_file) json = Util::Json.read(jsb_file) Loading