public
Description: Functional is a library for functional programming in JavaScript. It defines the standard higher-order functions such as map, reduce (aka foldl), and select (aka filter). It also defines functions such as curry, rcurry, and partial for partial function application; and compose, guard, and until for function-level programming.
Homepage: http://osteele.com/sources/javascript/functional/
Clone URL: git://github.com/osteele/functional-javascript.git
100644 25 lines (19 sloc) 0.721 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
MIN = 'functional.min.js'
PACKAGE = 'functional-1.0.2.tgz'
SOURCES = %w[CHANGES MIT-LICENSE README] +
  %w[examples.js functional.js to-function.js Rakefile] +
  [MIN]
 
task :default => [MIN+'.gz', PACKAGE]
 
task :publish => [PACKAGE, 'functional.min.js.gz'] do
  sh "rsync -avz . osteele.com:osteele.com/sources/javascript/functional --delete --exclude .git --exclude .hg"
end
 
file PACKAGE => SOURCES do |t|
  sh "tar cfz #{t.name} #{t.prerequisites}"
end
 
file 'functional.min.js' => %w[functional.js to-function.js] do |t|
  sh "cat #{t.prerequisites} | ruby ~/src/javascript/jsmin.rb > #{t.name}"
end
 
file MIN+'.gz' => MIN do |t|
  sh "gzip < #{t.prerequisites} > #{t.name}"
  puts "#{File.size(t.name)} bytes"
end