403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.191.4.136
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/alt/ruby23/lib64/ruby/2.3.0/rdoc/generator/pot/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/alt/ruby23/lib64/ruby/2.3.0/rdoc/generator/pot/message_extractor.rb
# frozen_string_literal: false
##
# Extracts message from RDoc::Store

class RDoc::Generator::POT::MessageExtractor

  ##
  # Creates a message extractor for +store+.

  def initialize store
    @store = store
    @po = RDoc::Generator::POT::PO.new
  end

  ##
  # Extracts messages from +store+, stores them into
  # RDoc::Generator::POT::PO and returns it.

  def extract
    @store.all_classes_and_modules.each do |klass|
      extract_from_klass(klass)
    end
    @po
  end

  private

  def extract_from_klass klass
    extract_text(klass.comment_location, klass.full_name)

    klass.each_section do |section, constants, attributes|
      extract_text(section.title ,"#{klass.full_name}: section title")
      section.comments.each do |comment|
        extract_text(comment, "#{klass.full_name}: #{section.title}")
      end
    end

    klass.each_constant do |constant|
      extract_text(constant.comment, constant.full_name)
    end

    klass.each_attribute do |attribute|
      extract_text(attribute.comment, attribute.full_name)
    end

    klass.each_method do |method|
      extract_text(method.comment, method.full_name)
    end
  end

  def extract_text text, comment, location = nil
    return if text.nil?

    options = {
      :extracted_comment => comment,
      :references => [location].compact,
    }
    i18n_text = RDoc::I18n::Text.new(text)
    i18n_text.extract_messages do |part|
      @po.add(entry(part[:paragraph], options))
    end
  end

  def entry msgid, options
    RDoc::Generator::POT::POEntry.new(msgid, options)
  end

end

Youez - 2016 - github.com/yon3zu
LinuXploit