Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (69 sloc) 2.252 kB
9db6d6f @jashkenas Updating rake task to pull version number and date.
authored
1 require 'rubygems'
2f75854 @jashkenas little fixes more examples
authored
2 require 'erb'
92adabd @jashkenas adding an initial lexer test
authored
3 require 'fileutils'
4 require 'rake/testtask'
9db6d6f @jashkenas Updating rake task to pull version number and date.
authored
5 require 'json'
1fbb6e8 @jashkenas adding copying header to extras/coffee-script.js
authored
6
2f75854 @jashkenas little fixes more examples
authored
7 desc "Build the documentation page"
8 task :doc do
93bdfcb @jashkenas added full complement of bitwise operators
authored
9 source = 'documentation/index.html.erb'
88cc1ee @satyr 765: -b/--bare <- --no-wrap
satyr authored
10 child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" }
9bb3e3f @jashkenas clean up children at exit -- had about twenty processes all watching …
authored
11 at_exit { Process.kill("INT", child) }
12 Signal.trap("INT") { exit }
93bdfcb @jashkenas added full complement of bitwise operators
authored
13 loop do
14 mtime = File.stat(source).mtime
15 if !@mtime || mtime > @mtime
16 rendered = ERB.new(File.read(source)).result(binding)
17 File.open('index.html', 'w+') {|f| f.write(rendered) }
18 end
19 @mtime = mtime
20 sleep 1
21 end
2f75854 @jashkenas little fixes more examples
authored
22 end
c1427d6 @jashkenas adding a minified combined coffee-script.js. Include it on the page, …
authored
23
57bd6bc @jashkenas Adding the coffee-script-source gem publisher to the Rakefile.
authored
24 desc "Build coffee-script-source gem"
25 task :gem do
26 require 'rubygems'
27 require 'rubygems/package'
28
29 gemspec = Gem::Specification.new do |s|
30 s.name = 'coffee-script-source'
9db6d6f @jashkenas Updating rake task to pull version number and date.
authored
31 s.version = JSON.parse(File.read('package.json'))["version"]
32 s.date = Time.now.strftime("%Y-%m-%d")
57bd6bc @jashkenas Adding the coffee-script-source gem publisher to the Rakefile.
authored
33
34 s.homepage = "http://jashkenas.github.com/coffee-script/"
35 s.summary = "The CoffeeScript Compiler"
36 s.description = <<-EOS
37 CoffeeScript is a little language that compiles into JavaScript.
38 Underneath all of those embarrassing braces and semicolons,
39 JavaScript has always had a gorgeous object model at its heart.
40 CoffeeScript is an attempt to expose the good parts of JavaScript
41 in a simple way.
42 EOS
43
44 s.files = [
45 'lib/coffee_script/coffee-script.js',
46 'lib/coffee_script/source.rb'
47 ]
48
49 s.authors = ['Jeremy Ashkenas']
50 s.email = 'jashkenas@gmail.com'
51 s.rubyforge_project = 'coffee-script-source'
52 end
53
54 file = File.open("coffee-script-source.gem", "w")
55 Gem::Package.open(file, 'w') do |pkg|
56 pkg.metadata = gemspec.to_yaml
57
58 path = "lib/coffee_script/source.rb"
59 contents = <<-ERUBY
60 module CoffeeScript
61 module Source
62 def self.bundled_path
63 File.expand_path("../coffee-script.js", __FILE__)
64 end
65 end
66 end
67 ERUBY
68 pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
69 tar_io.write(contents)
70 end
71
72 contents = File.read("extras/coffee-script.js")
73 path = "lib/coffee_script/coffee-script.js"
74 pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
75 tar_io.write(contents)
76 end
77 end
78 end
Something went wrong with that request. Please try again.