Browse Source

no need for both bin and build folder

Jason Chen 12 years ago
parent
commit
410f4bd858
8 changed files with 30 additions and 32 deletions
  1. 0 1
      .gitignore
  2. 16 17
      Gruntfile.coffee
  3. 9 9
      Makefile
  4. 1 1
      demo/dual.haml
  5. 1 1
      demo/index.haml
  6. 1 1
      demo/pretty.haml
  7. 1 1
      tests/fuzzer.haml
  8. 1 1
      tests/unit.haml

+ 0 - 1
.gitignore

@@ -1,4 +1,3 @@
 build
-bin
 node_modules
 coverage.html

+ 16 - 17
Gruntfile.coffee

@@ -14,18 +14,18 @@ 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:
@@ -33,7 +33,7 @@ module.exports = (grunt) ->
       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:
@@ -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']
 
@@ -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']

+ 9 - 9
Makefile

@@ -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

+ 1 - 1
demo/dual.haml

@@ -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'}
 

+ 1 - 1
demo/index.haml

@@ -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);

+ 1 - 1
demo/pretty.haml

@@ -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'}

+ 1 - 1
tests/fuzzer.haml

@@ -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'}

+ 1 - 1
tests/unit.haml

@@ -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'}