Remove `Command.globs` method
It is no longer being used.
This commit is contained in:
parent
3893004f5e
commit
6ba077cf37
|
@ -19,21 +19,6 @@ module Jekyll
|
|||
super(base)
|
||||
end
|
||||
|
||||
# Listing of all directories (globbed to include subfiles and folders)
|
||||
#
|
||||
# source - the source path
|
||||
# destination - the destination path
|
||||
#
|
||||
# Returns an Array of directory globs in the source, excluding the destination
|
||||
def globs(source, destination)
|
||||
Dir.chdir(source) do
|
||||
dirs = Dir['*'].select { |x| File.directory?(x) }
|
||||
dirs -= [destination, File.expand_path(destination), File.basename(destination)]
|
||||
dirs = dirs.map { |x| "#{x}/**/*" }
|
||||
dirs += ['*']
|
||||
end
|
||||
end
|
||||
|
||||
# Run Site#process and catch errors
|
||||
#
|
||||
# site - the Jekyll::Site object
|
||||
|
|
|
@ -1,41 +1,6 @@
|
|||
require 'helper'
|
||||
|
||||
class TestCommand < Test::Unit::TestCase
|
||||
context "when calling .globs" do
|
||||
context "when non-default dest & source dirs" do
|
||||
setup do
|
||||
@source = source_dir
|
||||
@dest = dest_dir
|
||||
directory_with_contents(@dest)
|
||||
@globs = Command.globs(@source, @dest)
|
||||
end
|
||||
should "return an array without the destination dir" do
|
||||
assert @globs.is_a?(Array)
|
||||
assert !@globs.include?(@dest)
|
||||
end
|
||||
teardown do
|
||||
clear_dest
|
||||
end
|
||||
end
|
||||
context "when using default dest dir" do
|
||||
setup do
|
||||
@source = test_dir
|
||||
@dest = test_dir('_site')
|
||||
directory_with_contents(@dest)
|
||||
@globs = Command.globs(@source, @dest)
|
||||
end
|
||||
should "return an array without the destination dir" do
|
||||
assert @globs.is_a?(Array)
|
||||
assert !@globs.include?(@dest)
|
||||
@globs.each do |glob|
|
||||
assert !glob.include?(File.basename(@dest))
|
||||
end
|
||||
end
|
||||
teardown do
|
||||
FileUtils.rm_r(@dest)
|
||||
end
|
||||
end
|
||||
end
|
||||
context "when calling .add_build_options" do
|
||||
should "add common options" do
|
||||
cmd = Object.new
|
||||
|
|
Loading…
Reference in New Issue