Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 8a9e34c0f0197e16850cafc39e251a6f7a9bbeb9 @drd0rk committed Dec 21, 2011
Showing with 9,664 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +38 −0 lib/strgen.coffee
  3. +1 −0 node_modules/.bin/cake
  4. +1 −0 node_modules/.bin/coffee
  5. +1 −0 node_modules/.bin/vows
  6. +11 −0 node_modules/coffee-script/.npmignore
  7. +22 −0 node_modules/coffee-script/LICENSE
  8. +51 −0 node_modules/coffee-script/README
  9. +78 −0 node_modules/coffee-script/Rakefile
  10. +7 −0 node_modules/coffee-script/bin/cake
  11. +7 −0 node_modules/coffee-script/bin/coffee
  12. +44 −0 node_modules/coffee-script/extras/jsl.conf
  13. +74 −0 node_modules/coffee-script/lib/coffee-script/browser.js
  14. +99 −0 node_modules/coffee-script/lib/coffee-script/cake.js
  15. +150 −0 node_modules/coffee-script/lib/coffee-script/coffee-script.js
  16. +442 −0 node_modules/coffee-script/lib/coffee-script/command.js
  17. +592 −0 node_modules/coffee-script/lib/coffee-script/grammar.js
  18. +72 −0 node_modules/coffee-script/lib/coffee-script/helpers.js
  19. +10 −0 node_modules/coffee-script/lib/coffee-script/index.js
  20. +686 −0 node_modules/coffee-script/lib/coffee-script/lexer.js
  21. +2,514 −0 node_modules/coffee-script/lib/coffee-script/nodes.js
  22. +122 −0 node_modules/coffee-script/lib/coffee-script/optparse.js
  23. +674 −0 node_modules/coffee-script/lib/coffee-script/parser.js
  24. +149 −0 node_modules/coffee-script/lib/coffee-script/repl.js
  25. +301 −0 node_modules/coffee-script/lib/coffee-script/rewriter.js
  26. +124 −0 node_modules/coffee-script/lib/coffee-script/scope.js
  27. +31 −0 node_modules/coffee-script/package.json
  28. +1 −0 node_modules/vows/.gitignore
  29. +20 −0 node_modules/vows/LICENSE
  30. +7 −0 node_modules/vows/Makefile
  31. +65 −0 node_modules/vows/README.md
  32. +548 −0 node_modules/vows/bin/vows
  33. +42 −0 node_modules/vows/lib/assert/error.js
  34. +215 −0 node_modules/vows/lib/assert/macros.js
  35. +77 −0 node_modules/vows/lib/assert/utils.js
  36. +255 −0 node_modules/vows/lib/vows.js
  37. +139 −0 node_modules/vows/lib/vows/console.js
  38. +76 −0 node_modules/vows/lib/vows/context.js
  39. +29 −0 node_modules/vows/lib/vows/coverage/file.js
  40. +2 −0 node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html
  41. +61 −0 node_modules/vows/lib/vows/coverage/fragments/coverage-head.html
  42. +54 −0 node_modules/vows/lib/vows/coverage/report-html.js
  43. +54 −0 node_modules/vows/lib/vows/coverage/report-json.js
  44. +38 −0 node_modules/vows/lib/vows/coverage/report-plain.js
  45. +28 −0 node_modules/vows/lib/vows/extras.js
  46. +67 −0 node_modules/vows/lib/vows/reporters/dot-matrix.js
  47. +16 −0 node_modules/vows/lib/vows/reporters/json.js
  48. +8 −0 node_modules/vows/lib/vows/reporters/silent.js
  49. +42 −0 node_modules/vows/lib/vows/reporters/spec.js
  50. +37 −0 node_modules/vows/lib/vows/reporters/watch.js
  51. +90 −0 node_modules/vows/lib/vows/reporters/xunit.js
  52. +368 −0 node_modules/vows/lib/vows/suite.js
  53. +15 −0 node_modules/vows/package.json
  54. +133 −0 node_modules/vows/test/assert-test.js
  55. +18 −0 node_modules/vows/test/fixtures/isolate/failing.js
  56. +18 −0 node_modules/vows/test/fixtures/isolate/log.js
  57. +17 −0 node_modules/vows/test/fixtures/isolate/passing.js
  58. +18 −0 node_modules/vows/test/fixtures/isolate/stderr.js
  59. +16 −0 node_modules/vows/test/fixtures/supress-stdout/output.js
  60. +140 −0 node_modules/vows/test/isolate-test.js
  61. +43 −0 node_modules/vows/test/supress-stdout-test.js
  62. +51 −0 node_modules/vows/test/vows-error-test.js
  63. +486 −0 node_modules/vows/test/vows-test.js
  64. +14 −0 node_modules/vows/test/vows_underscore_test.js
  65. +23 −0 package.json
  66. +31 −0 test/test.coffee
@@ -0,0 +1 @@
+*.*~
@@ -0,0 +1,38 @@
+module.exports = class StrGen
+
+ # the length of the generated string
+ @strLength = 64
+
+ # available character sets
+ @chars =
+ "abc": "abcdefghijklmnopqrstuvwxyz"
+ "ABC": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "digits": "0123456789"
+ "special_email": "-_."
+ "special_other": "@|:;#~'`?}{][&%$§!><+*/()"
+
+ @alphabet = ""
+
+ # generates the random string
+ @generate: () ->
+ resultStr = ""
+ for i in [0..@strLength-1]
+ randNum = Math.floor(Math.random() * @alphabet.length);
+ resultStr += @alphabet[randNum];
+ resultStr
+
+
+ # define the length of the generated string
+ @setLength: (len) ->
+ throw new Error "String length must be at least 2, "+len+" given" if len < 2
+ @strLength = len
+
+ # define the alphabet of the generated string
+ @setAlphabet: (alphabet) ->
+ switch alphabet
+ when "ascii" then @alphabet = (String.fromCharCode(num) for num in [33..255] when num isnt 127)
+ when "email" then @alphabet = @chars.abc.concat @chars.ABC.concat @chars.digits.concat @chars.special_email
+ when "typical" then @alphabet = @chars.abc.concat @chars.ABC.concat @chars.digits.concat @chars.special_email.concat @chars.special_other
+ else @alphabet = alphabet
+
+

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 8a9e34c

Please sign in to comment.