lib/contained_mr/mock/template.rb
# Reads the template .zip and parses the definition.
Reads the template .zip and parses the definition.
Reads the template . zip and parses the definition .
def process_zip(zip_io)
    Zip::File.open_buffer zip_io.read do |zip|
      zip.each do |zip_entry|
        file_name = zip_entry.name
        if zip_entry.directory?
          @_zip_contents[file_name] = :directory
        elsif zip_entry.file?
          if file_name == 'mapreduced.yml'
            read_definition zip_entry.get_input_stream
            next
          end
          @_zip_contents[file_name] = zip_entry.get_input_stream.read
        end
      end
    end
    @_zip_contents.freeze
  end
def process_zip ( zip_io ) Zip :: File . open_buffer zip_io . read do | zip | zip . each do | zip_entry | file_name = zip_entry . name if zip_entry . directory? @_zip_contents [ file_name ] = :directory elsif zip_entry . file? if file_name == 'mapreduced.yml' read_definition zip_entry . get_input_stream next end @_zip_contents [ file_name ] = zip_entry . get_input_stream . read end end end @_zip_contents . freeze end
Reads the template .zip and parses the definition.
Reads the template . zip and parses the definition .
# TODO(pwnall): zip_io.read -> zip_io after rubyzip releases 1.1.8
zip_io
<not_specific>