developer/ruby/DeprecatedMethods.rb
def parse_new_deprecated(known_deprecated, os_version_str)
  new_deprecated = []
  old_deprecated = []
  Dir.glob( File.join(ROOT_DIR, "src/**/*.hpp") ) do |p|

    class_name = File.basename(p).sub('.hpp', '')
    content = File.read(p)
    deprecated_signatures = content.scan(/OS_DEPRECATED.* (\w+)\(.*\).*;/).flatten
    next if deprecated_signatures.empty?
    deprecated_signatures.each do |method|
      found = known_deprecated.select{|h| (h['Class Name'] == class_name) && (h['Method'] == method)}
      if found
        old_deprecated << found[0]
        next
      end

      puts "Found new OS_DEPRECATED #{class_name}::#{method}"
      row = {
        'Namespace' => p.split('src/')[1].split('/')[0],
        'Class Name' => class_name,
        'Method' => method,
        # has to be right now since it's new
        'Deprecated Since' => os_version_str,
        'Commit SHA' =>  nil,
        'Replace With' =>  nil,
        'Removed In' =>  nil,
      }
      new_deprecated << row
    end
  end

  return {'new' => new_deprecated,
          'old' => old_deprecated}
end
# Parse the hpp files for newly added OS_DEPRECATED.
# Checks if already present in known_deprecated in which case it won't add it
# to the return new_deprecated for the current version, but wil add it to
# old_deprecated.
#
# @param known_deprecated [Array] The Array of Hash from CSV deprecated_methods.csv
# @return [Hash] keys are 'new' and 'old', each have a value that is an
# Array of hash of newly-added / known deprecated
Parse the hpp files for newly added OS_DEPRECATED.
Checks if already present in known_deprecated in which case it won't add it
to the return new_deprecated for the current version, but wil add it to
old_deprecated.
Parse the hpp files for newly added OS_DEPRECATED . Checks if already present in known_deprecated in which case it won ' t add it to the return new_deprecated for the current version but wil add it to old_deprecated .
def parse_new_deprecated(known_deprecated, os_version_str)
  new_deprecated = []
  old_deprecated = []
  Dir.glob( File.join(ROOT_DIR, "src/**/*.hpp") ) do |p|
    class_name = File.basename(p).sub('.hpp', '')
    content = File.read(p)
    deprecated_signatures = content.scan(/OS_DEPRECATED.* (\w+)\(.*\).*;/).flatten
    next if deprecated_signatures.empty?
    deprecated_signatures.each do |method|
      found = known_deprecated.select{|h| (h['Class Name'] == class_name) && (h['Method'] == method)}
      if found
        old_deprecated << found[0]
        next
      end
      puts "Found new OS_DEPRECATED #{class_name}::#{method}"
      row = {
        'Namespace' => p.split('src/')[1].split('/')[0],
        'Class Name' => class_name,
        'Method' => method,
        'Deprecated Since' => os_version_str,
        'Commit SHA' =>  nil,
        'Replace With' =>  nil,
        'Removed In' =>  nil,
      }
      new_deprecated << row
    end
  end
  return {'new' => new_deprecated,
          'old' => old_deprecated}
end
def parse_new_deprecated ( known_deprecated , os_version_str ) new_deprecated = [ ] old_deprecated = [ ] Dir . glob ( File . join ( ROOT_DIR , "src/**/*.hpp" ) ) do | p | class_name = File . basename ( p ) . sub ( '.hpp' , '' ) content = File . read ( p ) deprecated_signatures = content . scan ( / OS_DEPRECATED.* ( \w +) \( .* \) .*; / ) . flatten next if deprecated_signatures . empty? deprecated_signatures . each do | method | found = known_deprecated . select { | h | ( h [ 'Class Name' ] == class_name ) && ( h [ 'Method' ] == method ) } if found old_deprecated << found [ 0 ] next end puts "Found new OS_DEPRECATED #{class_name}::#{method}" row = { 'Namespace' => p . split ( 'src/' ) [ 1 ] . split ( '/' ) [ 0 ] , 'Class Name' => class_name , 'Method' => method , 'Deprecated Since' => os_version_str , 'Commit SHA' => nil , 'Replace With' => nil , 'Removed In' => nil , } new_deprecated << row end end return { 'new' => new_deprecated , 'old' => old_deprecated } end
Parse the hpp files for newly added OS_DEPRECATED.
Parse the hpp files for newly added OS_DEPRECATED .
# has to be right now since it's new
keys are 'new' and 'old', each have a value that is an Array of hash of newly-added / known deprecated
keys are ' new ' and ' old ' each have a value that is an Array of hash of newly - added / known deprecated
Hash
known_deprecated
The Array of Hash from CSV deprecated_methods.csv
The Array of Hash from CSV deprecated_methods . csv
os_version_str