Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (26 sloc) 0.978 kb
faf88c0 @tobie Add Rakefile with dist task.
authored
1 EVIDENCE_ROOT_DIR = File.expand_path(File.dirname(__FILE__))
2 EVIDENCE_DIST_DIR = File.join(EVIDENCE_ROOT_DIR, 'dist')
3 EVIDENCE_SRC_DIR = File.join(EVIDENCE_ROOT_DIR, 'src')
4
5 $:.unshift File.join(EVIDENCE_ROOT_DIR, 'vendor', 'sprockets', 'lib')
6
7 def sprocketize(path, source, destination, strip_comments = true)
8 begin
9 require 'sprockets'
10 rescue LoadError => e
11 puts "\nYou'll need Sprockets to build Evidence. Just run:\n\n"
12 puts " $ git submodule init"
13 puts " $ git submodule update"
14 puts "\nand you should be all set.\n\n"
15 end
16
17 secretary = Sprockets::Secretary.new(
18 :root => File.join(EVIDENCE_ROOT_DIR, path),
19 :load_path => [EVIDENCE_SRC_DIR],
20 :source_files => [source],
21 :strip_comments => strip_comments
22 )
23
24 secretary.concatenation.save_to(destination)
25 end
26
27 desc 'Builds the distribution.'
28 task :dist do
29 dest = File.join(EVIDENCE_DIST_DIR, 'evidence.js')
30 sprocketize('src', 'evidence.js', dest)
31 end
32
Something went wrong with that request. Please try again.