Class: RuboCop::Cop::SketchupRequirements::RubyStdLibNamespace

Inherits:
SketchUp::Cop
  • Object
show all
Includes:
SketchUp::NamespaceChecker, SketchUp::NoCommentDisable
Defined in:
lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb

Constant Summary collapse

MSG =
'Do not modify Ruby stdlib functionality.'.freeze
NAMESPACES_RUBY_1_8_6_STDLIB =

We check only against the top level namespaces. The stdlib define more objects, but they are under one of the top level namespaces listed.

[
  "class Benchmark",
  "class BigDecimal",
  "class CGI",
  "class CSV",
  "class Curses",
  "class Date",
  "class DateTime",
  "class DBM",
  "class DBMError",
  "class Delegater",
  "class Delegator",
  "class SimpleDelegater",
  "class SimpleDelegator",
  "class Digest",
  "class MD5",
  "class SHA1",
  "class DL",
  "class Win32API",
  "class ACL",
  "class DRb",
  "class Foo",
  "class ERB",
  "class GDBM",
  "class GDBMError",
  "class GDBMFatalError",
  "class Generator",
  "class SyncEnumerator",
  "class GetoptLong",
  "class GServer",
  "class Iconv",
  "class IPAddr",
  "class Socket",
  "class IRB",
  "class RubyLex",
  "class RubyToken",
  "class XMP",
  "class Logger",
  "class Mail",
  "class Prime",
  "class Matrix",
  "class Vector",
  "class Monitor",
  "class MonitorMixin",
  "class Net",
  "class OpenURI",
  "class URI",
  "class OpenSSL",
  "class OptionParser",
  "class OpenStruct",
  "class Pathname",
  "class PP",
  "class PrettyPrint",
  "class PStore",
  "class PTY",
  "class Racc",
  "class DOT",
  "class DefaultDisplay",
  "class Generators",
  "class NameDescriptor",
  "class Options",
  "class RDoc",
  "class RI",
  "class RiDriver",
  "class RiError",
  "class SM",
  "class TemplatePage",
  "class TruncatedDataError",
  "class Resolv",
  "class SOCKSSocket",
  "class TCPSocket",
  "class UDPSocket",
  "class REXML",
  "class Rinda",
  "class RSS",
  "class XML",
  "class XMLEncoding_ja",
  "class RUNIT",
  "class Scanf",
  "class SDBM",
  "class SDBMError",
  "class Set",
  "class SortedSet",
  "class Shell",
  "class SOAP",
  "class WEBrick",
  "class BasicSocket",
  "class IPSocket",
  "class SocketError",
  "class TCPServer",
  "class UNIXServer",
  "class UNIXSocket",
  "class StringIO",
  "class StringScanner",
  "class Sync_m",
  "class Synchronizer",
  "class TestSyslog",
  "class Tempfile",
  "class Test",
  "class ThWait",
  "class Timeout",
  "class Tracer",
  "class TSort",
  "class WeakRef",
  "class Win32",
  "class OLEProperty",
  "class WIN32OLE",
  "class WIN32OLERuntimeError",
  "class WIN32OLE_EVENT",
  "class WIN32OLE_METHOD",
  "class WIN32OLE_PARAM",
  "class WIN32OLE_TYPE",
  "class WIN32OLE_VARIABLE",
  "class WSDL",
  "class HttpServer",
  "class NQXML",
  "class XMLRPC",
  "class XSD",
  "class YAML",
  "class Zlib",
  "module Abbrev",
  "module Base64",
  "module Benchmark",
  "module BigMath",
  "module Jacobian",
  "module LUSolve",
  "module Newton",
  "module CGI",
  "module Curses",
  "module Digest",
  "module DL",
  "module DRb",
  "module ERB",
  "module Etc",
  "module Fcntl",
  "module FileUtils",
  "module Finalizer",
  "module Find",
  "module Forwardable",
  "module SingleForwardable",
  "module Iconv",
  "module IPSocket",
  "module IRB",
  "module RubyToken",
  "module Logger",
  "module Config",
  "module Logging",
  "module MonitorMixin",
  "module Mutex_m",
  "module Net",
  "module Kconv",
  "module NKF",
  "module Observable",
  "module OpenURI",
  "module URI",
  "module Open3",
  "module Buffering",
  "module OpenSSL",
  "module OptionParser",
  "module ParseDate",
  "module Pathname",
  "module Ping",
  "module PP",
  "module Profiler__",
  "module PStore",
  "module PTY",
  "module Racc",
  "module DOT",
  "module Generators",
  "module Options",
  "module RDoc",
  "module RI",
  "module RiDisplay",
  "module SM",
  "module TokenStream",
  "module Readline",
  "module Resolv",
  "module REXML",
  "module Rinda",
  "module RSS",
  "module XML",
  "module XMLEncoding_ja",
  "module RUNIT",
  "module Scanf",
  "module Shell",
  "module Singleton",
  "module SOAP",
  "module WEBrick",
  "module Socket",
  "module Synchronizer_m",
  "module Syslog",
  "module Test",
  "module Timeout",
  "module TSort",
  "module Win32",
  "module WIN32OLE",
  "module WSDL",
  "module NQXML",
  "module XMLRPC",
  "module XSD",
  "module YAML",
  "module Zlib",
].freeze
NAMESPACES_RUBY_2_0_0_STDLIB =
[
  "class Benchmark",
  "class BigDecimal",
  "class CGI",
  "class CSV",
  "class Curses",
  "class FileViewer",
  "class Date",
  "class DateTime",
  "class DBM",
  "class DBMError",
  "class DEBUGGER__",
  "class Delegator",
  "class SimpleDelegator",
  "class Digest",
  "class DL",
  "class Win32",
  "class Win32API",
  "class ACL",
  "class DRb",
  "class Foo",
  "class ERB",
  "class Fiddle",
  "class FileUtils",
  "class GDBM",
  "class GDBMError",
  "class GDBMFatalError",
  "class GetoptLong",
  "class GServer",
  "class IPAddr",
  "class Socket",
  "class IRB",
  "class RubyLex",
  "class RubyToken",
  "class XMP",
  "class JSON",
  "class OpenStruct",
  "class Logger",
  "class Matrix",
  "class Vector",
  "class MiniTest",
  "class ParallelEach",
  "class PrideIO",
  "class PrideLOL",
  "class Monitor",
  "class MonitorMixin",
  "class Net",
  "class EXCEPTION_TYPE",
  "class HTTPMovedTemporarily",
  "class HTTPMultipleChoice",
  "class HTTPRequestURITooLarge",
  "class OpenURI",
  "class URI",
  "class OpenSSL",
  "class OptionParser",
  "class Pathname",
  "class PP",
  "class PrettyPrint",
  "class Prime",
  "class PStore",
  "class Psych",
  "class PTY",
  "class Racc",
  "class CompositePublisher",
  "class Rake",
  "class SshDirPublisher",
  "class SshFilePublisher",
  "class SshFreshDirPublisher",
  "class RDoc",
  "class RDocTask",
  "class Resolv",
  "class IPSocket",
  "class SOCKSSocket",
  "class TCPSocket",
  "class UDPSocket",
  "class REXML",
  "class Rinda",
  "class Ripper",
  "class RSS",
  "class XML",
  "class XMLEncoding_ja",
  "class Gem",
  "class Requirement",
  "class TempIO",
  "class YAML",
  "class Scanf",
  "class SDBM",
  "class SDBMError",
  "class Set",
  "class SortedSet",
  "class Shell",
  "class Addrinfo",
  "class BasicSocket",
  "class SocketError",
  "class TCPServer",
  "class UNIXServer",
  "class UNIXSocket",
  "class StringIO",
  "class StringScanner",
  "class Sync_m",
  "class Synchronizer",
  "class Syslog",
  "class Tempfile",
  "class Test",
  "class ThWait",
  "class Timeout",
  "class Tracer",
  "class TSort",
  "class WeakRef",
  "class WEBrick",
  "class OLEProperty",
  "class WIN32OLE",
  "class WIN32OLERuntimeError",
  "class WIN32OLE_EVENT",
  "class WIN32OLE_METHOD",
  "class WIN32OLE_PARAM",
  "class WIN32OLE_TYPE",
  "class WIN32OLE_TYPELIB",
  "class WIN32OLE_VARIABLE",
  "class WIN32OLE_VARIANT",
  "class HttpServer",
  "class NQXML",
  "class XMLRPC",
  "class Zlib",
  "module Abbrev",
  "module Base64",
  "module Benchmark",
  "module BigMath",
  "module Jacobian",
  "module LUSolve",
  "module Newton",
  "module CGI",
  "module CMath",
  "module Coverage",
  "module Curses",
  "module DEBUGGER__",
  "module Digest",
  "module DL",
  "module Win32",
  "module DRb",
  "module E2MM",
  "module English",
  "module ERB",
  "module Etc",
  "module FileUtils",
  "module RbConfig",
  "module Fcntl",
  "module Fiddle",
  "module Find",
  "module Forwardable",
  "module SingleForwardable",
  "module IPSocket",
  "module IRB",
  "module RubyToken",
  "module JSON",
  "module Logger",
  "module MiniTest",
  "module Minitest",
  "module MakeMakefile",
  "module MonitorMixin",
  "module Mutex_m",
  "module Net",
  "module Kconv",
  "module NKF",
  "module Observable",
  "module OpenURI",
  "module URI",
  "module Open3",
  "module OpenSSL",
  "module OptionParser",
  "module Pathname",
  "module PP",
  "module Prime",
  "module Profiler__",
  "module Psych",
  "module PTY",
  "module Racc",
  "module RDoc",
  "module Rake",
  "module Sys",
  "module Readline",
  "module Resolv",
  "module REXML",
  "module Rinda",
  "module RSS",
  "module XML",
  "module XMLEncoding_ja",
  "module Gem",
  "module YAML",
  "module Scanf",
  "module SecureRandom",
  "module Shell",
  "module Shellwords",
  "module Singleton",
  "module Synchronizer_m",
  "module Syslog",
  "module Test",
  "module Timeout",
  "module TSort",
  "module WeakRef",
  "module WEBrick",
  "module WIN32OLE",
  "module NQXML",
  "module XMLRPC",
  "module Zlib",
].freeze
NAMESPACES_RUBY_2_2_6_STDLIB =
[
  "class Benchmark",
  "class BigDecimal",
  "class CGI",
  "class CSV",
  "class Date",
  "class DateTime",
  "class DBM",
  "class DBMError",
  "class DEBUGGER__",
  "class Delegator",
  "class SimpleDelegator",
  "class Digest",
  "class ACL",
  "class DRb",
  "class ERB",
  "class Fiddle",
  "class FileUtils",
  "class GDBM",
  "class GDBMError",
  "class GDBMFatalError",
  "class GetoptLong",
  "class IPAddr",
  "class Socket",
  "class IRB",
  "class RubyLex",
  "class RubyToken",
  "class XMP",
  "class JSON",
  "class OpenStruct",
  "class Logger",
  "class Matrix",
  "class Vector",
  "class Monitor",
  "class MonitorMixin",
  "class Net",
  "class EXCEPTION_TYPE",
  "class HTTPMovedTemporarily",
  "class HTTPMultipleChoice",
  "class HTTPRequestURITooLarge",
  "class OpenURI",
  "class URI",
  "class OpenSSL",
  "class OptParse",
  "class OptionParser",
  "class Pathname",
  "class PP",
  "class PrettyPrint",
  "class Prime",
  "class PStore",
  "class Psych",
  "class PTY",
  "class Racc",
  "class Rake",
  "class RDoc",
  "class RDocTask",
  "class Resolv",
  "class IPSocket",
  "class SOCKSSocket",
  "class TCPSocket",
  "class UDPSocket",
  "class REXML",
  "class Rinda",
  "class Ripper",
  "class RSS",
  "class XML",
  "class XMLEncoding_ja",
  "class Gem",
  "class TempIO",
  "class Scanf",
  "class SDBM",
  "class SDBMError",
  "class Set",
  "class SortedSet",
  "class Shell",
  "class Addrinfo",
  "class BasicSocket",
  "class SocketError",
  "class TCPServer",
  "class UNIXServer",
  "class UNIXSocket",
  "class StringIO",
  "class StringScanner",
  "class Sync_m",
  "class Synchronizer",
  "class Syslog",
  "class Tempfile",
  "class ThWait",
  "class Timeout",
  "class Tracer",
  "class TSort",
  "class WeakRef",
  "class WEBrick",
  "class OLEProperty",
  "class WIN32OLE",
  "class WIN32OLERuntimeError",
  "class WIN32OLE_EVENT",
  "class WIN32OLE_METHOD",
  "class WIN32OLE_PARAM",
  "class WIN32OLE_RECORD",
  "class WIN32OLE_TYPE",
  "class WIN32OLE_TYPELIB",
  "class WIN32OLE_VARIABLE",
  "class WIN32OLE_VARIANT",
  "class NQXML",
  "class XMLRPC",
  "class YAML",
  "class Zlib",
  "module Abbrev",
  "module Base64",
  "module Benchmark",
  "module BigMath",
  "module Jacobian",
  "module LUSolve",
  "module Newton",
  "module CGI",
  "module CMath",
  "module Coverage",
  "module DEBUGGER__",
  "module Digest",
  "module DRb",
  "module Exception2MessageMapper",
  "module English",
  "module ERB",
  "module Etc",
  "module FileUtils",
  "module RbConfig",
  "module Fcntl",
  "module Fiddle",
  "module Find",
  "module Forwardable",
  "module SingleForwardable",
  "module IPSocket",
  "module IRB",
  "module RubyToken",
  "module JSON",
  "module Logger",
  "module MakeMakefile",
  "module MonitorMixin",
  "module Mutex_m",
  "module Net",
  "module Kconv",
  "module NKF",
  "module Observable",
  "module OpenURI",
  "module URI",
  "module Open3",
  "module OpenSSL",
  "module OptionParser",
  "module Pathname",
  "module PP",
  "module Prime",
  "module Profiler__",
  "module Psych",
  "module PTY",
  "module Racc",
  "module Rake",
  "module RDoc",
  "module Test",
  "module Readline",
  "module Resolv",
  "module REXML",
  "module Rinda",
  "module RSS",
  "module XML",
  "module XMLEncoding_ja",
  "module Gem",
  "module YAML",
  "module Scanf",
  "module SecureRandom",
  "module Shell",
  "module Shellwords",
  "module Singleton",
  "module Synchronizer_m",
  "module Syslog",
  "module Timeout",
  "module TSort",
  "module UnicodeNormalize",
  "module WeakRef",
  "module WEBrick",
  "module WIN32OLE",
  "module NQXML",
  "module XMLRPC",
  "module Zlib",
].freeze
NAMESPACES_RUBY_STDLIB =
(
  NAMESPACES_RUBY_1_8_6_STDLIB |
  NAMESPACES_RUBY_2_0_0_STDLIB |
  NAMESPACES_RUBY_2_2_6_STDLIB
).freeze
NAMESPACES =
NAMESPACES_RUBY_STDLIB.map { |item| item.split(' ').last }

Constants included from SketchUp::Config

SketchUp::Config::DEFAULT_CONFIGURATION

Instance Method Summary collapse

Methods included from SketchUp::NamespaceChecker

#check_namespace, #in_namespace?, #on_casgn, #on_class, #on_def, #on_module

Methods inherited from SketchUp::Cop

inherited, #relevant_file?

Instance Method Details

#namespacesObject


621
622
623
# File 'lib/rubocop/sketchup/cop/requirements/ruby_stdlib_namespace.rb', line 621

def namespaces
  NAMESPACES
end