Skip to content

Commit

Permalink
Check and read the mimetype file in the superclass.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Sep 2, 2014
1 parent ac93425 commit 132e1f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lib/zip-container/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ class Container

private_class_method :new

# The mime-type of this ZipContainer.
attr_reader :mimetype

# :stopdoc:
# The reserved mimetype file name for standard ZipContainers.
MIMETYPE_FILE = "mimetype"

def initialize(location)
@container = open_container(location)

check_mimetype!
@mimetype = read_mimetype
end
# :startdoc:

Expand Down
6 changes: 0 additions & 6 deletions lib/zip-container/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,10 @@ class File < Container

private_class_method :new

# The mime-type of this ZipContainer file.
attr_reader :mimetype

# :stopdoc:
def initialize(location)
super(location)

check_mimetype!

@mimetype = read_mimetype
@on_disk = true

# Reserved entry names. Just the mimetype file by default.
Expand Down

0 comments on commit 132e1f1

Please sign in to comment.