Skip to content

Commit

Permalink
Release 3.0.0-alpha.2
Browse files Browse the repository at this point in the history
  • Loading branch information
qiu8310 committed Jun 12, 2015
1 parent 78124e3 commit dbe605b
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .jshintrc
Expand Up @@ -17,7 +17,7 @@
"strict": false,
"trailing": true,
"smarttabs": true,
"maxlen": 120,
"maxlen": 140,
"globals": {
"describe" : false,
"context" : false,
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,11 @@

3.0.0-alpha.2 / 2015-06-12
==========================

* 指定 doc 中的 example 的脚本名称为 javascript
* update readme
* Fix node v0.10 not support child_process.execSync

3.0.0-alpha.1 / 2015-05-15
==========================

Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -121,6 +121,7 @@ when your code is compiled, you can use a smaller elegant.def script.
----------- | ---------------
`@name` | `String`, Function name
`@alias` | `String`, Function name alias
`@example` | `String`, Function example, used in generating doc
`@defaults` | `Object`, Function's arguments default values
`@rule` | The main config item (Continue to see more detail)

Expand Down Expand Up @@ -240,6 +241,7 @@ __Case Insensitive__
* rule 可以指定名称,然后在函数执行是可以知道当前是匹配了哪条 rule
* 整合我的 spa-bootstrap
* 支持新类型 enum: (string<enum> flag = ok|cancel, string foo)
* 支持多 type: (string|int some, bool other) -> *
* 根据 rule 自动化测试
* 自动测试
* silent def
Expand Down
12 changes: 6 additions & 6 deletions bin/def-doc.js
Expand Up @@ -40,23 +40,23 @@ if (!program.args.length) {
docs.forEach(function(docObj) {

var source = relativeFile + '#L' + docObj.loc.start.line + '-' + docObj.loc.end.line;
result.push('### [' + (docObj.names && docObj.names.shift() || '(anonymous)') + '](' + source + ')');
result.push('### [' + (docObj.names && docObj.names.length && docObj.names.join(' & ') || '(anonymous)') + '](' + source + ')');

if (docObj.desc) {
result.push(docObj.desc);
}

if (docObj.names && docObj.names.length) {
result.push('__Alias: __`' + docObj.names.join('`, `') + '`');
}
//if (docObj.names && docObj.names.length) {
// result.push('__Alias:__ `' + docObj.names.join('`, `') + '`');
//}

result.push('__Rules: __');
result.push('__Rules:__ ');
result.push(docObj.rules.map(function(rule) {
return ' - `' + ruleToString(rule) + '`';
}).join(os.EOL));

if (docObj.examples.length) {
result.push('__Examples: __');
result.push('__Examples:__ ');
}
docObj.examples.forEach(function(ex) {
result.push('```js');
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "elegant.def",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"homepage": "https://github.com/qiu8310/elegant.def",
"authors": [
"Zhonglei Qiu <zhongleiqiu@gmail.com>"
Expand Down
8 changes: 3 additions & 5 deletions examples/arguments.md
@@ -1,18 +1,16 @@
## [arguments.js](arguments.js)

### [argFn](arguments.js#L3-20)
### [argFn & xx](arguments.js#L3-20)

这里是函数描述

__Alias: __`xx`

__Rules: __
__Rules:__

- `() -> int`
- `(int a = 0) -> int`
- `(int a = 0, int b = 10) -> int`

__Examples: __
__Examples:__

```js

Expand Down
2 changes: 1 addition & 1 deletion examples/class-member-def.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](class-member-def.js#L7-12)

__Rules: __
__Rules:__

- `(string words) -> string`

Expand Down
4 changes: 2 additions & 2 deletions examples/embed-def.md
Expand Up @@ -2,7 +2,7 @@

### [someName](embed-def.js#L3-17)

__Rules: __
__Rules:__

- `(int a) -> int`

Expand All @@ -11,7 +11,7 @@ __Rules: __

### [(anonymous)](embed-def.js#L8-13)

__Rules: __
__Rules:__

- `(int a) -> int`

Expand Down
4 changes: 2 additions & 2 deletions examples/multiple-def.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](multiple-def.js#L3-8)

__Rules: __
__Rules:__

- `(int a) -> int`

Expand All @@ -11,7 +11,7 @@ __Rules: __

### [(anonymous)](multiple-def.js#L10-16)

__Rules: __
__Rules:__

- `(int b) -> string`

Expand Down
2 changes: 1 addition & 1 deletion examples/random.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](random.js#L6-13)

__Rules: __
__Rules:__

- `() -> int`
- `(int min = 0) -> int`
Expand Down
2 changes: 1 addition & 1 deletion examples/range.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](range.js#L6-20)

__Rules: __
__Rules:__

- `() -> array`
- `(int start = 0) -> array`
Expand Down
6 changes: 3 additions & 3 deletions examples/rest-def.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](rest-def.js#L3-11)

__Rules: __
__Rules:__

- `(int ...all) -> int`

Expand All @@ -11,7 +11,7 @@ __Rules: __

### [(anonymous)](rest-def.js#L19-25)

__Rules: __
__Rules:__

- `(array to = [], * ...others) -> array`

Expand All @@ -20,7 +20,7 @@ __Rules: __

### [(anonymous)](rest-def.js#L32-37)

__Rules: __
__Rules:__

- `(int a, int ...b, string c) -> string`

Expand Down
2 changes: 1 addition & 1 deletion examples/unique.md
Expand Up @@ -2,7 +2,7 @@

### [(anonymous)](unique.js#L3-11)

__Rules: __
__Rules:__

- `() -> int`
- `(int a = 0) -> int`
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "elegant.def",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"description": "Elegant define javascript function",
"main": "src/full.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions test/testDefCompile.js
Expand Up @@ -50,23 +50,23 @@ describe('defCompile', function() {
docs.forEach(function(docObj) {

var source = relativeFile + '#L' + docObj.loc.start.line + '-' + docObj.loc.end.line;
result.push('### [' + (docObj.names && docObj.names.shift() || '(anonymous)') + '](' + source + ')');
result.push('### [' + (docObj.names && docObj.names.length && docObj.names.join(' & ') || '(anonymous)') + '](' + source + ')');

if (docObj.desc) {
result.push(docObj.desc);
}

if (docObj.names && docObj.names.length) {
result.push('__Alias: __`' + docObj.names.join('`, `') + '`');
}
//if (docObj.names && docObj.names.length) {
// result.push('__Alias:__ `' + docObj.names.join('`, `') + '`');
//}

result.push('__Rules: __');
result.push('__Rules:__ ');
result.push(docObj.rules.map(function(rule) {
return ' - `' + ruleToString(rule) + '`';
}).join(os.EOL));

if (docObj.examples.length) {
result.push('__Examples: __');
result.push('__Examples:__ ');
}
docObj.examples.forEach(function(ex) {
result.push('```js');
Expand Down

0 comments on commit dbe605b

Please sign in to comment.