Merge branch 'delftswa2014-remove-unused-method'

* delftswa2014-remove-unused-method:
  static_file: extract extname in initializer and save as variable. #3632
  removed unused method StaticFile::extname
This commit is contained in:
Parker Moore 2015-04-10 16:31:26 -04:00
commit eeb13872e3
1 changed files with 3 additions and 6 deletions

View File

@ -3,7 +3,7 @@ module Jekyll
# The cache of last modification times [path] -> mtime. # The cache of last modification times [path] -> mtime.
@@mtimes = Hash.new @@mtimes = Hash.new
attr_reader :relative_path attr_reader :relative_path, :extname
# Initialize a new StaticFile. # Initialize a new StaticFile.
# #
@ -18,6 +18,7 @@ module Jekyll
@name = name @name = name
@collection = collection @collection = collection
@relative_path = File.join(*[@dir, @name].compact) @relative_path = File.join(*[@dir, @name].compact)
@extname = File.extname(@relative_path)
end end
# Returns source file path. # Returns source file path.
@ -25,10 +26,6 @@ module Jekyll
File.join(*[@base, @dir, @name].compact) File.join(*[@base, @dir, @name].compact)
end end
def extname
File.extname(path)
end
# Obtain destination path. # Obtain destination path.
# #
# dest - The String path to the destination dir. # dest - The String path to the destination dir.
@ -96,7 +93,7 @@ module Jekyll
{ {
"path" => File.join("", relative_path), "path" => File.join("", relative_path),
"modified_time" => mtime.to_s, "modified_time" => mtime.to_s,
"extname" => File.extname(relative_path) "extname" => extname
} }
end end
end end