Skip to content

Commit b969440

Browse files
committed
fix docco doc that was causing error in RandaData.coffee; require paths in RandomDataSpec.coffee; add spec task to Cakefile
1 parent bd9d904 commit b969440

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Cakefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ show_output = (err, stdout, stderr) ->
55
console.log stdout + stderr
66

77
task 'build', 'Build JS files', ->
8-
exec 'coffee --compile --output lib/ src/', (err, stdout, stderr) ->
9-
show_output err, stdout, stderr
10-
console.log "Build completed successfully." unless err
8+
exec 'coffee --compile --output lib/ src/', show_output
119

1210
task 'spec', 'Run Jasmine specs', ->
1311
exec 'jasmine-node spec', show_output
1412

13+
task 'clean', 'Removes .js files created from build task', ->
14+
exec 'rm -rf lib', show_output
15+
1516
task 'doc', 'rebuild the Docco documentation', ->
1617
exec([
1718
'docco src/RandomData.coffee'

spec/RandomDataSpec.coffee

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
random = require '../src/RandomData'
2-
data = require '../src/Data'
3-
4-
log = console.log
1+
random = require '../lib/RandomData'
2+
data = require '../lib/Data'
53

64
describe 'random-data', ->
75
# numbers

src/RandomData.coffee

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
## Source Code
4646

47-
### Housekeeping
47+
#### Housekeeping
4848

4949
# Object that will hold our exports.
5050
random = {}
@@ -53,9 +53,9 @@ random = {}
5353
data = require './Data'
5454

5555

56-
### Functions
56+
#### Functions
5757

58-
#### General random generators
58+
##### General random generators
5959

6060
# Generates a random number between 0...n, exclusive. For example
6161
# `random.number(3)` will return `0`, `1` or `2`.
@@ -70,7 +70,7 @@ random.trueOrFalse = ->
7070
random.number(2) is 1 ? true : false
7171

7272

73-
#### Strings
73+
##### Strings
7474

7575
# Generates a random alphanumeric string of given length. Default length is 16.
7676
random.string = (length = 16) ->
@@ -81,7 +81,7 @@ random.stringOfNumbers = (n) ->
8181
(i for i in [1..n]).join("") # TODO: use util.format in node.js 0.5.x
8282

8383

84-
#### Names
84+
##### Names
8585

8686
# Picks a random female first name.
8787
random.femaleFirstName = ->
@@ -104,7 +104,7 @@ random.middleInitial = ->
104104
random.element data.upper_alphas
105105

106106

107-
#### Locations
107+
##### Locations
108108

109109
# Generates random first address line.
110110
random.addressLine1 = ->
@@ -141,7 +141,7 @@ random.usZipLong = ->
141141
random.country = ->
142142
random.element data.countries
143143

144-
#### Phone Numbers
144+
##### Phone Numbers
145145

146146
# Generates a random US phone number. For example `'628-611-6473'`.
147147
random.usPhone = ->
@@ -151,5 +151,5 @@ random.usPhone = ->
151151
random.internationalPhone = ->
152152
"011-#{random.number(100) + 1}-#{random.number(100)+10}-#{random.number(10000)+1000}"
153153

154-
### Exports
154+
#### Exports
155155
module.exports = random

0 commit comments

Comments
 (0)