Permalink
Browse files

Avoid automatically fetching the vendor/sizzle git submodule.

  • Loading branch information...
1 parent 797c231 commit a44a8db6aed068b0ece32481cf6821009da14e90 @tobie tobie committed Dec 2, 2009
Showing with 6 additions and 6 deletions.
  1. +6 −6 Rakefile
View
@@ -13,6 +13,7 @@ module PrototypeHelper
TEST_UNIT_DIR = File.join(TEST_DIR, 'unit')
TMP_DIR = File.join(TEST_UNIT_DIR, 'tmp')
VERSION = YAML.load(IO.read(File.join(SRC_DIR, 'constants.yml')))['PROTOTYPE_VERSION']
+ DEFAULT_SELECTOR_ENGINE = 'sizzle'
%w[sprockets pdoc unittest_js caja_builder].each do |name|
$:.unshift File.join(PrototypeHelper::ROOT_DIR, 'vendor', name, 'lib')
@@ -45,8 +46,8 @@ module PrototypeHelper
require_sprockets
load_path = [SRC_DIR]
- if selector = options[:selector_engine]
- load_path << get_selector_engine(selector)
+ if selector_path = get_selector_engine(options[:selector_engine])
+ load_path << selector_path
end
secretary = Sprockets::Secretary.new(
@@ -66,7 +67,7 @@ module PrototypeHelper
:path => 'src',
:source => file,
:destination => temp_path,
- :selector_engine => ENV['SELECTOR_ENGINE'] || 'sizzle',
+ :selector_engine => ENV['SELECTOR_ENGINE'] || DEFAULT_SELECTOR_ENGINE,
:strip_comments => false
)
rm_rf DOC_DIR
@@ -99,8 +100,7 @@ module PrototypeHelper
def self.get_selector_engine(name)
submodule_path = File.join(ROOT_DIR, "vendor", name)
return submodule_path if File.exist?(File.join(submodule_path, "repository", ".git"))
- ext_path = File.join(ROOT_DIR, "ext", name)
- return ext_path if File.exist?(ext_path)
+ return if name == DEFAULT_SELECTOR_ENGINE
get_submodule('the required selector engine', "#{name}/repository")
unless File.exist?(submodule_path)
@@ -151,7 +151,7 @@ task :dist do
PrototypeHelper.sprocketize(
:path => 'src',
:source => 'prototype.js',
- :selector_engine => ENV['SELECTOR_ENGINE'] || 'sizzle'
+ :selector_engine => ENV['SELECTOR_ENGINE'] || PrototypeHelper::DEFAULT_SELECTOR_ENGINE
)
end

0 comments on commit a44a8db

Please sign in to comment.