Sha256: c32ab613ba29832647880684896db8e4d6a7bedb814b369e85b4bc84f6fbda25
Contents?: true
Size: 839 Bytes
Versions: 17
Compression:
Stored size: 839 Bytes
Contents
# frozen_string_literal: true # @api private # @since 0.15.0 module Qonfig::Loaders::EndData class << self # @param caller_location [String] # @return [String] # # @raise [Qonfig::SelfDataNotFoundError] # # @api private # @since 0.15.0 def extract(caller_location) caller_file = caller_location.split(':').first raise( Qonfig::SelfDataNotFoundError, "Caller file does not exist! (location: #{caller_location})" ) unless File.exist?(caller_file) data_match = IO.read(caller_file).match(/\n__END__\n(?<end_data>.*)/m) raise Qonfig::SelfDataNotFoundError, '__END__ data not found!' unless data_match end_data = data_match[:end_data] raise Qonfig::SelfDataNotFoundError, '__END__ data not found!' unless end_data end_data end end end
Version data entries
17 entries across 17 versions & 1 rubygems