Permalink
Browse files

Better version

  • Loading branch information...
dokipen committed Apr 2, 2012
1 parent bb73bdd commit d7ef12a0c9d6df373c1ab0f2c8d5053bd7ab90b1
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/embedly.js
View
@@ -6,8 +6,6 @@
* README.rst for example code using this library.
*/
-var VERSION="0.6.0"
-
/**
* Cast an array-like object to an array.
*/
@@ -22,6 +20,7 @@ var Hash = require('hashish')
, util = require('util')
, querystring = require('querystring')
, urlparse = require('urlparse.js').parse
+ , version = require('../package.json').version
/* Flexibly parse host strings.
*
@@ -63,7 +62,7 @@ var simple_request = function(host, method, path, headers, timeout) {
log.debug("Calling "+host.protocol+"//"+host.hostname+":"+host.port+path)
- headers['X-Embedly-Client'] = 'embedly-node '+VERSION
+ headers['X-Embedly-Client'] = 'embedly-node '+version
emitter.start = function() {
request.end()
@@ -174,7 +173,7 @@ function Api(opts) {
}
this.key = opts['key'] || process.env['EMBEDLY_KEY']
this.host = opts['host'] || 'api.embed.ly'
- this.user_agent = opts['user_agent'] || 'Mozilla/5.0 (compatible; embedly-node/'+VERSION
+ this.user_agent = opts['user_agent'] || 'Mozilla/5.0 (compatible; embedly-node/'+version
this.api_version = {
'objectify': 2
, 'oembed': 1
@@ -417,7 +416,7 @@ Api.prototype = new(function() {
Api.log = log
module.exports =
-{ version: VERSION
+{ version: version
, Api: Api
, utils:
{ cast_array: cast_array

0 comments on commit d7ef12a

Please sign in to comment.