new 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. metadata +7 -66
  3. data/.gitignore +0 -7
  4. data/.rspec +0 -2
  5. data/Gemfile +0 -16
  6. data/Gemfile.lock +0 -79
  7. data/Guardfile +0 -14
  8. data/LICENSE.txt +0 -22
  9. data/README.md +0 -121
  10. data/bin/new +0 -6
  11. data/lib/new/cli.rb +0 -94
  12. data/lib/new/core.rb +0 -6
  13. data/lib/new/dsl.rb +0 -42
  14. data/lib/new/interpolate.rb +0 -100
  15. data/lib/new/project.rb +0 -34
  16. data/lib/new/task.rb +0 -41
  17. data/lib/new/template.rb +0 -64
  18. data/lib/new/version.rb +0 -41
  19. data/lib/new.rb +0 -72
  20. data/spec/fixtures/custom/tasks/custom_bar_task/custom_bar_task.rb +0 -3
  21. data/spec/fixtures/custom/templates/custom_bar_template/custom_bar.txt +0 -0
  22. data/spec/fixtures/tasks/custom_bar_task/custom_bar_task.rb +0 -1
  23. data/spec/fixtures/tasks/foo_task/foo_task.rb +0 -7
  24. data/spec/fixtures/templates/foo_template/[FOO.BAR].txt.erb +0 -1
  25. data/spec/fixtures/templates/foo_template/nested_[FOO.BAR]/foo.txt.erb +0 -1
  26. data/spec/lib/new/cli_spec.rb +0 -104
  27. data/spec/lib/new/interpolate_spec.rb +0 -41
  28. data/spec/lib/new/project_spec.rb +0 -30
  29. data/spec/lib/new/task_spec.rb +0 -39
  30. data/spec/lib/new/template_spec.rb +0 -59
  31. data/spec/lib/new/version_spec.rb +0 -28
  32. data/spec/lib/new_spec.rb +0 -19
  33. data/spec/spec_helper.rb +0 -26
  34. data/tasks/gem/README.md +0 -36
  35. data/tasks/gem/gem.rb +0 -118
  36. data/templates/js/Gemfile +0 -30
  37. data/templates/js/Guardfile +0 -7
  38. data/templates/js/LICENSE-MIT.erb +0 -22
  39. data/templates/js/README.md.erb +0 -61
  40. data/templates/js/demo/index.html.erb +0 -7
  41. data/templates/js/lib/README.md +0 -2
  42. data/templates/js/spec/[PROJECT_NAME].spec.js.coffee.erb +0 -1
  43. data/templates/js/spec/index.html.erb +0 -29
  44. data/templates/js/spec/spec_helper.js.coffee +0 -0
  45. data/templates/js/spec/vendor/chai.js +0 -3765
  46. data/templates/js/spec/vendor/sinon-chai.js +0 -106
  47. data/templates/js/spec/vendor/sinon.js +0 -4246
  48. data/templates/js/src/README.md +0 -3
  49. data/templates/js/src/[PROJECT_NAME].js.coffee.erb +0 -10
  50. data/templates/js/testem.yml +0 -12
@@ -1,106 +0,0 @@
1
- (function(sinonChai) {
2
- "use strict";
3
-
4
- // Module systems magic dance.
5
- if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
6
- // NodeJS
7
- module.exports = sinonChai;
8
- } else if (typeof define === "function" && define.amd) {
9
- // AMD
10
- define(function() {
11
- return sinonChai;
12
- });
13
- } else {
14
- // Other environment (usually <script> tag): plug in to global chai instance directly.
15
- chai.use(sinonChai);
16
- }
17
- }(function sinonChai(chai, utils) {
18
- "use strict";
19
-
20
- var slice = Array.prototype.slice;
21
-
22
- function isSpy(putativeSpy) {
23
- return typeof putativeSpy === "function" && typeof putativeSpy.getCall === "function" && typeof putativeSpy.calledWithExactly === "function";
24
- }
25
-
26
- function isCall(putativeCall) {
27
- return putativeCall && isSpy(putativeCall.proxy);
28
- }
29
-
30
- function assertCanWorkWith(assertion) {
31
- if (!isSpy(assertion._obj) && !isCall(assertion._obj)) {
32
- throw new TypeError(utils.inspect(assertion._obj) + " is not a spy or a call to a spy!");
33
- }
34
- }
35
-
36
- function getMessages(spy, action, nonNegatedSuffix, always, args) {
37
- var verbPhrase = always ? "always have " : "have ";
38
- nonNegatedSuffix = nonNegatedSuffix || "";
39
- if (isSpy(spy.proxy)) {
40
- spy = spy.proxy;
41
- }
42
-
43
- function printfArray(array) {
44
- return spy.printf.apply(spy, array);
45
- }
46
-
47
- return {
48
- affirmative: printfArray(["expected %n to " + verbPhrase + action + nonNegatedSuffix].concat(args)),
49
- negative: printfArray(["expected %n to not " + verbPhrase + action].concat(args))
50
- };
51
- }
52
-
53
- function sinonProperty(name, action, nonNegatedSuffix) {
54
- utils.addProperty(chai.Assertion.prototype, name, function() {
55
- assertCanWorkWith(this);
56
-
57
- var messages = getMessages(this._obj, action, nonNegatedSuffix, false);
58
- this.assert(this._obj[name], messages.affirmative, messages.negative);
59
- });
60
- }
61
-
62
- function createSinonMethodHandler(sinonName, action, nonNegatedSuffix) {
63
- return function() {
64
- assertCanWorkWith(this);
65
-
66
- var alwaysSinonMethod = "always" + sinonName[0].toUpperCase() + sinonName.substring(1);
67
- var shouldBeAlways = utils.flag(this, "always") && typeof this._obj[alwaysSinonMethod] === "function";
68
- var sinonMethod = shouldBeAlways ? alwaysSinonMethod : sinonName;
69
-
70
- var messages = getMessages(this._obj, action, nonNegatedSuffix, shouldBeAlways, slice.call(arguments));
71
- this.assert(this._obj[sinonMethod].apply(this._obj, arguments), messages.affirmative, messages.negative);
72
- };
73
- }
74
-
75
- function sinonMethodAsProperty(name, action, nonNegatedSuffix) {
76
- var handler = createSinonMethodHandler(name, action, nonNegatedSuffix);
77
- utils.addProperty(chai.Assertion.prototype, name, handler);
78
- }
79
-
80
- function exceptionalSinonMethod(chaiName, sinonName, action, nonNegatedSuffix) {
81
- var handler = createSinonMethodHandler(sinonName, action, nonNegatedSuffix);
82
- utils.addMethod(chai.Assertion.prototype, chaiName, handler);
83
- }
84
-
85
- function sinonMethod(name, action, nonNegatedSuffix) {
86
- exceptionalSinonMethod(name, name, action, nonNegatedSuffix);
87
- }
88
-
89
- utils.addProperty(chai.Assertion.prototype, "always", function() {
90
- utils.flag(this, "always", true);
91
- });
92
-
93
- sinonProperty("called", "been called", " at least once, but it was never called");
94
- sinonProperty("calledOnce", "been called exactly once", ", but it was called %c%C");
95
- sinonProperty("calledTwice", "been called exactly twice", ", but it was called %c%C");
96
- sinonProperty("calledThrice", "been called exactly thrice", ", but it was called %c%C");
97
- sinonMethodAsProperty("calledWithNew", "been called with new");
98
- sinonMethod("calledBefore", "been called before %1");
99
- sinonMethod("calledAfter", "been called after %1");
100
- sinonMethod("calledOn", "been called with %1 as this", ", but it was called with %t instead");
101
- sinonMethod("calledWith", "been called with arguments %*", "%C");
102
- sinonMethod("calledWithExactly", "been called with exact arguments %*", "%C");
103
- sinonMethod("calledWithMatch", "been called with arguments matching %*", "%C");
104
- sinonMethod("returned", "returned %1");
105
- exceptionalSinonMethod("thrown", "threw", "thrown %1");
106
- }));