Browse Source

add commonjs package generation, run `rake commonjs `, somebody please port this to ruby :)

tags/0.2
Jan Lehnardt 16 years ago
parent
commit
96004e3d71
3 changed files with 53 additions and 5 deletions
  1. +29
    -0
      .gitignore
  2. +18
    -5
      Rakefile
  3. +6
    -0
      mustache-commonjs/package.json

+ 29
- 0
.gitignore View File

@@ -1 +1,30 @@
runner.js
mustache-commonjs/LICENSE
mustache-commonjs/README.md
mustache-commonjs/examples/comments.html
mustache-commonjs/examples/comments.js
mustache-commonjs/examples/comments.txt
mustache-commonjs/examples/complex.html
mustache-commonjs/examples/complex.js
mustache-commonjs/examples/complex.txt
mustache-commonjs/examples/delimiters.html
mustache-commonjs/examples/delimiters.js
mustache-commonjs/examples/delimiters.txt
mustache-commonjs/examples/escaped.html
mustache-commonjs/examples/escaped.js
mustache-commonjs/examples/escaped.txt
mustache-commonjs/examples/simple.html
mustache-commonjs/examples/simple.js
mustache-commonjs/examples/simple.txt
mustache-commonjs/examples/template_partial.html
mustache-commonjs/examples/template_partial.js
mustache-commonjs/examples/template_partial.txt
mustache-commonjs/examples/unescaped.html
mustache-commonjs/examples/unescaped.js
mustache-commonjs/examples/unescaped.txt
mustache-commonjs/examples/view_partial.html
mustache-commonjs/examples/view_partial.js
mustache-commonjs/examples/view_partial.txt
mustache-commonjs/lib/mustache.js
mustache-commonjs/test/mustache_test.js
mustache-commonjs/test/mustache_test.rb

+ 18
- 5
Rakefile View File

@@ -1,11 +1,24 @@
require 'rake'
require 'rake/testtask'

task :default => :test

Rake::TestTask.new do |t|
Dir.glob("examples/*.html") do |file|
test = File.basename(file, ".html")
cmd = "ruby test/mustache_test.rb #{test}"
print `#{cmd}`
task :test do
Rake::TestTask.new do |t|
Dir.glob("examples/*.html") do |file|
test = File.basename(file, ".html")
cmd = "ruby test/mustache_test.rb #{test}"
print `#{cmd}`
end
end
end

task :commonjs do
print "Packaging for CommonJS\n"
target = "mustache-commonjs"
files = "LICENSE README.md test examples"
`cp -r #{files} #{target}`
`mkdir #{target}/lib`
`cp mustache.js #{target}/lib`
print "Done, see ./#{target}\n"
end

+ 6
- 0
mustache-commonjs/package.json View File

@@ -0,0 +1,6 @@
{
"name": "mustache",
"author": "Jan Lehnardt",
"description": "{{mustaches}} in JavaScript — shameless port from @defunkt",
"keywords": ["template"]
}

Loading…
Cancel
Save