Module: RuboCop::Lts::Ruby::Catalog

Defined in:
lib/rubocop/lts/ruby/catalog.rb

Overview

Runtime APIs whose availability is tied to the Ruby release that added them. Keep entries explicit until a versioned API source can be made authoritative.

Defined Under Namespace

Classes: Entry

Constant Summary collapse

ENTRIES =
[
  entry("ARGF", :codepoints, "2.0"),
  entry("ARGF", :each_codepoint, "2.0"),
  entry("Array", :append, "2.5"),
  entry("Array", :bsearch, "2.0"),
  entry("Array", :bsearch_index, "2.3"),
  entry("Array", :fetch_values, "3.4"),
  entry("Array", :prepend, "2.5"),
  entry("Array", :dig, "2.3"),
  entry("Array", :difference, "2.6"),
  entry("Array", :filter, "2.6"),
  entry("Array", :filter!, "2.6"),
  entry("Array", :intersection, "2.7"),
  entry("Array", :intersect?, "3.1"),
  entry("Array", :minmax, "2.7"),
  entry("Array", :sum, "2.4"),
  entry("Array", :to_h, "2.1"),
  entry("Array", :union, "2.6"),
  entry("Binding", :local_variable_defined?, "2.1"),
  entry("Binding", :local_variable_get, "2.1"),
  entry("Binding", :local_variable_set, "2.1"),
  entry("Binding", :local_variables, "2.2"),
  entry("Binding", :receiver, "2.2"),
  entry("Binding", :source_location, "2.6"),
  entry("Class", :attached_object, "3.2"),
  entry("Class", :subclasses, "3.1"),
  entry("Comparable", :clamp, "2.4"),
  entry("Complex", :<=>, "2.7"),
  entry("Coverage", :peek_result, "2.3", receiver_type: :constant),
  entry("Coverage", :line_stub, "2.6", receiver_type: :constant),
  entry("Coverage", :supported?, "3.2", receiver_type: :constant),
  entry("Date", :jisx0301, "2.7"),
  entry("Date", :jisx0301, "2.7", receiver_type: :constant),
  entry("Dir", :children, "2.5", receiver_type: :constant),
  entry("Dir", :chdir, "3.3"),
  entry("Dir", :each_child, "2.5", receiver_type: :constant),
  entry("Dir", :empty?, "2.4", receiver_type: :constant),
  entry("Dir", :fchdir, "3.3", receiver_type: :constant),
  entry("Dir", :fileno, "2.2"),
  entry("Dir", :for_fd, "3.3", receiver_type: :constant),
  entry("Enumerable", :chain, "2.6"),
  entry("Enumerable", :chunk_while, "2.3"),
  entry("Enumerable", :compact, "3.1"),
  entry("Enumerable", :filter, "2.6"),
  entry("Enumerable", :filter_map, "2.7"),
  entry("Enumerable", :grep_v, "2.3"),
  entry("Enumerable", :lazy, "2.0"),
  entry("Enumerable", :slice_after, "2.2"),
  entry("Enumerable", :slice_when, "2.2"),
  entry("Enumerable", :sum, "2.4"),
  entry("Enumerable", :tally, "2.7"),
  entry("Enumerable", :to_h, "2.1"),
  entry("Enumerable", :uniq, "2.4"),
  entry("Enumerator", :size, "2.0"),
  entry("Enumerator", :+, "2.6"),
  entry("Enumerator", :produce, "2.7", receiver_type: :constant),
  entry("Enumerator", :product, "3.2", receiver_type: :constant),
  entry("Enumerator::Lazy", :chunk_while, "2.4"),
  entry("Enumerator::Lazy", :compact, "3.1"),
  entry("Enumerator::Lazy", :eager, "2.7"),
  entry("Enumerator::Lazy", :filter, "2.6"),
  entry("Enumerator::Lazy", :grep_v, "2.3"),
  entry("Enumerator::Lazy", :uniq, "2.4"),
  entry("Enumerator::Yielder", :to_proc, "2.7"),
  entry("Exception", :cause, "2.1"),
  entry("Exception", :detailed_message, "3.2"),
  entry("Exception", :full_message, "2.5"),
  entry("ENV", :except, "3.0", receiver_type: :constant),
  entry("ERB::Escape", :html_escape, "3.2", receiver_type: :constant),
  entry("Etc", :confstr, "2.2", receiver_type: :constant),
  entry("Etc", :nprocessors, "2.2", receiver_type: :constant),
  entry("Etc", :sysconf, "2.2", receiver_type: :constant),
  entry("Etc", :uname, "2.2", receiver_type: :constant),
  entry("Date", :deconstruct_keys, "3.2"),
  entry("DateTime", :deconstruct_keys, "3.2"),
  entry("Fiber", :[], "3.2", receiver_type: :constant),
  entry("Fiber", :[]=, "3.2", receiver_type: :constant),
  entry("Fiber", :backtrace, "3.0"),
  entry("Fiber", :backtrace_locations, "3.0"),
  entry("Fiber", :blocking?, "3.0"),
  entry("Fiber", :blocking?, "3.0", receiver_type: :constant),
  entry("Fiber", :kill, "3.3"),
  entry("Fiber", :raise, "2.7"),
  entry("Fiber", :scheduler, "3.0", receiver_type: :constant),
  entry("Fiber", :set_scheduler, "3.0", receiver_type: :constant),
  entry("Fiber", :storage, "3.2"),
  entry("Fiber", :"storage=", "3.2"),
  entry("Fiber::Scheduler", :blocking_operation_wait, "3.4"),
  entry("Fiber::Scheduler", :io_select, "3.2"),
  entry("File", :absolute_path?, "2.7", receiver_type: :constant),
  entry("File", :birthtime, "2.2"),
  entry("File", :birthtime, "2.2", receiver_type: :constant),
  entry("File", :empty?, "2.4", receiver_type: :constant),
  entry("File", :lutime, "2.5", receiver_type: :constant),
  entry("File", :mkfifo, "2.3", receiver_type: :constant),
  entry("File::Stat", :birthtime, "2.2"),
  entry("FileUtils", :cp_lr, "2.6"),
  entry("FileUtils", :cp_lr, "2.6", receiver_type: :constant),
  entry("FileUtils", :ln_sr, "3.2"),
  entry("FileUtils", :ln_sr, "3.2", receiver_type: :constant),
  entry("Float", :next_float, "2.2"),
  entry("Float", :prev_float, "2.2"),
  entry("FrozenError", :receiver, "2.7"),
  entry("GC", :auto_compact, "3.0", receiver_type: :constant),
  entry("GC", :"auto_compact=", "3.0", receiver_type: :constant),
  entry("GC", :compact, "2.7", receiver_type: :constant),
  entry("GC", :latest_gc_info, "2.2", receiver_type: :constant),
  entry("GC", :config, "3.4", receiver_type: :constant),
  entry("GC", :measure_total_time, "3.1", receiver_type: :constant),
  entry("GC", :"measure_total_time=", "3.1", receiver_type: :constant),
  entry("GC", :total_time, "3.1", receiver_type: :constant),
  entry("GC::Profiler", :raw_data, "2.0", receiver_type: :constant),
  entry("Hash", :compact, "2.4"),
  entry("Hash", :compact!, "2.4"),
  entry("Hash", :dig, "2.3"),
  entry("Hash", :except, "3.0"),
  entry("Hash", :fetch_values, "2.3"),
  entry("Hash", :filter, "2.6"),
  entry("Hash", :filter!, "2.6"),
  entry("Hash", :slice, "2.5"),
  entry("Hash", :to_h, "2.0"),
  entry("Hash", :to_proc, "2.3"),
  entry("Hash", :transform_keys, "2.5"),
  entry("Hash", :transform_keys!, "2.5"),
  entry("Hash", :transform_values, "2.4"),
  entry("Hash", :transform_values!, "2.4"),
  entry("IO", :path, "3.2"),
  entry("IO", :cooked, "2.0"),
  entry("IO", :cooked!, "2.0"),
  entry("IO", :pathconf, "2.2"),
  entry("IO", :pread, "2.5"),
  entry("IO", :pwrite, "2.5"),
  entry("IO", :set_encoding_by_bom, "2.7"),
  entry("IO", :timeout, "3.2"),
  entry("IO", :"timeout=", "3.2"),
  entry("IO", :wait_readable, "2.0"),
  entry("IO", :wait_writable, "2.0"),
  entry("Integer", :allbits?, "2.5"),
  entry("Integer", :anybits?, "2.5"),
  entry("Integer", :bit_length, "2.1"),
  entry("Integer", :ceildiv, "3.2"),
  entry("Integer", :digits, "2.4"),
  entry("Integer", :nobits?, "2.5"),
  entry("Integer", :sqrt, "2.5", receiver_type: :constant),
  entry("Integer", :try_convert, "3.1", receiver_type: :constant),
  entry("KeyError", :key, "2.5"),
  entry("KeyError", :receiver, "2.5"),
  entry("Logger", :reopen, "2.3"),
  entry("LoadError", :path, "2.0"),
  entry("Kernel", :__dir__, "2.0"),
  entry("Kernel", :Hash, "2.0"),
  entry("Kernel", :caller_locations, "2.0"),
  entry("Kernel", :itself, "2.2"),
  entry("Kernel", :singleton_method, "2.1"),
  entry("MatchData", :byteoffset, "3.2"),
  entry("MatchData", :deconstruct, "3.2"),
  entry("MatchData", :deconstruct_keys, "3.2"),
  entry("MatchData", :match, "3.1"),
  entry("MatchData", :match_length, "3.1"),
  entry("MatchData", :named_captures, "2.4"),
  entry("Matrix", :[]=, "2.6"),
  entry("Matrix", :adjugate, "2.2"),
  entry("Matrix", :antisymmetric?, "2.6"),
  entry("Matrix", :cofactor, "2.2"),
  entry("Matrix", :first_minor, "2.2"),
  entry("Matrix", :hstack, "2.2"),
  entry("Matrix", :independent?, "2.2"),
  entry("Matrix", :laplace_expansion, "2.2"),
  entry("Matrix", :map!, "2.6"),
  entry("Matrix", :collect!, "2.6"),
  entry("Matrix", :skew_symmetric?, "2.6"),
  entry("Matrix", :vstack, "2.2"),
  entry("Matrix", :hstack, "2.2", receiver_type: :constant),
  entry("Matrix", :independent?, "2.2", receiver_type: :constant),
  entry("Matrix", :vstack, "2.2", receiver_type: :constant),
  entry("Method", :===, "2.5"),
  entry("Method", :<<, "2.6"),
  entry("Method", :curry, "2.2"),
  entry("Method", :private?, "3.1"),
  entry("Method", :protected?, "3.1"),
  entry("Method", :public?, "3.1"),
  entry("Method", :super_method, "2.2"),
  entry("Method", :>>, "2.6"),
  entry("Module", :const_added, "3.2"),
  entry("Module", :const_source_location, "2.7"),
  entry("Module", :deprecate_constant, "2.3"),
  entry("Module", :prepend, "2.0"),
  entry("Module", :prepend_features, "2.0"),
  entry("Module", :prepended, "2.0"),
  entry("Module", :refine, "2.0"),
  entry("Module", :refinements, "3.2"),
  entry("Module", :ruby2_keywords, "2.7"),
  entry("Module", :set_temporary_name, "3.3"),
  entry("Module", :singleton_class?, "2.1"),
  entry("Module", :undefined_instance_methods, "3.2"),
  entry("Module", :using, "2.1"),
  entry("Module", :used_modules, "2.4"),
  entry("Module", :used_refinements, "3.2", receiver_type: :constant),
  entry("Mutex", :owned?, "2.0"),
  entry("NameError", :receiver, "2.3"),
  entry("Net::FTP", :features, "2.7"),
  entry("Net::FTP", :mlsd, "2.3"),
  entry("Net::FTP", :mlst, "2.3"),
  entry("Net::FTP", :option, "2.7"),
  entry("Net::HTTP", :local_host, "2.0"),
  entry("Net::HTTP", :local_port, "2.0"),
  entry("Net::HTTP", :post, "2.4", receiver_type: :constant),
  entry("Net::HTTP", :verify_hostname, "3.0"),
  entry("Net::HTTP", :"verify_hostname=", "3.0"),
  entry("Net::IMAP", :default_port, "2.0", receiver_type: :constant),
  entry("Net::IMAP", :default_imap_port, "2.0", receiver_type: :constant),
  entry("Net::IMAP", :default_tls_port, "2.0", receiver_type: :constant),
  entry("Net::IMAP", :default_ssl_port, "2.0", receiver_type: :constant),
  entry("Net::IMAP", :default_imaps_port, "2.0", receiver_type: :constant),
  entry("Net::SMTP", :rset, "2.1"),
  entry("NilClass", :to_h, "2.0"),
  entry("Numeric", :finite?, "2.4"),
  entry("Numeric", :infinite?, "2.4"),
  entry("Numeric", :negative?, "2.3"),
  entry("Numeric", :positive?, "2.3"),
  entry("Object", :then, "2.6"),
  entry("Object", :yield_self, "2.5"),
  entry("ObjectSpace", :reachable_objects_from, "2.0", receiver_type: :constant),
  entry("ObjectSpace::WeakMap", :delete, "3.3"),
  entry("OpenStruct", :[], "2.0"),
  entry("OpenStruct", :[]=, "2.0"),
  entry("OpenStruct", :each_pair, "2.0"),
  entry("OpenStruct", :eql?, "2.0"),
  entry("OpenStruct", :hash, "2.0"),
  entry("OpenStruct", :to_h, "2.0"),
  entry("Pathname", :empty?, "2.4"),
  entry("Pathname", :birthtime, "2.2"),
  entry("Pathname", :binwrite, "2.1"),
  entry("Pathname", :lutime, "3.2"),
  entry("Pathname", :write, "2.1"),
  entry("Process", :argv0, "2.1", receiver_type: :constant),
  entry("Process", :clock_getres, "2.1", receiver_type: :constant),
  entry("Process", :clock_gettime, "2.1", receiver_type: :constant),
  entry("Process", :getsid, "2.0", receiver_type: :constant),
  entry("Process", :last_status, "2.5", receiver_type: :constant),
  entry("Process", :setproctitle, "2.1", receiver_type: :constant),
  entry("Process", :warmup, "3.3", receiver_type: :constant),
  entry("Random", :bytes, "2.6", receiver_type: :constant),
  entry("Readline", :quoting_detection_proc, "2.4", receiver_type: :constant),
  entry("Readline", :quoting_detection_proc=, "2.4", receiver_type: :constant),
  entry("Resolv::DNS", :timeouts=, "2.0"),
  entry("Ripper", :state, "2.5"),
  entry("Proc", :<<, "2.6"),
  entry("Proc", :>>, "2.6"),
  entry("Proc", :ruby2_keywords, "2.7"),
  entry("Range", :bsearch, "2.0"),
  entry("Range", :%, "2.6"),
  entry("Range", :minmax, "2.7"),
  entry("Range", :overlap?, "3.3"),
  entry("Range", :size, "2.0"),
  entry("Regexp", :linear_time?, "3.2", receiver_type: :constant),
  entry("Regexp", :match?, "2.4"),
  entry("Regexp", :timeout, "3.2", receiver_type: :constant),
  entry("Regexp", :"timeout=", "3.2", receiver_type: :constant),
  entry("Refinement", :refined_class, "3.2"),
  entry("Refinement", :target, "3.3"),
  entry("Signal", :signame, "2.0", receiver_type: :constant),
  entry("Set", :<=>, "3.0"),
  entry("Set", :compare_by_identity, "2.4"),
  entry("Set", :compare_by_identity?, "2.4"),
  entry("Set", :join, "3.0"),
  entry("Set", :===, "2.5"),
  entry("Set", :reset, "2.5"),
  entry("Set", :to_s, "2.5"),
  entry("SecureRandom", :alphanumeric, "2.5", receiver_type: :constant),
  entry("String", :+@, "2.3"),
  entry("String", :-@, "2.3"),
  entry("String", :b, "2.0"),
  entry("String", :byteindex, "3.2"),
  entry("String", :byterindex, "3.2"),
  entry("String", :bytesplice, "3.2"),
  entry("String", :append_as_bytes, "3.4"),
  entry("String", :casecmp?, "2.4"),
  entry("String", :concat, "2.4"),
  entry("String", :delete_prefix, "2.5"),
  entry("String", :delete_prefix!, "2.5"),
  entry("String", :delete_suffix, "2.5"),
  entry("String", :delete_suffix!, "2.5"),
  entry("String", :dedup, "3.2"),
  entry("String", :each_grapheme_cluster, "2.5"),
  entry("String", :grapheme_clusters, "2.5"),
  entry("String", :match?, "2.4"),
  entry("String", :prepend, "2.4"),
  entry("String", :scrub, "2.1"),
  entry("String", :scrub!, "2.1"),
  entry("String", :unicode_normalize, "2.2"),
  entry("String", :unicode_normalize!, "2.2"),
  entry("String", :unicode_normalized?, "2.2"),
  entry("String", :undump, "2.5"),
  entry("String", :unpack1, "2.4"),
  entry("Struct", :dig, "2.3"),
  entry("Struct", :to_h, "2.0"),
  entry("StringScanner", :captures, "2.5"),
  entry("StringScanner", :size, "2.5"),
  entry("StringScanner", :values_at, "2.5"),
  entry("Symbol", :casecmp?, "2.4"),
  entry("Symbol", :match, "2.4"),
  entry("Symbol", :match?, "2.4"),
  entry("Symbol", :name, "3.0"),
  entry("Symbol", :start_with?, "2.7"),
  entry("Symbol", :end_with?, "2.7"),
  entry("Thread", :backtrace_locations, "2.0"),
  entry("Thread", :each_caller_location, "3.2", receiver_type: :constant),
  entry("Thread", :fetch, "2.5"),
  entry("Thread", :ignore_deadlock, "3.0", receiver_type: :constant),
  entry("Thread", :name, "2.3"),
  entry("Thread", :"name=", "2.3"),
  entry("Thread", :native_thread_id, "3.1"),
  entry("Thread", :pending_interrupt?, "2.0"),
  entry("Thread", :pending_interrupt?, "2.0", receiver_type: :constant),
  entry("Thread", :report_on_exception, "2.4"),
  entry("Thread", :"report_on_exception=", "2.4"),
  entry("Thread", :report_on_exception, "2.4", receiver_type: :constant),
  entry("Thread", :"report_on_exception=", "2.4", receiver_type: :constant),
  entry("Thread", :thread_variable?, "2.0"),
  entry("Thread", :thread_variable_get, "2.0"),
  entry("Thread", :thread_variable_set, "2.0"),
  entry("Thread", :thread_variables, "2.0"),
  entry("Thread", :handle_interrupt, "2.0", receiver_type: :constant),
  entry("Thread::Backtrace", :limit, "3.1", receiver_type: :constant),
  entry("Socket::ResolutionError", :error_code, "3.4"),
  entry("Time", :deconstruct_keys, "3.2"),
  entry("Time", :ceil, "2.7"),
  entry("Time", :floor, "2.7"),
  entry("UnboundMethod", :private?, "3.1"),
  entry("UnboundMethod", :protected?, "3.1"),
  entry("UnboundMethod", :public?, "3.1"),
  entry("UnboundMethod", :bind_call, "2.7"),
  entry("Vector", :[]=, "2.6"),
  entry("Vector", :angle_with, "2.2"),
  entry("Vector", :collect!, "2.6"),
  entry("Vector", :cross, "2.2"),
  entry("Vector", :cross_product, "2.1"),
  entry("Vector", :dot, "2.2"),
  entry("Vector", :map!, "2.6"),
  entry("Vector", :round, "2.3"),
  entry("Vector", :basis, "2.2", receiver_type: :constant),
  entry("Warning", :[], "2.7", receiver_type: :constant),
  entry("Warning", :[]=, "2.7", receiver_type: :constant),
  entry("Warning", :categories, "3.4", receiver_type: :constant),
  entry("SyntaxError", :path, "3.2"),
  entry("TracePoint", :allow_reentry, "3.1", receiver_type: :constant),
  entry("TracePoint", :eval_script, "2.6"),
  entry("TracePoint", :instruction_sequence, "2.6"),
  entry("TracePoint", :parameters, "2.6"),
  entry("Thread::Queue", :close, "2.3"),
  entry("Data", :define, "3.2", receiver_type: :constant),
  entry("Zlib", :gzip, "2.4", receiver_type: :constant),
  entry("Zlib", :gunzip, "2.4", receiver_type: :constant)
].freeze
BY_METHOD =
ENTRIES.group_by(&:method_name).transform_values(&:freeze).freeze

Class Method Summary collapse

Class Method Details

.entry(owner, method_name, introduced_in, receiver_type: :instance) ⇒ Object



13
14
15
# File 'lib/rubocop/lts/ruby/catalog.rb', line 13

def self.entry(owner, method_name, introduced_in, receiver_type: :instance)
  Entry.new(owner, method_name, Gem::Version.new(introduced_in), receiver_type)
end

.lookup(method_name) ⇒ Object



377
378
379
# File 'lib/rubocop/lts/ruby/catalog.rb', line 377

def lookup(method_name)
  BY_METHOD[method_name]
end