Skip to content

Commit

Permalink
no need for both bin and build folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Mar 25, 2013
1 parent 2376fd2 commit 410f4bd
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 32 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
build
bin
node_modules
coverage.html
33 changes: 16 additions & 17 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ module.exports = (grunt) ->
meta:
version: '0.2.0'

clean: ['bin', 'build']
clean: ['build']

coffee:
demo:
expand: true
dest: 'bin/'
dest: 'build/'
src: ['demo/scripts/*.coffee']
ext: '.js'
fuzzer:
files: [{ dest: 'bin/tests/scripts/fuzzer.js', src: 'tests/scripts/fuzzer.coffee' }]
files: [{ dest: 'build/tests/scripts/fuzzer.js', src: 'tests/scripts/fuzzer.coffee' }]
unit:
files: [{ dest: 'bin/tests/scripts/unit.js', src: 'tests/scripts/unit/*.coffee' }]
files: [{ dest: 'build/tests/scripts/unit.js', src: 'tests/scripts/unit/*.coffee' }]

coffeeify:
options:
requires: ['tandem-core']
src:
files: [{ dest: 'build/scribe.js', src: ['src/scribe.coffee'] }]
tandem_wrapper:
files: [{ dest: 'bin/lib/tandem-core.js', src: ['tests/scripts/tandem.coffee'] }]
files: [{ dest: 'build/lib/tandem-core.js', src: ['tests/scripts/tandem.coffee'] }]

concat:
options:
Expand Down Expand Up @@ -65,39 +65,35 @@ module.exports = (grunt) ->
}]

copy:
bin:
expand: true
dest: 'bin/'
src: ['tests/lib/*.js', 'demo/scripts/dropkick.js', 'demo/images/*.png']
build:
expand: true
dest: 'bin/'
src: ['build/*.js']
dest: 'build/'
src: ['tests/lib/*.js', 'demo/scripts/dropkick.js', 'demo/images/*.png']
node_modules:
expand: true, flatten: true, cwd: 'node_modules/'
dest: 'bin/lib/'
dest: 'build/lib/'
src: ['chai/chai.js', 'mocha/mocha.css', 'mocha/mocha.js', 'underscore/underscore.js']
lib:
expand: true, cwd: 'vendor/assets/javascripts/'
dest: 'bin/lib/'
dest: 'build/lib/'
src: ['*.js', 'rangy/*.js']

haml:
demo:
expand: true
dest: 'bin/'
dest: 'build/'
src: ['demo/*.haml']
ext: ['.html']
tests:
expand: true
dest: 'bin/'
dest: 'build/'
src: ['tests/*.haml']
ext: ['.html']

sass:
demo:
expand: true
dest: 'bin/'
dest: 'build/'
src: ['demo/styles/*.sass']
ext: ['.css']

Expand All @@ -108,9 +104,12 @@ module.exports = (grunt) ->
fuzzer:
files: ['tests/scripts/fuzzer.coffee']
tasks: ['coffee:fuzzer']
haml:
haml_demo:
files: ['demo/*.haml']
tasks: ['haml:demo']
haml_tests:
files: ['tests/*.haml']
tasks: ['haml:tests']
sass:
files: ['demo/styles/*.sass']
tasks: ['sass:demo']
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
coverage:
@rm -rf tmp
@mkdir tmp
@mv bin/src/* tmp/
@jscoverage tmp/ bin/src/
@./node_modules/.bin/mocha-phantomjs bin/tests/unit.html --reporter json-cov | node scripts/jsoncovtohtmlcov > coverage.html
@rm bin/src/*
@mv tmp/* bin/src/
@mkdir tmp/coverage
@mkdir tmp/backup
@mv build/*.js tmp/backup/
@jscoverage tmp/backup/ tmp/coverage/
@mv tmp/coverage/*.js build/
@./node_modules/.bin/mocha-phantomjs build/tests/unit.html --reporter json-cov | node scripts/jsoncovtohtmlcov > coverage.html
@rm build/*.js
@mv tmp/backup/*.js build/
@rm -rf tmp

test: unit

unit:
@./node_modules/.bin/mocha-phantomjs bin/tests/unit.html


.PHONY: test
@./node_modules/.bin/mocha-phantomjs build/tests/unit.html
2 changes: 1 addition & 1 deletion demo/dual.haml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@
%div<>
%br<>

%script{:type => 'text/javascript', :src => '../build/scribe.all.js'}
%script{:type => 'text/javascript', :src => '../scribe.all.js'}
%script{:type => 'text/javascript', :src => 'scripts/dual.js'}

2 changes: 1 addition & 1 deletion demo/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
%div<>
%br<>

%script{:type => 'text/javascript', :src => '../build/scribe.all.js'}
%script{:type => 'text/javascript', :src => '../scribe.all.js'}
:javascript
var editor = new Scribe.Editor('editor-container');
var toolbar = new Scribe.Toolbar('formatting-container', editor);
2 changes: 1 addition & 1 deletion demo/pretty.haml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
%script{:type => 'text/javascript', :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'}
%script{:type => 'text/javascript', :src => 'scripts/dropkick.js'}
%script{:type => 'text/javascript', :src => 'scripts/toggler.js'}
%script{:type => 'text/javascript', :src => '../build/scribe.all.js'}
%script{:type => 'text/javascript', :src => '../scribe.all.js'}
%script{:type => 'text/javascript', :src => 'scripts/pretty.js'}
2 changes: 1 addition & 1 deletion tests/fuzzer.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
%script{:type => 'text/javascript', :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'}
%script{:type => 'text/javascript', :src => 'https://raw.github.com/caolan/async/v0.2.3/lib/async.js'}
%script{:type => 'text/javascript', :src => 'lib/seedrandom.js'}
%script{:type => 'text/javascript', :src => '../build/scribe.all.js'}
%script{:type => 'text/javascript', :src => '../scribe.all.js'}
%script{:type => 'text/javascript', :src => 'scripts/fuzzer.js'}
2 changes: 1 addition & 1 deletion tests/unit.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
%script{:type => 'text/javascript', :src => '../lib/linked_list.js'}
%script{:type => 'text/javascript', :src => '../lib/tandem-core.js'}

%script{:type => 'text/javascript', :src => '../build/scribe.all.js'}
%script{:type => 'text/javascript', :src => '../scribe.all.js'}

%script{:type => 'text/javascript', :src => '../lib/mocha.js'}
%script{:type => 'text/javascript', :src => '../lib/chai.js'}
Expand Down

0 comments on commit 410f4bd

Please sign in to comment.