Loading lib/jsduck/batch_processor.rb +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ module JsDuck # classes inside Relations container. def to_class_objects(docs, opts) classes = docs.map {|d| Class.new(d) } Relations.new(classes, opts.external_classes) Relations.new(classes, opts.external) end # Do all kinds of post-processing on Relations object. Loading lib/jsduck/options/parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -474,7 +474,7 @@ module JsDuck @opts.ignore_global = on end attribute :external_classes, [ attribute :external, [ # JavaScript builtins "Object", "String", Loading Loading @@ -520,7 +520,7 @@ module JsDuck "The wildcard '*' can be used to match a set of classes", "e.g. to ignore all classes of a particular namespace:", "--external='Foo.*'") do |classes| @opts.external_classes += classes @opts.external += classes end attribute :ext4_events Loading lib/jsduck/process/overrides.rb +3 −3 Original line number Diff line number Diff line Loading @@ -5,14 +5,14 @@ module JsDuck module Process class Overrides def initialize(classes_hash, opts = OpenStruct.new(:external_classes => [])) def initialize(classes_hash, opts = OpenStruct.new(:external => [])) @classes_hash = classes_hash @opts = opts end # Applies all override classes to target classes, then deletes # the overrides themselves from classes hash and adds the names # of all the processed overrides to external_classes list in # of all the processed overrides to external classes list in # options object. def process_all! overrides = [] Loading @@ -29,7 +29,7 @@ module JsDuck @classes_hash.delete(cls[:name]) end @opts.external_classes += overrides.map {|c| c[:name] } @opts.external += overrides.map {|c| c[:name] } end private Loading spec/options_spec.rb +6 −6 Original line number Diff line number Diff line Loading @@ -205,16 +205,16 @@ describe JsDuck::Options::Parser do end end describe :external_classes do describe :external do it "contains JavaScript builtins by default" do exts = parse().external_classes exts = parse().external %w(Object String Number Boolean RegExp Function Array Arguments Date).each do |name| exts.should include(name) end end it "contains JavaScript builtin error classes by default" do exts = parse().external_classes exts = parse().external exts.should include("Error") %w(Eval Range Reference Syntax Type URI).each do |name| exts.should include("#{name}Error") Loading @@ -222,17 +222,17 @@ describe JsDuck::Options::Parser do end it "contains the special anything-goes Mixed type" do parse().external_classes.should include("Mixed") parse().external.should include("Mixed") end it "can be used multiple times" do exts = parse("--external", "MyClass", "--external", "YourClass").external_classes exts = parse("--external", "MyClass", "--external", "YourClass").external exts.should include("MyClass") exts.should include("YourClass") end it "can be used with comma-separated list" do exts = parse("--external", "MyClass,YourClass").external_classes exts = parse("--external", "MyClass,YourClass").external exts.should include("MyClass") exts.should include("YourClass") end Loading Loading
lib/jsduck/batch_processor.rb +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ module JsDuck # classes inside Relations container. def to_class_objects(docs, opts) classes = docs.map {|d| Class.new(d) } Relations.new(classes, opts.external_classes) Relations.new(classes, opts.external) end # Do all kinds of post-processing on Relations object. Loading
lib/jsduck/options/parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -474,7 +474,7 @@ module JsDuck @opts.ignore_global = on end attribute :external_classes, [ attribute :external, [ # JavaScript builtins "Object", "String", Loading Loading @@ -520,7 +520,7 @@ module JsDuck "The wildcard '*' can be used to match a set of classes", "e.g. to ignore all classes of a particular namespace:", "--external='Foo.*'") do |classes| @opts.external_classes += classes @opts.external += classes end attribute :ext4_events Loading
lib/jsduck/process/overrides.rb +3 −3 Original line number Diff line number Diff line Loading @@ -5,14 +5,14 @@ module JsDuck module Process class Overrides def initialize(classes_hash, opts = OpenStruct.new(:external_classes => [])) def initialize(classes_hash, opts = OpenStruct.new(:external => [])) @classes_hash = classes_hash @opts = opts end # Applies all override classes to target classes, then deletes # the overrides themselves from classes hash and adds the names # of all the processed overrides to external_classes list in # of all the processed overrides to external classes list in # options object. def process_all! overrides = [] Loading @@ -29,7 +29,7 @@ module JsDuck @classes_hash.delete(cls[:name]) end @opts.external_classes += overrides.map {|c| c[:name] } @opts.external += overrides.map {|c| c[:name] } end private Loading
spec/options_spec.rb +6 −6 Original line number Diff line number Diff line Loading @@ -205,16 +205,16 @@ describe JsDuck::Options::Parser do end end describe :external_classes do describe :external do it "contains JavaScript builtins by default" do exts = parse().external_classes exts = parse().external %w(Object String Number Boolean RegExp Function Array Arguments Date).each do |name| exts.should include(name) end end it "contains JavaScript builtin error classes by default" do exts = parse().external_classes exts = parse().external exts.should include("Error") %w(Eval Range Reference Syntax Type URI).each do |name| exts.should include("#{name}Error") Loading @@ -222,17 +222,17 @@ describe JsDuck::Options::Parser do end it "contains the special anything-goes Mixed type" do parse().external_classes.should include("Mixed") parse().external.should include("Mixed") end it "can be used multiple times" do exts = parse("--external", "MyClass", "--external", "YourClass").external_classes exts = parse("--external", "MyClass", "--external", "YourClass").external exts.should include("MyClass") exts.should include("YourClass") end it "can be used with comma-separated list" do exts = parse("--external", "MyClass,YourClass").external_classes exts = parse("--external", "MyClass,YourClass").external exts.should include("MyClass") exts.should include("YourClass") end Loading