diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index 62a532f6..4cfc3f44 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -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 diff --git a/test/test_command.rb b/test/test_command.rb index ef5b04b0..9f45581d 100644 --- a/test/test_command.rb +++ b/test/test_command.rb @@ -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