Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix build task to skip if previous build is fresh

  • Loading branch information...
commit 73206a6ebcb2006c490e25cf2735aff3a73f198a 1 parent 0d6fd8f
Mislav Marohnić mislav authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 Rakefile
13 Rakefile
View
@@ -17,12 +17,19 @@ class BuildTask < Rake::FileTask
return self
end
+ def needed?() super or modules_mismatch? end
+
def modules_mismatch?
- File.open(name, 'r') {|f| f.gets } !~ /modules: ([\w,\s]+)/ or
- $1.split(/\W+/) != modules
+ previous_modules != modules
end
- def needed?() super or modules_mismatch? end
+ def previous_modules
+ first_line =~ / - ([\w,\s]+) - / && $1.split(/\W+/)
+ end
+
+ def first_line
+ File.open(name, 'r') {|f| f.gets }
+ end
end
BuildTask.define_task 'dist/zepto.js' => DEFAULT_MODULES.map {|m| "src/#{m}.js" } do |task|
Please sign in to comment.
Something went wrong with that request. Please try again.