lib/relaton_w3c/data_index.rb
#
# Create index from a GitHub repository
#
# @return [RelatonW3c::DataIndex] data index
#
Create index from a GitHub repository
Create index from a GitHub repository
def create_from_repo 
        resp = Zip::InputStream.new URI("#{W3cBibliography::SOURCE}index-w3c.zip").open
        zip = resp.get_next_entry
        index = if YAML.method(:safe_load).parameters.collect(&:last).index(:permitted_classes)
                  YAML.safe_load(zip.get_input_stream.read, permitted_classes: [Symbol])
                else
                  YAML.safe_load(zip.get_input_stream.read, [Symbol])
                end
        DataIndex.new index: index
      end
def create_from_repo resp = Zip :: InputStream . new URI ( "#{W3cBibliography::SOURCE}index-w3c.zip" ) . open zip = resp . get_next_entry index = if YAML . method ( :safe_load ) . parameters . collect ( & :last ) . index ( :permitted_classes ) YAML . safe_load ( zip . get_input_stream . read , permitted_classes : [ Symbol ] ) else YAML . safe_load ( zip . get_input_stream . read , [ Symbol ] ) end DataIndex . new index : index end
Create index from a GitHub repository
Create index from a GitHub repository
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize # Newer versions of Psych uses the `permitted_classes:` parameter
None
RelatonW3c::DataIndex