diff --git a/lib/jsduck/logger.rb b/lib/jsduck/logger.rb index 7a55c74adcd6c5f4c58078757851bc8fd77532ac..2fd1f2a03bd5a6e04379064fa4c80d5658c56ada 100644 --- a/lib/jsduck/logger.rb +++ b/lib/jsduck/logger.rb @@ -1,6 +1,6 @@ require 'jsduck/util/singleton' require 'jsduck/util/os' -require 'jsduck/log/warnings' +require 'jsduck/warning/registry' module JsDuck @@ -19,7 +19,7 @@ module JsDuck @verbose = false @colors = nil - @warnings = Log::Warnings.new + @warnings = Warning::Registry.new @shown_warnings = {} end diff --git a/lib/jsduck/options.rb b/lib/jsduck/options.rb index 0032f0b0c5cd83aaaa7f9862ba49eec735da6fc4..995780cb5ad7a08f786f65da88cab605148b9dfd 100644 --- a/lib/jsduck/options.rb +++ b/lib/jsduck/options.rb @@ -6,7 +6,7 @@ require 'jsduck/util/io' require 'jsduck/util/parallel' require 'jsduck/tag_registry' require 'jsduck/js/ext_patterns' -require 'jsduck/log/warnings_parser' +require 'jsduck/warning/parser' module JsDuck @@ -698,7 +698,7 @@ module JsDuck "", *Logger.doc_warnings) do |warnings| begin - Log::WarningsParser.new(warnings).parse.each do |w| + Warning::Parser.new(warnings).parse.each do |w| Logger.set_warning(w[:type], w[:enabled], w[:path], w[:params]) end rescue Exception => e diff --git a/lib/jsduck/log/no_doc_warning.rb b/lib/jsduck/warning/nodoc.rb similarity index 97% rename from lib/jsduck/log/no_doc_warning.rb rename to lib/jsduck/warning/nodoc.rb index be56afee4f6fa4dc007fc3030ab386acc85538b7..168a3e688dccd14143baa646fdfca2cd65196e7f 100644 --- a/lib/jsduck/log/no_doc_warning.rb +++ b/lib/jsduck/warning/nodoc.rb @@ -1,10 +1,10 @@ require 'set' module JsDuck - module Log + module Warning # Missing documentation warnings management - class NoDocWarning + class Nodoc TYPES = Set[nil, :class, :member, :param] VISIBILITIES = Set[nil, :public, :protected, :private] diff --git a/lib/jsduck/log/warnings_parser.rb b/lib/jsduck/warning/parser.rb similarity index 98% rename from lib/jsduck/log/warnings_parser.rb rename to lib/jsduck/warning/parser.rb index 69df05992d99f201f930b01d660a6068bedc839c..d16263baeefab3d19ebf260301119363f24df1e8 100644 --- a/lib/jsduck/log/warnings_parser.rb +++ b/lib/jsduck/warning/parser.rb @@ -1,7 +1,7 @@ require 'strscan' module JsDuck - module Log + module Warning # Parses the warnings passed in from command line # @@ -23,7 +23,7 @@ module JsDuck # # := .* # - class WarningsParser + class Parser def initialize(string) @scanner = StringScanner.new(string) end diff --git a/lib/jsduck/log/warnings.rb b/lib/jsduck/warning/registry.rb similarity index 97% rename from lib/jsduck/log/warnings.rb rename to lib/jsduck/warning/registry.rb index 144b0367ee95ed47918b198f6eccf9782b0026cd..2681e30a4ee46e7e6b86838a3bb73685f9a11433 100644 --- a/lib/jsduck/log/warnings.rb +++ b/lib/jsduck/warning/registry.rb @@ -1,10 +1,10 @@ -require 'jsduck/log/no_doc_warning' +require 'jsduck/warning/nodoc' module JsDuck - module Log + module Warning # Warnings management - class Warnings + class Registry def initialize @docs = [ @@ -51,7 +51,7 @@ module JsDuck :no_doc_param => {:msg => "Alias for +nodoc(param,public)", :params => [:param, :public]}, } - @nodoc = Log::NoDocWarning.new + @nodoc = Warning::Nodoc.new # Turn off all warnings by default. # This is good for testing. diff --git a/spec/log_warnings_parser_spec.rb b/spec/warning_parser_spec.rb similarity index 95% rename from spec/log_warnings_parser_spec.rb rename to spec/warning_parser_spec.rb index e64d7bee3347f4a5465338267f7255e9ae3642f9..e1ab1e347b1115d1fed661aa85bee444dabdf316 100644 --- a/spec/log_warnings_parser_spec.rb +++ b/spec/warning_parser_spec.rb @@ -1,8 +1,8 @@ -require "jsduck/log/warnings_parser" +require "jsduck/warning/parser" -describe JsDuck::Log::WarningsParser do +describe JsDuck::Warning::Parser do def parse(s) - JsDuck::Log::WarningsParser.new(s).parse + JsDuck::Warning::Parser.new(s).parse end describe "parsing empty string" do diff --git a/spec/log_warnings_spec.rb b/spec/warning_registry_spec.rb similarity index 97% rename from spec/log_warnings_spec.rb rename to spec/warning_registry_spec.rb index 8270896a842ab19e870c2139223f308cffb37246..6bc551cfcf73a145593a0caf447085d9a88b3671 100644 --- a/spec/log_warnings_spec.rb +++ b/spec/warning_registry_spec.rb @@ -1,8 +1,8 @@ -require "jsduck/log/warnings" +require "jsduck/warning/registry" -describe JsDuck::Log::Warnings do +describe JsDuck::Warning::Registry do let(:warnings) do - JsDuck::Log::Warnings.new + JsDuck::Warning::Registry.new end let(:usual_warnings) do