File tree 6 files changed +18
-12
lines changed
6 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ $ npm install enju --save
19
19
enju use [ node-config] ( https://github.com/lorenwest/node-config ) .
20
20
` /your_project/config/default.cson `
21
21
``` cson
22
- enjuElasticsearchHost : ' http://localhost:9200'
23
- enjuIndexPrefix : ' '
22
+ enju :
23
+ apiVersion : ' 2.4'
24
+ elasticsearchHost : ' http://localhost:9200'
25
+ indexPrefix : ' '
24
26
```
25
27
26
28
Original file line number Diff line number Diff line change 1
1
module .exports =
2
- enjuElasticsearchHost : ' http://localhost:9200'
3
- enjuIndexPrefix : ' '
2
+ enju :
3
+ apiVersion : ' 2.4'
4
+ elasticsearchHost : ' http://localhost:9200'
5
+ indexPrefix : ' '
Original file line number Diff line number Diff line change 13
13
@returns {Elasticsearch.Client }
14
14
*/
15
15
return new elasticsearch . Client ( {
16
- host : config . enjuElasticsearchHost
16
+ host : config . enju . elasticsearchHost ,
17
+ apiVersion : config . enju . apiVersion
17
18
} ) ;
18
19
} ,
19
20
getIndexPrefix : function ( ) {
23
24
@returns {string }
24
25
*/
25
26
var ref ;
26
- return ( ref = config . enjuIndexPrefix ) != null ? ref : '' ;
27
+ return ( ref = config . enju . indexPrefix ) != null ? ref : '' ;
27
28
}
28
29
} ;
29
30
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " enju" ,
3
- "version" : " 0.2.8 " ,
3
+ "version" : " 0.3.0 " ,
4
4
"description" : " An elasticsearch on node.js written in CoffeeScript." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ module.exports =
9
9
@returns {Elasticsearch.Client}
10
10
###
11
11
new elasticsearch.Client
12
- host : config .enjuElasticsearchHost
12
+ host : config .enju .elasticsearchHost
13
+ apiVersion : config .enju .apiVersion
13
14
14
15
getIndexPrefix : ->
15
16
###
16
17
Get index prefix.
17
18
@returns {string}
18
19
###
19
- config .enjuIndexPrefix ? ' '
20
+ config .enju . indexPrefix ? ' '
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ utils = require '../lib/utils'
3
3
4
4
5
5
exports .testGetIndexPrefix = (test ) ->
6
- _enjuIndexPrefix = config .enjuIndexPrefix
7
- config .enjuIndexPrefix = ' index_'
6
+ _enjuIndexPrefix = config .enju . indexPrefix
7
+ config .enju . indexPrefix = ' index_'
8
8
9
9
test .expect 1
10
10
test .equals utils .getIndexPrefix (), ' index_'
11
11
test .done ()
12
12
13
- config .enjuIndexPrefix = _enjuIndexPrefix
13
+ config .enju . indexPrefix = _enjuIndexPrefix
You can’t perform that action at this time.
0 commit comments