[Groonga-commit] nroonga/nroonga [master] Stop using CoffeeScript for production codes

アーカイブの一覧に戻る

Yoji SHIDARA null+****@clear*****
Tue Aug 14 15:17:19 JST 2012


Yoji SHIDARA	2012-08-14 15:17:19 +0900 (Tue, 14 Aug 2012)

  New Revision: ee56bd4df27755768b48e5e24580b3c2c5c48b4d
  https://github.com/nroonga/nroonga/commit/ee56bd4df27755768b48e5e24580b3c2c5c48b4d

  Log:
    Stop using CoffeeScript for production codes

  Removed files:
    src/nroonga.coffee
  Modified files:
    package.json

  Modified: package.json (+0 -2)
===================================================================
--- package.json    2012-08-13 10:15:35 +0900 (b434738)
+++ package.json    2012-08-14 15:17:19 +0900 (036dfeb)
@@ -22,8 +22,6 @@
   },
   "scripts": {
     "test": "./node_modules/.bin/mocha --reporter list -r should --compilers coffee:coffee-script",
-    "watch": "coffee -c -w -o lib src",
-    "coffee": "coffee -c -o lib src",
     "install": "node-gyp rebuild"
   },
   "main": "./lib/nroonga",

  Deleted: src/nroonga.coffee (+0 -49) 100644
===================================================================
--- src/nroonga.coffee    2012-08-13 10:15:35 +0900 (839b2c5)
+++ /dev/null
@@ -1,49 +0,0 @@
-nroonga = module.exports = require('../build/Release/nroonga_bindings.node')
-msgpack = require('msgpack2')
-
-optionsToCommandString = (command, options) ->
-  args = [command]
-  if options?
-    for key, value of options
-      if value?
-        args.push '--' + key
-        args.push JSON.stringify(value)
-  args.join(' ')
-
-overrideOutputType = (optionsGiven, type) ->
-  options = {}
-  for key, value of optionsGiven
-    options[key] = value
-  options.output_type = type
-  options
-
-formatResult = (result, command) ->
-  if command == 'dump'
-    result.toString('UTF-8')
-  else
-    if result.length > 0
-      msgpack.unpack(result)
-    else
-      undefined
-
-nroonga.Database.prototype.commandSync = (command, options={}) ->
-  options = overrideOutputType(options, 'msgpack')
-  result = this.commandSyncString(optionsToCommandString(command, options))
-  formatResult(result, command)
-
-nroonga.Database.prototype.command = (command, options, callback) ->
-  if arguments.length == 2
-    callback = options
-    options = {}
-  options = overrideOutputType(options, 'msgpack')
-
-  wrappedCallback = if callback?
-    (error, data) ->
-      if error?
-        callback error
-      else
-        callback undefined, formatResult(data, command)
-  else
-    undefined
-
-  this.commandString optionsToCommandString(command, options), wrappedCallback
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る