Browse files

Made a mistake in checking whether a JS.Class version is real.

  • Loading branch information...
1 parent c3e2d7e commit 4390ce3bcfb35e9f16126439ac870daf7ecbda39 @jcoglan jcoglan committed Jul 3, 2011
Showing with 39 additions and 37 deletions.
  1. +39 −37 lib/helium/deployer.rb
View
76 lib/helium/deployer.rb
@@ -127,44 +127,8 @@ def run_builds!(options = nil)
end
next unless File.directory?(path) and File.file?(join(path, JAKE_FILE))
-
- project, commit = *path.split(SEP)[-2..-1]
- heads = YAML.load(File.read(join(path, '..', HEAD_LIST)))
- branches = heads.select { |head, id| id == commit }.map { |pair| pair.first }
- build = nil
-
- if project == JS_CLASS and !branches.include?(@jsclass_version)
- raise "Unrecognized JS.Class version: #{@jsclass_version}"
- end
-
- Jake.clear_hooks!
-
- # Event listener to capture file information from Jake
- hook = lambda do |_, package, build_type, file|
- build = _
- if build_type == :min
- @js_loader = file if File.basename(file) == LOADER_FILE and
- project == JS_CLASS and
- branches.include?(@jsclass_version)
-
- file = file.sub(path, '')
- manifest << File.join(project, commit, file)
-
- branches.each do |branch|
- @tree[[project, branch]] = commit
- @tree[[project, branch, file]] = package.meta
- end
- end
- end
- jake_hook(:file_created, &hook)
- jake_hook(:file_not_changed, &hook)
-
- log :jake_build, "Building branch '#{ branches * "', '" }' of '#{ project }' from #{ join(path, JAKE_FILE) }"
-
- Jake.build!(path) rescue nil
- manifest += Dir[join(build.build_directory, '**', '*.css')].map { |p| p.gsub(static_dir, '') }
+ run_build_in(path, manifest)
end
-
generate_manifest!
manifest + [PACKAGES, PACKAGES_MIN]
end
@@ -196,6 +160,44 @@ def static_dir(project = nil, branch = nil)
private
+ def run_build_in(path, manifest)
+ project, commit = *path.split(SEP)[-2..-1]
+ heads = YAML.load(File.read(join(path, '..', HEAD_LIST)))
+ branches = heads.select { |head, id| id == commit }.map { |pair| pair.first }
+ build = nil
+
+ if project == JS_CLASS and !heads.keys.include?(@jsclass_version)
+ raise "Unrecognized JS.Class version: #{@jsclass_version}"
+ end
+
+ Jake.clear_hooks!
+
+ # Event listener to capture file information from Jake
+ hook = lambda do |_, package, build_type, file|
+ build = _
+ if build_type == :min
+ @js_loader = file if File.basename(file) == LOADER_FILE and
+ project == JS_CLASS and
+ branches.include?(@jsclass_version)
+
+ file = file.sub(path, '')
+ manifest << File.join(project, commit, file)
+
+ branches.each do |branch|
+ @tree[[project, branch]] = commit
+ @tree[[project, branch, file]] = package.meta
+ end
+ end
+ end
+ jake_hook(:file_created, &hook)
+ jake_hook(:file_not_changed, &hook)
+
+ log :jake_build, "Building branch '#{ branches * "', '" }' of '#{ project }' from #{ join(path, JAKE_FILE) }"
+
+ Jake.build!(path) rescue nil
+ manifest += Dir[join(build.build_directory, '**', '*.css')].map { |p| p.gsub(static_dir, '') }
+ end
+
# Generates JS.Packages dependency file from ERB template and compresses the result
def generate_manifest!
template = File.read(JS_CONFIG_TEMPLATE)

0 comments on commit 4390ce3

Please sign in to comment.