From c420b06e0044627093a36c190d8b21abdfe4bd33 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 30 Aug 2013 09:49:28 +0300 Subject: [PATCH] Rename JsDuck::Log namespace to JsDuck::Warning. --- lib/jsduck/logger.rb | 4 ++-- lib/jsduck/options.rb | 4 ++-- lib/jsduck/{log/no_doc_warning.rb => warning/nodoc.rb} | 4 ++-- lib/jsduck/{log/warnings_parser.rb => warning/parser.rb} | 4 ++-- lib/jsduck/{log/warnings.rb => warning/registry.rb} | 8 ++++---- ...log_warnings_parser_spec.rb => warning_parser_spec.rb} | 6 +++--- spec/{log_warnings_spec.rb => warning_registry_spec.rb} | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) rename lib/jsduck/{log/no_doc_warning.rb => warning/nodoc.rb} (97%) rename lib/jsduck/{log/warnings_parser.rb => warning/parser.rb} (98%) rename lib/jsduck/{log/warnings.rb => warning/registry.rb} (97%) rename spec/{log_warnings_parser_spec.rb => warning_parser_spec.rb} (95%) rename spec/{log_warnings_spec.rb => warning_registry_spec.rb} (97%) diff --git a/lib/jsduck/logger.rb b/lib/jsduck/logger.rb index 7a55c74a..2fd1f2a0 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 0032f0b0..995780cb 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 be56afee..168a3e68 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 69df0599..d16263ba 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 144b0367..2681e30a 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 e64d7bee..e1ab1e34 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 8270896a..6bc551cf 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 -- GitLab