trusty-festivity-extension 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/skins/traf/fn-instagram-bg.svg +1 -0
  3. data/app/assets/images/skins/traf/fn-twitter-bg.svg +1 -0
  4. data/app/assets/images/skins/traf/traf-background.png +0 -0
  5. data/app/assets/images/skins/traf/traf-bottom-wave.png +0 -0
  6. data/app/assets/images/skins/traf/traf-bridge.png +0 -0
  7. data/app/assets/images/skins/traf/traf-bubbles.png +0 -0
  8. data/app/assets/images/skins/traf/traf-logo.svg +1 -0
  9. data/app/assets/javascripts/modal.js +2 -2
  10. data/app/assets/stylesheets/grunticon/info.svg +1 -0
  11. data/app/assets/stylesheets/grunticon/production/icons.data.png.css +4 -0
  12. data/app/assets/stylesheets/grunticon/production/icons.data.svg.css +5 -0
  13. data/app/assets/stylesheets/grunticon/production/icons.fallback.css +5 -0
  14. data/app/assets/stylesheets/grunticon/production/png/info.png +0 -0
  15. data/app/assets/stylesheets/library/_icons.scss +8 -1
  16. data/app/assets/stylesheets/skins/traf/contexts/_featured_events.scss +72 -0
  17. data/app/assets/stylesheets/skins/traf/contexts/_homepage.scss +95 -0
  18. data/app/assets/stylesheets/skins/traf/contexts/_social_feed.scss +82 -0
  19. data/app/assets/stylesheets/skins/traf/library/_general-mixins.scss +1 -0
  20. data/app/assets/stylesheets/skins/traf/skin.scss +2 -2
  21. data/app/assets/stylesheets/traf.scss +3 -0
  22. data/app/models/festivity_event_list.rb +4 -1
  23. data/app/presenters/social/twitter_post_presenter.rb +32 -0
  24. data/app/services/twitter_feed_service.rb +16 -0
  25. data/app/views/festivity_events/show.html.haml +2 -4
  26. data/app/views/festivity_markets/_market.html.haml +1 -3
  27. data/app/views/social/_instagram_posts.html.haml +0 -4
  28. data/app/views/social/_twitter_posts.html.haml +16 -0
  29. data/lib/tags/header_tags.rb +3 -2
  30. data/lib/tags/social_feed_tags.rb +13 -0
  31. data/lib/trusty-festivity-extension.rb +1 -1
  32. metadata +17 -73
  33. data/node_modules/bower/node_modules/handlebars/coverage/coverage.json +0 -1
  34. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.js.html +0 -436
  35. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.runtime.js.html +0 -424
  36. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/base.js.html +0 -1012
  37. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/ast.js.html +0 -961
  38. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/base.js.html +0 -382
  39. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/compiler.js.html +0 -1675
  40. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/helpers.js.html +0 -880
  41. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/index.html +0 -441
  42. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/javascript-compiler.js.html +0 -3211
  43. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/parser.js.html +0 -1819
  44. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/printer.js.html +0 -742
  45. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/visitor.js.html +0 -355
  46. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/exception.js.html +0 -403
  47. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/index.html +0 -402
  48. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/runtime.js.html +0 -898
  49. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/safe-string.js.html +0 -352
  50. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/utils.js.html +0 -583
  51. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/index.html +0 -363
  52. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/index.html +0 -389
  53. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/lib/index.html +0 -363
  54. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/lib/index.js.html +0 -400
  55. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/lib/precompiler.js.html +0 -754
  56. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/prettify.css +0 -1
  57. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/prettify.js +0 -1
  58. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/ast.js.html +0 -1594
  59. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/basic.js.html +0 -973
  60. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/blocks.js.html +0 -676
  61. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/builtins.js.html +0 -1018
  62. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/data.js.html +0 -1093
  63. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/browser.js.html +0 -406
  64. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/common.js.html +0 -481
  65. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/index.html +0 -402
  66. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/node.js.html +0 -391
  67. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/runner.js.html +0 -457
  68. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/env/runtime.js.html +0 -466
  69. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/helpers.js.html +0 -2182
  70. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/index.html +0 -597
  71. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/javascript-compiler.js.html +0 -535
  72. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/parser.js.html +0 -892
  73. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/partials.js.html +0 -841
  74. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/precompiler.js.html +0 -442
  75. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/regressions.js.html +0 -790
  76. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/require.js.html +0 -391
  77. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/runtime.js.html +0 -337
  78. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/spec.js.html +0 -469
  79. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/string-params.js.html +0 -850
  80. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/subexpressions.js.html +0 -970
  81. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/tokenizer.js.html +0 -1528
  82. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/track-ids.js.html +0 -811
  83. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/utils.js.html +0 -499
  84. data/node_modules/bower/node_modules/handlebars/coverage/lcov-report/spec/whitespace-control.js.html +0 -508
  85. data/node_modules/bower/node_modules/handlebars/coverage/lcov.info +0 -3181
  86. data/node_modules/bower/node_modules/semver/semver.browser.js.gz +0 -0
  87. data/node_modules/bower/node_modules/semver/semver.min.js.gz +0 -0
  88. data/node_modules/bower/node_modules/tmp/README.md +0 -162
  89. data/node_modules/bower/node_modules/tmp/domain-test.js +0 -13
  90. data/node_modules/bower/node_modules/tmp/lib/tmp.js +0 -307
  91. data/node_modules/bower/node_modules/tmp/package.json +0 -50
  92. data/node_modules/bower/node_modules/tmp/test-all.sh +0 -9
  93. data/node_modules/bower/node_modules/tmp/test.js +0 -6
  94. data/node_modules/bower/node_modules/tmp/test/base.js +0 -74
  95. data/node_modules/bower/node_modules/tmp/test/dir-test.js +0 -196
  96. data/node_modules/bower/node_modules/tmp/test/file-test.js +0 -177
  97. data/node_modules/bower/node_modules/tmp/test/graceful.js +0 -15
  98. data/node_modules/bower/node_modules/tmp/test/keep.js +0 -11
  99. data/node_modules/bower/node_modules/tmp/test/name-test.js +0 -82
  100. data/node_modules/bower/node_modules/tmp/test/spawn.js +0 -32
  101. data/node_modules/bower/node_modules/tmp/test/symlinkme/file.js +0 -0
  102. data/node_modules/bower/node_modules/tmp/test/unsafe.js +0 -30
  103. data/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/nested-error-stacks/README.md~ +0 -0
@@ -1,50 +0,0 @@
1
- {
2
- "name": "tmp",
3
- "version": "0.0.24",
4
- "description": "Temporary file and directory creator",
5
- "author": {
6
- "name": "KARASZI István",
7
- "email": "github@spam.raszi.hu",
8
- "url": "http://raszi.hu/"
9
- },
10
- "homepage": "http://github.com/raszi/node-tmp",
11
- "keywords": [
12
- "temporary",
13
- "tmp",
14
- "temp",
15
- "tempdir",
16
- "tempfile",
17
- "tmpdir",
18
- "tmpfile"
19
- ],
20
- "licenses": [
21
- {
22
- "type": "MIT",
23
- "url": "http://opensource.org/licenses/MIT"
24
- }
25
- ],
26
- "repository": {
27
- "type": "git",
28
- "url": "git://github.com/raszi/node-tmp.git"
29
- },
30
- "bugs": {
31
- "url": "http://github.com/raszi/node-tmp/issues"
32
- },
33
- "main": "lib/tmp.js",
34
- "scripts": {
35
- "test": "vows test/*-test.js"
36
- },
37
- "engines": {
38
- "node": ">=0.4.0"
39
- },
40
- "dependencies": {},
41
- "devDependencies": {
42
- "vows": "~0.7.0"
43
- },
44
- "readme": "# Tmp\n\nA simple temporary file and directory creator for [node.js.][1]\n\n[![Build Status](https://secure.travis-ci.org/raszi/node-tmp.png?branch=master)](http://travis-ci.org/raszi/node-tmp)\n\n## About\n\nThe main difference between bruce's [node-temp][2] is that mine more\naggressively checks for the existence of the newly created temporary file and\ncreates the new file with `O_EXCL` instead of simple `O_CREAT | O_RDRW`, so it\nis safer.\n\nThe API is slightly different as well, Tmp does not yet provide synchronous\ncalls and all the parameters are optional.\n\nYou can set whether you want to remove the temporary file on process exit or\nnot, and the destination directory can also be set.\n\n## How to install\n\n```bash\nnpm install tmp\n```\n\n## Usage\n\n### File creation\n\nSimple temporary file creation, the file will be unlinked on process exit.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.file(function _tempFileCreated(err, path, fd) {\n if (err) throw err;\n\n console.log(\"File: \", path);\n console.log(\"Filedescriptor: \", fd);\n});\n```\n\n### Directory creation\n\nSimple temporary directory creation, it will be removed on process exit.\n\nIf the directory still contains items on process exit, then it won't be removed.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir(function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\nIf you want to cleanup the directory even when there are entries in it, then\nyou can pass the `unsafeCleanup` option when creating it.\n\n### Filename generation\n\nIt is possible with this library to generate a unique filename in the specified\ndirectory.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.tmpName(function _tempNameGenerated(err, path) {\n if (err) throw err;\n\n console.log(\"Created temporary filename: \", path);\n});\n```\n\n## Advanced usage\n\n### File creation\n\nCreates a file with mode `0644`, prefix will be `prefix-` and postfix will be `.txt`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.file({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) {\n if (err) throw err;\n\n console.log(\"File: \", path);\n console.log(\"Filedescriptor: \", fd);\n});\n```\n\n### Directory creation\n\nCreates a directory with mode `0755`, prefix will be `myTmpDir_`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir({ mode: 0750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\n### mkstemps like\n\nCreates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`.\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.dir({ template: '/tmp/tmp-XXXXXX' }, function _tempDirCreated(err, path) {\n if (err) throw err;\n\n console.log(\"Dir: \", path);\n});\n```\n\n### Filename generation\n\nThe `tmpName()` function accepts the `prefix`, `postfix`, `dir`, etc. parameters also:\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.tmpName({ template: '/tmp/tmp-XXXXXX' }, function _tempNameGenerated(err, path) {\n if (err) throw err;\n\n console.log(\"Created temporary filename: \", path);\n});\n```\n\n## Graceful cleanup\n\nOne may want to cleanup the temporary files even when an uncaught exception\noccurs. To enforce this, you can call the `setGracefulCleanup()` method:\n\n```javascript\nvar tmp = require('tmp');\n\ntmp.setGracefulCleanup();\n```\n\n## Options\n\nAll options are optional :)\n\n * `mode`: the file mode to create with, it fallbacks to `0600` on file creation and `0700` on directory creation\n * `prefix`: the optional prefix, fallbacks to `tmp-` if not provided\n * `postfix`: the optional postfix, fallbacks to `.tmp` on file creation\n * `template`: [`mkstemps`][3] like filename template, no default\n * `dir`: the optional temporary directory, fallbacks to system default (guesses from environment)\n * `tries`: how many times should the function try to get a unique filename before giving up, default `3`\n * `keep`: signals that the temporary file or directory should not be deleted on exit, default is `false`, means delete\n * `unsafeCleanup`: recursively removes the created temporary directory, even when it's not empty. default is `false`\n\n[1]: http://nodejs.org/\n[2]: https://github.com/bruce/node-temp\n[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html\n",
45
- "readmeFilename": "README.md",
46
- "_id": "tmp@0.0.24",
47
- "_shasum": "d6a5e198d14a9835cc6f2d7c3d9e302428c8cf12",
48
- "_resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.24.tgz",
49
- "_from": "tmp@0.0.24"
50
- }
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
-
3
- #node06
4
- for node in node08 node; do
5
- command -v ${node} > /dev/null 2>&1 || continue
6
-
7
- echo "Testing with $(${node} --version)..."
8
- ${node} node_modules/vows/bin/vows test/*test.js
9
- done
@@ -1,6 +0,0 @@
1
- process.on('uncaughtException', function ( err ) {
2
- console.log('blah');
3
- throw err;
4
- });
5
-
6
- throw "on purpose"
@@ -1,74 +0,0 @@
1
- var
2
- assert = require('assert'),
3
- path = require('path'),
4
- exec = require('child_process').exec;
5
-
6
- function _spawnTestWithError(testFile, params, cb) {
7
- _spawnTest(true, testFile, params, cb);
8
- }
9
-
10
- function _spawnTestWithoutError(testFile, params, cb) {
11
- _spawnTest(false, testFile, params, cb);
12
- }
13
-
14
- function _spawnTest(passError, testFile, params, cb) {
15
- var
16
- filename,
17
- node_path = process.argv[0],
18
- command = [ node_path, path.join(__dirname, testFile) ].concat(params).join(' ');
19
-
20
- exec(command, function _execDone(err, stdout, stderr) {
21
- if (passError) {
22
- if (err) {
23
- return cb(err);
24
- } else if (stderr.length > 0) {
25
- return cb(stderr.toString());
26
- }
27
- }
28
-
29
- return cb(null, stdout.toString());
30
- });
31
- }
32
-
33
- function _testStat(stat, mode) {
34
- assert.equal(stat.uid, process.getuid(), 'should have the same UID');
35
- assert.equal(stat.gid, process.getgid(), 'should have the same GUID');
36
- assert.equal(stat.mode, mode);
37
- }
38
-
39
- function _testPrefix(prefix) {
40
- return function _testPrefixGenerated(err, name, fd) {
41
- assert.equal(path.basename(name).slice(0, prefix.length), prefix, 'should have the provided prefix');
42
- };
43
- }
44
-
45
- function _testPostfix(postfix) {
46
- return function _testPostfixGenerated(err, name, fd) {
47
- assert.equal(name.slice(name.length - postfix.length, name.length), postfix, 'should have the provided postfix');
48
- };
49
- }
50
-
51
- function _testKeep(type, keep, cb) {
52
- _spawnTestWithError('keep.js', [ type, keep ], cb);
53
- }
54
-
55
- function _testGraceful(type, graceful, cb) {
56
- _spawnTestWithoutError('graceful.js', [ type, graceful ], cb);
57
- }
58
-
59
- function _assertName(err, name) {
60
- assert.isString(name);
61
- assert.isNotZero(name.length);
62
- }
63
-
64
- function _testUnsafeCleanup(unsafe, cb) {
65
- _spawnTestWithoutError('unsafe.js', [ 'dir', unsafe ], cb);
66
- }
67
-
68
- module.exports.testStat = _testStat;
69
- module.exports.testPrefix = _testPrefix;
70
- module.exports.testPostfix = _testPostfix;
71
- module.exports.testKeep = _testKeep;
72
- module.exports.testGraceful = _testGraceful;
73
- module.exports.assertName = _assertName;
74
- module.exports.testUnsafeCleanup = _testUnsafeCleanup;
@@ -1,196 +0,0 @@
1
- var
2
- vows = require('vows'),
3
- assert = require('assert'),
4
-
5
- path = require('path'),
6
- fs = require('fs'),
7
- existsSync = fs.existsSync || path.existsSync,
8
-
9
- tmp = require('../lib/tmp.js'),
10
- Test = require('./base.js');
11
-
12
-
13
- function _testDir(mode) {
14
- return function _testDirGenerated(err, name) {
15
- assert.ok(existsSync(name), 'should exist');
16
-
17
- var stat = fs.statSync(name);
18
- assert.ok(stat.isDirectory(), 'should be a directory');
19
-
20
- Test.testStat(stat, mode);
21
- };
22
- }
23
-
24
- vows.describe('Directory creation').addBatch({
25
- 'when using without parameters': {
26
- topic: function () {
27
- tmp.dir(this.callback);
28
- },
29
-
30
- 'should be a directory': _testDir(040700),
31
- 'should have the default prefix': Test.testPrefix('tmp-')
32
- },
33
-
34
- 'when using with prefix': {
35
- topic: function () {
36
- tmp.dir({ prefix: 'something' }, this.callback);
37
- },
38
-
39
- 'should not return with an error': assert.isNull,
40
- 'should return with a name': Test.assertName,
41
- 'should be a directory': _testDir(040700),
42
- 'should have the provided prefix': Test.testPrefix('something')
43
- },
44
-
45
- 'when using with postfix': {
46
- topic: function () {
47
- tmp.dir({ postfix: '.txt' }, this.callback);
48
- },
49
-
50
- 'should not return with an error': assert.isNull,
51
- 'should return with a name': Test.assertName,
52
- 'should be a directory': _testDir(040700),
53
- 'should have the provided postfix': Test.testPostfix('.txt')
54
- },
55
-
56
- 'when using template': {
57
- topic: function () {
58
- tmp.dir({ template: path.join(tmp.tmpdir, 'clike-XXXXXX-postfix') }, this.callback);
59
- },
60
-
61
- 'should not return with error': assert.isNull,
62
- 'should return with a name': Test.assertName,
63
- 'should be a file': _testDir(040700),
64
- 'should have the provided prefix': Test.testPrefix('clike-'),
65
- 'should have the provided postfix': Test.testPostfix('-postfix')
66
- },
67
-
68
- 'when using multiple options': {
69
- topic: function () {
70
- tmp.dir({ prefix: 'foo', postfix: 'bar', mode: 0750 }, this.callback);
71
- },
72
-
73
- 'should not return with an error': assert.isNull,
74
- 'should return with a name': Test.assertName,
75
- 'should be a directory': _testDir(040750),
76
- 'should have the provided prefix': Test.testPrefix('foo'),
77
- 'should have the provided postfix': Test.testPostfix('bar')
78
- },
79
-
80
- 'when using multiple options and mode': {
81
- topic: function () {
82
- tmp.dir({ prefix: 'complicated', postfix: 'options', mode: 0755 }, this.callback);
83
- },
84
-
85
- 'should not return with an error': assert.isNull,
86
- 'should return with a name': Test.assertName,
87
- 'should be a directory': _testDir(040755),
88
- 'should have the provided prefix': Test.testPrefix('complicated'),
89
- 'should have the provided postfix': Test.testPostfix('options')
90
- },
91
-
92
- 'no tries': {
93
- topic: function () {
94
- tmp.dir({ tries: -1 }, this.callback);
95
- },
96
-
97
- 'should return with an error': assert.isObject
98
- },
99
-
100
- 'keep testing': {
101
- topic: function () {
102
- Test.testKeep('dir', '1', this.callback);
103
- },
104
-
105
- 'should not return with an error': assert.isNull,
106
- 'should return with a name': Test.assertName,
107
- 'should be a dir': function (err, name) {
108
- _testDir(040700)(err, name);
109
- fs.rmdirSync(name);
110
- }
111
- },
112
-
113
- 'unlink testing': {
114
- topic: function () {
115
- Test.testKeep('dir', '0', this.callback);
116
- },
117
-
118
- 'should not return with error': assert.isNull,
119
- 'should return with a name': Test.assertName,
120
- 'should not exist': function (err, name) {
121
- assert.ok(!existsSync(name), "Directory should be removed");
122
- }
123
- },
124
-
125
- 'non graceful testing': {
126
- topic: function () {
127
- Test.testGraceful('dir', '0', this.callback);
128
- },
129
-
130
- 'should not return with error': assert.isNull,
131
- 'should return with a name': Test.assertName,
132
- 'should be a dir': function (err, name) {
133
- _testDir(040700)(err, name);
134
- fs.rmdirSync(name);
135
- }
136
- },
137
-
138
- 'graceful testing': {
139
- topic: function () {
140
- Test.testGraceful('dir', '1', this.callback);
141
- },
142
-
143
- 'should not return with an error': assert.isNull,
144
- 'should return with a name': Test.assertName,
145
- 'should not exist': function (err, name) {
146
- assert.ok(!existsSync(name), "Directory should be removed");
147
- }
148
- },
149
-
150
- 'unsafeCleanup === true': {
151
- topic: function () {
152
- Test.testUnsafeCleanup('1', this.callback);
153
- },
154
-
155
- 'should not return with an error': assert.isNull,
156
- 'should return with a name': Test.assertName,
157
- 'should not exist': function (err, name) {
158
- assert.ok(!existsSync(name), "Directory should be removed");
159
- },
160
- 'should remove symlinked dir': function(err, name) {
161
- assert.ok(
162
- !existsSync(name + '/symlinkme-target'),
163
- 'should remove target'
164
- );
165
- },
166
- 'should not remove contents of symlink dir': function(err, name) {
167
- assert.ok(
168
- existsSync(__dirname + '/symlinkme/file.js'),
169
- 'should not remove symlinked directory\'s content'
170
- );
171
- }
172
- },
173
-
174
- 'unsafeCleanup === false': {
175
- topic: function () {
176
- Test.testUnsafeCleanup('0', this.callback);
177
- },
178
-
179
- 'should not return with an error': assert.isNull,
180
- 'should return with a name': Test.assertName,
181
- 'should be a directory': _testDir(040700)
182
- },
183
-
184
- 'remove callback': {
185
- topic: function () {
186
- tmp.dir(this.callback);
187
- },
188
-
189
- 'should not return with an error': assert.isNull,
190
- 'should return with a name': Test.assertName,
191
- 'removeCallback should remove directory': function (_err, name, removeCallback) {
192
- removeCallback();
193
- assert.ok(!existsSync(name), "Directory should be removed");
194
- }
195
- }
196
- }).exportTo(module);
@@ -1,177 +0,0 @@
1
- var
2
- vows = require('vows'),
3
- assert = require('assert'),
4
-
5
- path = require('path'),
6
- fs = require('fs'),
7
- existsSync = fs.existsSync || path.existsSync,
8
-
9
- tmp = require('../lib/tmp.js'),
10
- Test = require('./base.js');
11
-
12
-
13
- function _testFile(mode, fdTest) {
14
- return function _testFileGenerated(err, name, fd) {
15
- assert.ok(existsSync(name), 'should exist');
16
-
17
- var stat = fs.statSync(name);
18
- assert.equal(stat.size, 0, 'should have zero size');
19
- assert.ok(stat.isFile(), 'should be a file');
20
-
21
- Test.testStat(stat, mode);
22
-
23
- // check with fstat as well (fd checking)
24
- if (fdTest) {
25
- var fstat = fs.fstatSync(fd);
26
- assert.deepEqual(fstat, stat, 'fstat results should be the same');
27
-
28
- var data = new Buffer('something');
29
- assert.equal(fs.writeSync(fd, data, 0, data.length, 0), data.length, 'should be writable');
30
- assert.ok(!fs.closeSync(fd), 'should not return with error');
31
- }
32
- };
33
- }
34
-
35
- vows.describe('File creation').addBatch({
36
- 'when using without parameters': {
37
- topic: function () {
38
- tmp.file(this.callback);
39
- },
40
-
41
- 'should not return with an error': assert.isNull,
42
- 'should return with a name': Test.assertName,
43
- 'should be a file': _testFile(0100600, true),
44
- 'should have the default prefix': Test.testPrefix('tmp-'),
45
- 'should have the default postfix': Test.testPostfix('.tmp')
46
- },
47
-
48
- 'when using with prefix': {
49
- topic: function () {
50
- tmp.file({ prefix: 'something' }, this.callback);
51
- },
52
-
53
- 'should not return with an error': assert.isNull,
54
- 'should return with a name': Test.assertName,
55
- 'should be a file': _testFile(0100600, true),
56
- 'should have the provided prefix': Test.testPrefix('something')
57
- },
58
-
59
- 'when using with postfix': {
60
- topic: function () {
61
- tmp.file({ postfix: '.txt' }, this.callback);
62
- },
63
-
64
- 'should not return with an error': assert.isNull,
65
- 'should return with a name': Test.assertName,
66
- 'should be a file': _testFile(0100600, true),
67
- 'should have the provided postfix': Test.testPostfix('.txt')
68
- },
69
-
70
- 'when using template': {
71
- topic: function () {
72
- tmp.file({ template: path.join(tmp.tmpdir, 'clike-XXXXXX-postfix') }, this.callback);
73
- },
74
-
75
- 'should not return with an error': assert.isNull,
76
- 'should return with a name': Test.assertName,
77
- 'should be a file': _testFile(0100600, true),
78
- 'should have the provided prefix': Test.testPrefix('clike-'),
79
- 'should have the provided postfix': Test.testPostfix('-postfix')
80
- },
81
-
82
- 'when using multiple options': {
83
- topic: function () {
84
- tmp.file({ prefix: 'foo', postfix: 'bar', mode: 0640 }, this.callback);
85
- },
86
-
87
- 'should not return with an error': assert.isNull,
88
- 'should return with a name': Test.assertName,
89
- 'should be a file': _testFile(0100640, true),
90
- 'should have the provided prefix': Test.testPrefix('foo'),
91
- 'should have the provided postfix': Test.testPostfix('bar')
92
- },
93
-
94
- 'when using multiple options and mode': {
95
- topic: function () {
96
- tmp.file({ prefix: 'complicated', postfix: 'options', mode: 0644 }, this.callback);
97
- },
98
-
99
- 'should not return with an error': assert.isNull,
100
- 'should return with a name': Test.assertName,
101
- 'should be a file': _testFile(0100644, true),
102
- 'should have the provided prefix': Test.testPrefix('complicated'),
103
- 'should have the provided postfix': Test.testPostfix('options')
104
- },
105
-
106
- 'no tries': {
107
- topic: function () {
108
- tmp.file({ tries: -1 }, this.callback);
109
- },
110
-
111
- 'should not be created': assert.isObject
112
- },
113
-
114
- 'keep testing': {
115
- topic: function () {
116
- Test.testKeep('file', '1', this.callback);
117
- },
118
-
119
- 'should not return with an error': assert.isNull,
120
- 'should return with a name': Test.assertName,
121
- 'should be a file': function (err, name) {
122
- _testFile(0100600, false)(err, name, null);
123
- fs.unlinkSync(name);
124
- }
125
- },
126
-
127
- 'unlink testing': {
128
- topic: function () {
129
- Test.testKeep('file', '0', this.callback);
130
- },
131
-
132
- 'should not return with an error': assert.isNull,
133
- 'should return with a name': Test.assertName,
134
- 'should not exist': function (err, name) {
135
- assert.ok(!existsSync(name), "File should be removed");
136
- }
137
- },
138
-
139
- 'non graceful testing': {
140
- topic: function () {
141
- Test.testGraceful('file', '0', this.callback);
142
- },
143
-
144
- 'should not return with error': assert.isNull,
145
- 'should return with a name': Test.assertName,
146
- 'should be a file': function (err, name) {
147
- _testFile(0100600, false)(err, name, null);
148
- fs.unlinkSync(name);
149
- }
150
- },
151
-
152
- 'graceful testing': {
153
- topic: function () {
154
- Test.testGraceful('file', '1', this.callback);
155
- },
156
-
157
- 'should not return with an error': assert.isNull,
158
- 'should return with a name': Test.assertName,
159
- 'should not exist': function (err, name) {
160
- assert.ok(!existsSync(name), "File should be removed");
161
- }
162
- },
163
-
164
- 'remove callback': {
165
- topic: function () {
166
- tmp.file(this.callback);
167
- },
168
-
169
- 'should not return with an error': assert.isNull,
170
- 'should return with a name': Test.assertName,
171
- 'removeCallback should remove file': function (_err, name, _fd, removeCallback) {
172
- removeCallback();
173
- assert.ok(!existsSync(name), "File should be removed");
174
- }
175
- }
176
-
177
- }).exportTo(module);