Permalink
Browse files

Merge pull request #4 from nl0/master

Various enhancements
  • Loading branch information...
2 parents 58ceb91 + bcd3413 commit fe4c1c913bb43c9ca8320dc2a33faa7e2cab8c65 @hiddentao committed Aug 18, 2012
Showing with 427 additions and 326 deletions.
  1. +3 −3 .travis.yml
  2. +8 −0 CHANGELOG.md
  3. +0 −108 Cakefile
  4. +33 −0 Makefile
  5. +113 −106 docs/squel.html
  6. +23 −20 package.json
  7. +219 −73 squel.js
  8. +2 −1 squel.min.js
  9. +15 −4 src/squel.coffee
  10. +1 −1 test/delete.coffee
  11. +1 −1 test/expression.coffee
  12. +4 −4 test/insert.coffee
  13. +1 −1 test/select.coffee
  14. +4 −4 test/update.coffee
View
@@ -1,17 +1,17 @@
language: node_js
node_js:
- - 0.4
- - 0.5
- 0.6
+ - 0.8
before_script:
- "npm install"
script:
- - "node_modules/.bin/cake tests"
+ - "make test"
notifications:
email:
- ram@hiddentao.com
+ - nl.imbecile@gmail.com
View
@@ -1,5 +1,13 @@
# Changelog for [squel](https://github.com/hiddentao/squel)
+## 17 Aug 2012 (1.0.4)
+
+* QueryBuilder base class for all query builders
+* Exporting query builders
+* Escaping strings with single quotes for PostgreSQL compatibility
+* Migrating to make
+
+
## 27 Jan 2012 (1.0.3)
* Added 'usingValuePlaceholders' option for INSERT and UPDATE query builders.
View
108 Cakefile
@@ -1,108 +0,0 @@
-###
-Copyright (c) 2012 Ramesh Nair (hiddentao.com)
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-###
-
-fs = require 'fs'
-path = require 'path'
-{print} = require 'sys'
-{spawn, exec} = require 'child_process'
-rimraf = require 'rimraf'
-
-binpath = path.join __dirname, 'node_modules/.bin/'
-
-stream_data_handler = (data) -> print data.toString()
-
-
-compile_js = (callback) ->
- options = [
- '-c'
- '-j'
- "squel.js"
- "src/"
- ]
- coffee = spawn "#{binpath}/coffee", options
- coffee.stdout.on 'data', stream_data_handler
- coffee.stderr.on 'data', stream_data_handler
- coffee.on 'exit', (status) -> callback?() if status is 0
-
-
-minify_js = (callback) ->
- options = [
- '-o'
- 'squel.min.js'
- "squel.js"
- ]
- uglify = spawn "#{binpath}/uglifyjs", options
- uglify.stdout.on 'data', stream_data_handler
- uglify.stderr.on 'data', stream_data_handler
- uglify.on 'exit', (status) -> callback?() if status is 0
-
-
-build_js = (callback) ->
- compile_js -> minify_js -> callback?()
-
-
-
-build_docs = (callback) ->
- rimraf path.join(__dirname, "docs"), (err) ->
- if (err) then throw err
- options = [
- 'src/squel.coffee'
- ]
- docco = spawn "#{binpath}/docco", options
- docco.stdout.on 'data', stream_data_handler
- docco.stderr.on 'data', stream_data_handler
- docco.on 'exit', (status) -> callback?() if status is 0
-
-
-run_tests = (callback) ->
- options = [
- 'test/expression.coffee'
- 'test/select.coffee'
- 'test/update.coffee'
- 'test/delete.coffee'
- 'test/insert.coffee'
- '--spec'
- ]
- vows = spawn "#{binpath}/vows", options
- output = ""
- data_handler = (data) ->
- output =+ data if data
- stream_data_handler data
- vows.stdout.on 'data', data_handler
- vows.stderr.on 'data', data_handler
- vows.on 'exit', (status) ->
- if 0 isnt status or (output and -1 isnt output.indexOf("✗ Broken"))
- return process.exit(1)
- callback?()
-
-
-task 'docs', 'Build the documentation', ->
- build_docs -> "All done"
-
-task 'tests', 'Run the tests', ->
- build_js -> run_tests -> "All done"
-
-task 'build', 'Build everything', ->
- build_js -> build_docs -> "All done"
View
@@ -0,0 +1,33 @@
+BIN = node_modules/.bin
+TESTS = test/select.coffee test/insert.coffee test/update.coffee test/delete.coffee
+
+
+all: docs squel.min.js
+
+
+squel.js: src/squel.coffee
+ $(BIN)/coffee -c -o . $?
+
+squel.min.js: squel.js
+ $(BIN)/uglifyjs -o $@ $?
+
+docs/squel.html: src/squel.coffee
+ $(BIN)/docco $?
+
+
+test:
+ $(BIN)/vows $(TESTS) $(VOWS_OPTS)
+
+docs: docs/squel.html
+
+clean_docs:
+ rm -rf docs
+
+clean_js:
+ rm *.js
+
+clean: clean_docs clean_js
+
+
+.PHONY: test docs all clean clean_docs clean_js
+
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,22 +1,25 @@
{
- "name": "squel",
- "description": "SQL query string builder",
- "version": "1.0.3",
- "author": "Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/)",
- "contributors": [ "Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/)" ],
- "dependencies": {},
- "devDependencies": {
- "coffee-script": ">= 1.2.0",
- "rimraf": "latest",
- "docco": "0.3.0",
- "vows": "0.6.0",
- "uglify-js": "1.2.2"
- },
- "keywords": ["sql", "database", "rdbms"],
- "main": "squel",
- "repository" :{
- "type" : "git",
- "url" : "https://github.com/hiddentao/squel.git"
- },
- "engines": { "node": ">= 0.4.0" }
+ "name": "squel",
+ "description": "SQL query string builder",
+ "version": "1.0.4",
+ "author": "Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/)",
+ "contributors": [
+ "Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/)",
+ "nl_0 <nl.imbecile@gmail.com>"
+ ],
+ "dependencies": {},
+ "devDependencies": {
+ "coffee-script": "1.3",
+ "docco": "0.3",
+ "uglify-js": "1.3",
+ "vows": "0.6"
+ },
+ "keywords": ["sql", "database", "rdbms"],
+ "main": "squel",
+ "repository" :{
+ "type" : "git",
+ "url" : "https://github.com/hiddentao/squel.git"
+ },
+ "engines": { "node": ">= 0.6.0" }
}
+
Oops, something went wrong.

0 comments on commit fe4c1c9

Please sign in to comment.