qedproject 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/qedproject +5 -1
- data/lib/qedproject/libraries/jquery.rb +1 -1
- data/lib/qedproject/libraries/jquerymobile.rb +3 -3
- data/lib/qedproject/libraries/skeleton.rb +1 -1
- data/lib/qedproject/project.rb +2 -2
- data/lib/qedproject/version.rb +1 -1
- data/templates/Guardfile +7 -5
- data/templates/assets.yml +2 -2
- data/templates/sampleSpec.js +5 -6
- data/templates/suite.html +28 -28
- data/vendor/jasmine/lib/{jasmine-1.1.0 → jasmine-1.2.0}/jasmine-html.js +1 -61
- data/vendor/jasmine/lib/{jasmine-1.1.0 → jasmine-1.2.0}/jasmine.js +185 -184
- data/vendor/jquery/VERSION +1 -1
- data/vendor/jquery/jquery-1.8.2.min.js +2 -0
- data/vendor/jquerymobile/ajax-loader.gif +0 -0
- data/vendor/jquerymobile/{jquery.mobile-1.1.0.css → jquery.mobile-1.2.0.css} +611 -332
- data/vendor/jquerymobile/{jquery.mobile-1.1.0.js → jquery.mobile-1.2.0.js} +6591 -4980
- data/vendor/skeleton/VERSION +1 -5
- data/vendor/skeleton/base.css +2 -76
- data/vendor/skeleton/layout.css +2 -2
- data/vendor/skeleton/skeleton.css +2 -2
- data/vendor/skeleton/templates/index.html +50 -52
- metadata +95 -67
- data/vendor/jasmine/lib/jasmine-1.1.0/jasmine_favicon.png +0 -0
- data/vendor/jquery/jquery-1.7.0.min.js +0 -4
- data/vendor/jquerymobile/ajax-loader.png +0 -0
- data/vendor/skeleton/tabs.js +0 -29
- /data/vendor/jasmine/lib/{jasmine-1.1.0 → jasmine-1.2.0}/jasmine.css +0 -0
data/bin/qedproject
CHANGED
@@ -53,7 +53,11 @@ OptionParser.new do |opts|
|
|
53
53
|
opts.on('--server', 'start a webserver that serves public/') do
|
54
54
|
options[:server] = true
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
|
+
opts.on('-q','--qedserver', 'Installs QEDServer into the project') do
|
58
|
+
options[:qedserver] = true
|
59
|
+
end
|
60
|
+
|
57
61
|
end.parse!
|
58
62
|
if options[:server]
|
59
63
|
require 'webrick'
|
@@ -3,10 +3,10 @@ module QEDProject
|
|
3
3
|
class Jquerymobile < QEDProject::Libraries::Base
|
4
4
|
library :jquerymobile
|
5
5
|
depends_on [:jquery]
|
6
|
-
set_js_files ["jquery.mobile-1.
|
7
|
-
set_css_files ["jquery.mobile-1.
|
6
|
+
set_js_files ["jquery.mobile-1.2.0.js"]
|
7
|
+
set_css_files ["jquery.mobile-1.2.0.css" ]
|
8
8
|
set_image_files [
|
9
|
-
"ajax-loader.
|
9
|
+
"ajax-loader.gif",
|
10
10
|
"icons-18-black.png",
|
11
11
|
"icons-18-white.png",
|
12
12
|
"icons-36-black.png",
|
data/lib/qedproject/project.rb
CHANGED
@@ -132,7 +132,7 @@ module QEDProject
|
|
132
132
|
cp_r File.join(self.vendor_root, "jasmine-jquery", "jasmine-jquery.js"), File.join(self.path, "spec", "lib"), :verbose => self.verbose
|
133
133
|
end
|
134
134
|
|
135
|
-
render_template_to_file "suite.html", File.join(self.path, "spec", "
|
135
|
+
render_template_to_file "suite.html", File.join(self.path, "spec", "SpecRunner.html"), binding
|
136
136
|
if self.coffeescript
|
137
137
|
render_template_to_file "sampleSpec.coffee", File.join(self.path, "spec", "sampleSpec.coffee"), binding
|
138
138
|
else
|
@@ -158,7 +158,7 @@ module QEDProject
|
|
158
158
|
mkdir_p( self.path, :verbose => self.verbose)
|
159
159
|
mkdir_p( File.join(self.path, self.public_dir), :verbose => self.verbose)
|
160
160
|
mkdir_p( File.join(self.path, self.images_path), :verbose => self.verbose)
|
161
|
-
mkdir_p( File.join(self.path, "
|
161
|
+
mkdir_p( File.join(self.path, "_qedtmp"), :verbose => self.verbose)
|
162
162
|
mkdir_p( File.join(self.path, self.js_path), :verbose => self.verbose)
|
163
163
|
mkdir_p( File.join(self.path, self.css_path), :verbose => self.verbose)
|
164
164
|
mkdir_p( File.join(self.path, "config"), :verbose => self.verbose) if self.needs_config_folder?
|
data/lib/qedproject/version.rb
CHANGED
data/templates/Guardfile
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
<% if self.sass -%>
|
2
2
|
<% if self.jammit -%>
|
3
|
-
guard "sass", :input => "sass", :output => "
|
3
|
+
guard "sass", :input => "sass", :output => "_qedtmp"
|
4
4
|
<% else -%>
|
5
5
|
guard "sass", :input => "sass", :output => "public/stylesheets"
|
6
6
|
<% end -%>
|
7
7
|
<% end -%>
|
8
8
|
<% if self.coffeescript -%>
|
9
9
|
<% if self.jammit -%>
|
10
|
-
guard "coffeescript", :input => "coffeescripts", :output => "
|
10
|
+
guard "coffeescript", :input => "coffeescripts", :output => "_qedtmp"
|
11
11
|
<% else -%>
|
12
12
|
guard "coffeescript", :input => "coffeescripts", :output => "public/javascripts"
|
13
13
|
<% end -%>
|
@@ -20,14 +20,15 @@ guard "jammit", :force => true do
|
|
20
20
|
watch(/^javascripts\/(.*)\.js/)
|
21
21
|
watch(/^stylesheets\/(.*)\.css/)
|
22
22
|
<% if self.coffeescript -%>
|
23
|
-
watch(/^
|
23
|
+
watch(/^_qedtmp\/(.*)\.js/)
|
24
24
|
<% end -%>
|
25
25
|
<% if self.sass -%>
|
26
|
-
watch(/^
|
26
|
+
watch(/^_qedtmp\/(.*)\.css/)
|
27
27
|
<% end -%>
|
28
28
|
end
|
29
29
|
<% end -%>
|
30
30
|
|
31
|
+
<% if self.livereload -%>
|
31
32
|
guard 'livereload' do
|
32
33
|
watch(%r{public/.+\.(css|js|html)})
|
33
34
|
<% if self.jammit -%>
|
@@ -39,4 +40,5 @@ guard 'livereload' do
|
|
39
40
|
<% if self.testing -%>
|
40
41
|
watch(%r{spec/.+\.(|js|html)})
|
41
42
|
<% end -%>
|
42
|
-
end
|
43
|
+
end
|
44
|
+
<% end -%>
|
data/templates/assets.yml
CHANGED
@@ -4,7 +4,7 @@ stylesheets:
|
|
4
4
|
- <%=File.join(self.css_path, lib) %>
|
5
5
|
<% end -%>
|
6
6
|
<% if self.sass -%>
|
7
|
-
- <%= File.join("
|
7
|
+
- <%= File.join("_qedtmp", "app.css") %>
|
8
8
|
<% else -%>
|
9
9
|
- <%= File.join(self.css_path, "app.css") %>
|
10
10
|
<% end -%>
|
@@ -15,7 +15,7 @@ javascripts:
|
|
15
15
|
- <%=File.join(self.js_path, lib) %>
|
16
16
|
<% end -%>
|
17
17
|
<% if self.coffeescript -%>
|
18
|
-
- <%= File.join("
|
18
|
+
- <%= File.join("_qedtmp", "app.js") %>
|
19
19
|
<% else -%>
|
20
20
|
- <%= File.join(self.js_path, "app.js") %>
|
21
21
|
<% end -%>
|
data/templates/sampleSpec.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
return
|
4
|
-
return (expect(1 + 1)).toEqual(3);
|
5
|
-
});
|
1
|
+
describe("A sample spec", function() {
|
2
|
+
return it("performs addition", function() {
|
3
|
+
return (expect(1 + 1)).toEqual(3);
|
6
4
|
});
|
7
|
-
})
|
5
|
+
});
|
6
|
+
|
data/templates/suite.html
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Jasmine Test Runner</title>
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css">
|
6
|
+
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
|
7
|
+
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
|
8
8
|
<% if @project.uses_jquery? -%>
|
9
9
|
<script type="text/javascript" src="lib/jasmine-jquery.js"></script>
|
10
10
|
<% end -%>
|
@@ -19,38 +19,38 @@
|
|
19
19
|
<% end -%>
|
20
20
|
<!-- include spec files here... -->
|
21
21
|
<script type="text/javascript" src="sampleSpec.js"></script>
|
22
|
+
|
23
|
+
<!-- Jasmine runner -->
|
24
|
+
<script type="text/javascript">
|
25
|
+
(function() {
|
26
|
+
var jasmineEnv = jasmine.getEnv();
|
27
|
+
jasmineEnv.updateInterval = 1000;
|
22
28
|
|
23
|
-
|
24
|
-
<body>
|
29
|
+
var htmlReporter = new jasmine.HtmlReporter();
|
25
30
|
|
26
|
-
|
27
|
-
(function() {
|
28
|
-
var jasmineEnv = jasmine.getEnv();
|
29
|
-
jasmineEnv.updateInterval = 1000;
|
31
|
+
jasmineEnv.addReporter(htmlReporter);
|
30
32
|
|
31
|
-
|
33
|
+
jasmineEnv.specFilter = function(spec) {
|
34
|
+
return htmlReporter.specFilter(spec);
|
35
|
+
};
|
32
36
|
|
33
|
-
|
37
|
+
var currentWindowOnload = window.onload;
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
window.onload = function() {
|
40
|
+
if (currentWindowOnload) {
|
41
|
+
currentWindowOnload();
|
42
|
+
}
|
43
|
+
execJasmine();
|
44
|
+
};
|
38
45
|
|
39
|
-
|
40
|
-
|
41
|
-
window.onload = function() {
|
42
|
-
if (currentWindowOnload) {
|
43
|
-
currentWindowOnload();
|
46
|
+
function execJasmine() {
|
47
|
+
jasmineEnv.execute();
|
44
48
|
}
|
45
|
-
execJasmine();
|
46
|
-
};
|
47
|
-
|
48
|
-
function execJasmine() {
|
49
|
-
jasmineEnv.execute();
|
50
|
-
}
|
51
|
-
|
52
|
-
})();
|
53
|
-
</script>
|
54
49
|
|
50
|
+
})();
|
51
|
+
</script>
|
52
|
+
</head>
|
53
|
+
<body>
|
54
|
+
|
55
55
|
</body>
|
56
56
|
</html>
|
@@ -158,67 +158,7 @@ jasmine.HtmlReporter = function(_doc) {
|
|
158
158
|
);
|
159
159
|
}
|
160
160
|
};
|
161
|
-
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.
|
162
|
-
|
163
|
-
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
|
164
|
-
var el = document.createElement(type);
|
165
|
-
|
166
|
-
for (var i = 2; i < arguments.length; i++) {
|
167
|
-
var child = arguments[i];
|
168
|
-
|
169
|
-
if (typeof child === 'string') {
|
170
|
-
el.appendChild(document.createTextNode(child));
|
171
|
-
} else {
|
172
|
-
if (child) {
|
173
|
-
el.appendChild(child);
|
174
|
-
}
|
175
|
-
}
|
176
|
-
}
|
177
|
-
|
178
|
-
for (var attr in attrs) {
|
179
|
-
if (attr == "className") {
|
180
|
-
el[attr] = attrs[attr];
|
181
|
-
} else {
|
182
|
-
el.setAttribute(attr, attrs[attr]);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
|
186
|
-
return el;
|
187
|
-
};
|
188
|
-
|
189
|
-
jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
|
190
|
-
var results = child.results();
|
191
|
-
var status = results.passed() ? 'passed' : 'failed';
|
192
|
-
if (results.skipped) {
|
193
|
-
status = 'skipped';
|
194
|
-
}
|
195
|
-
|
196
|
-
return status;
|
197
|
-
};
|
198
|
-
|
199
|
-
jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
|
200
|
-
var parentDiv = this.dom.summary;
|
201
|
-
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
|
202
|
-
var parent = child[parentSuite];
|
203
|
-
|
204
|
-
if (parent) {
|
205
|
-
if (typeof this.views.suites[parent.id] == 'undefined') {
|
206
|
-
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
|
207
|
-
}
|
208
|
-
parentDiv = this.views.suites[parent.id].element;
|
209
|
-
}
|
210
|
-
|
211
|
-
parentDiv.appendChild(childElement);
|
212
|
-
};
|
213
|
-
|
214
|
-
|
215
|
-
jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
|
216
|
-
for(var fn in jasmine.HtmlReporterHelpers) {
|
217
|
-
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
|
218
|
-
}
|
219
|
-
};
|
220
|
-
|
221
|
-
jasmine.HtmlReporter.ReporterView = function(dom) {
|
161
|
+
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
|
222
162
|
this.startedAt = new Date();
|
223
163
|
this.runningSpecCount = 0;
|
224
164
|
this.completeSpecCount = 0;
|
@@ -1529,6 +1529,189 @@ jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mis
|
|
1529
1529
|
jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
|
1530
1530
|
return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
|
1531
1531
|
};
|
1532
|
+
// Mock setTimeout, clearTimeout
|
1533
|
+
// Contributed by Pivotal Computer Systems, www.pivotalsf.com
|
1534
|
+
|
1535
|
+
jasmine.FakeTimer = function() {
|
1536
|
+
this.reset();
|
1537
|
+
|
1538
|
+
var self = this;
|
1539
|
+
self.setTimeout = function(funcToCall, millis) {
|
1540
|
+
self.timeoutsMade++;
|
1541
|
+
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
|
1542
|
+
return self.timeoutsMade;
|
1543
|
+
};
|
1544
|
+
|
1545
|
+
self.setInterval = function(funcToCall, millis) {
|
1546
|
+
self.timeoutsMade++;
|
1547
|
+
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
|
1548
|
+
return self.timeoutsMade;
|
1549
|
+
};
|
1550
|
+
|
1551
|
+
self.clearTimeout = function(timeoutKey) {
|
1552
|
+
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
1553
|
+
};
|
1554
|
+
|
1555
|
+
self.clearInterval = function(timeoutKey) {
|
1556
|
+
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
1557
|
+
};
|
1558
|
+
|
1559
|
+
};
|
1560
|
+
|
1561
|
+
jasmine.FakeTimer.prototype.reset = function() {
|
1562
|
+
this.timeoutsMade = 0;
|
1563
|
+
this.scheduledFunctions = {};
|
1564
|
+
this.nowMillis = 0;
|
1565
|
+
};
|
1566
|
+
|
1567
|
+
jasmine.FakeTimer.prototype.tick = function(millis) {
|
1568
|
+
var oldMillis = this.nowMillis;
|
1569
|
+
var newMillis = oldMillis + millis;
|
1570
|
+
this.runFunctionsWithinRange(oldMillis, newMillis);
|
1571
|
+
this.nowMillis = newMillis;
|
1572
|
+
};
|
1573
|
+
|
1574
|
+
jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
|
1575
|
+
var scheduledFunc;
|
1576
|
+
var funcsToRun = [];
|
1577
|
+
for (var timeoutKey in this.scheduledFunctions) {
|
1578
|
+
scheduledFunc = this.scheduledFunctions[timeoutKey];
|
1579
|
+
if (scheduledFunc != jasmine.undefined &&
|
1580
|
+
scheduledFunc.runAtMillis >= oldMillis &&
|
1581
|
+
scheduledFunc.runAtMillis <= nowMillis) {
|
1582
|
+
funcsToRun.push(scheduledFunc);
|
1583
|
+
this.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
1584
|
+
}
|
1585
|
+
}
|
1586
|
+
|
1587
|
+
if (funcsToRun.length > 0) {
|
1588
|
+
funcsToRun.sort(function(a, b) {
|
1589
|
+
return a.runAtMillis - b.runAtMillis;
|
1590
|
+
});
|
1591
|
+
for (var i = 0; i < funcsToRun.length; ++i) {
|
1592
|
+
try {
|
1593
|
+
var funcToRun = funcsToRun[i];
|
1594
|
+
this.nowMillis = funcToRun.runAtMillis;
|
1595
|
+
funcToRun.funcToCall();
|
1596
|
+
if (funcToRun.recurring) {
|
1597
|
+
this.scheduleFunction(funcToRun.timeoutKey,
|
1598
|
+
funcToRun.funcToCall,
|
1599
|
+
funcToRun.millis,
|
1600
|
+
true);
|
1601
|
+
}
|
1602
|
+
} catch(e) {
|
1603
|
+
}
|
1604
|
+
}
|
1605
|
+
this.runFunctionsWithinRange(oldMillis, nowMillis);
|
1606
|
+
}
|
1607
|
+
};
|
1608
|
+
|
1609
|
+
jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
|
1610
|
+
this.scheduledFunctions[timeoutKey] = {
|
1611
|
+
runAtMillis: this.nowMillis + millis,
|
1612
|
+
funcToCall: funcToCall,
|
1613
|
+
recurring: recurring,
|
1614
|
+
timeoutKey: timeoutKey,
|
1615
|
+
millis: millis
|
1616
|
+
};
|
1617
|
+
};
|
1618
|
+
|
1619
|
+
/**
|
1620
|
+
* @namespace
|
1621
|
+
*/
|
1622
|
+
jasmine.Clock = {
|
1623
|
+
defaultFakeTimer: new jasmine.FakeTimer(),
|
1624
|
+
|
1625
|
+
reset: function() {
|
1626
|
+
jasmine.Clock.assertInstalled();
|
1627
|
+
jasmine.Clock.defaultFakeTimer.reset();
|
1628
|
+
},
|
1629
|
+
|
1630
|
+
tick: function(millis) {
|
1631
|
+
jasmine.Clock.assertInstalled();
|
1632
|
+
jasmine.Clock.defaultFakeTimer.tick(millis);
|
1633
|
+
},
|
1634
|
+
|
1635
|
+
runFunctionsWithinRange: function(oldMillis, nowMillis) {
|
1636
|
+
jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
|
1637
|
+
},
|
1638
|
+
|
1639
|
+
scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
|
1640
|
+
jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
|
1641
|
+
},
|
1642
|
+
|
1643
|
+
useMock: function() {
|
1644
|
+
if (!jasmine.Clock.isInstalled()) {
|
1645
|
+
var spec = jasmine.getEnv().currentSpec;
|
1646
|
+
spec.after(jasmine.Clock.uninstallMock);
|
1647
|
+
|
1648
|
+
jasmine.Clock.installMock();
|
1649
|
+
}
|
1650
|
+
},
|
1651
|
+
|
1652
|
+
installMock: function() {
|
1653
|
+
jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
|
1654
|
+
},
|
1655
|
+
|
1656
|
+
uninstallMock: function() {
|
1657
|
+
jasmine.Clock.assertInstalled();
|
1658
|
+
jasmine.Clock.installed = jasmine.Clock.real;
|
1659
|
+
},
|
1660
|
+
|
1661
|
+
real: {
|
1662
|
+
setTimeout: jasmine.getGlobal().setTimeout,
|
1663
|
+
clearTimeout: jasmine.getGlobal().clearTimeout,
|
1664
|
+
setInterval: jasmine.getGlobal().setInterval,
|
1665
|
+
clearInterval: jasmine.getGlobal().clearInterval
|
1666
|
+
},
|
1667
|
+
|
1668
|
+
assertInstalled: function() {
|
1669
|
+
if (!jasmine.Clock.isInstalled()) {
|
1670
|
+
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
1671
|
+
}
|
1672
|
+
},
|
1673
|
+
|
1674
|
+
isInstalled: function() {
|
1675
|
+
return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
|
1676
|
+
},
|
1677
|
+
|
1678
|
+
installed: null
|
1679
|
+
};
|
1680
|
+
jasmine.Clock.installed = jasmine.Clock.real;
|
1681
|
+
|
1682
|
+
//else for IE support
|
1683
|
+
jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
|
1684
|
+
if (jasmine.Clock.installed.setTimeout.apply) {
|
1685
|
+
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
1686
|
+
} else {
|
1687
|
+
return jasmine.Clock.installed.setTimeout(funcToCall, millis);
|
1688
|
+
}
|
1689
|
+
};
|
1690
|
+
|
1691
|
+
jasmine.getGlobal().setInterval = function(funcToCall, millis) {
|
1692
|
+
if (jasmine.Clock.installed.setInterval.apply) {
|
1693
|
+
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
1694
|
+
} else {
|
1695
|
+
return jasmine.Clock.installed.setInterval(funcToCall, millis);
|
1696
|
+
}
|
1697
|
+
};
|
1698
|
+
|
1699
|
+
jasmine.getGlobal().clearTimeout = function(timeoutKey) {
|
1700
|
+
if (jasmine.Clock.installed.clearTimeout.apply) {
|
1701
|
+
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
1702
|
+
} else {
|
1703
|
+
return jasmine.Clock.installed.clearTimeout(timeoutKey);
|
1704
|
+
}
|
1705
|
+
};
|
1706
|
+
|
1707
|
+
jasmine.getGlobal().clearInterval = function(timeoutKey) {
|
1708
|
+
if (jasmine.Clock.installed.clearTimeout.apply) {
|
1709
|
+
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
1710
|
+
} else {
|
1711
|
+
return jasmine.Clock.installed.clearInterval(timeoutKey);
|
1712
|
+
}
|
1713
|
+
};
|
1714
|
+
|
1532
1715
|
/**
|
1533
1716
|
* @constructor
|
1534
1717
|
*/
|
@@ -2337,192 +2520,10 @@ jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
|
|
2337
2520
|
}, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
|
2338
2521
|
}
|
2339
2522
|
};
|
2340
|
-
// Mock setTimeout, clearTimeout
|
2341
|
-
// Contributed by Pivotal Computer Systems, www.pivotalsf.com
|
2342
|
-
|
2343
|
-
jasmine.FakeTimer = function() {
|
2344
|
-
this.reset();
|
2345
|
-
|
2346
|
-
var self = this;
|
2347
|
-
self.setTimeout = function(funcToCall, millis) {
|
2348
|
-
self.timeoutsMade++;
|
2349
|
-
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
|
2350
|
-
return self.timeoutsMade;
|
2351
|
-
};
|
2352
|
-
|
2353
|
-
self.setInterval = function(funcToCall, millis) {
|
2354
|
-
self.timeoutsMade++;
|
2355
|
-
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
|
2356
|
-
return self.timeoutsMade;
|
2357
|
-
};
|
2358
|
-
|
2359
|
-
self.clearTimeout = function(timeoutKey) {
|
2360
|
-
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
2361
|
-
};
|
2362
|
-
|
2363
|
-
self.clearInterval = function(timeoutKey) {
|
2364
|
-
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
2365
|
-
};
|
2366
|
-
|
2367
|
-
};
|
2368
|
-
|
2369
|
-
jasmine.FakeTimer.prototype.reset = function() {
|
2370
|
-
this.timeoutsMade = 0;
|
2371
|
-
this.scheduledFunctions = {};
|
2372
|
-
this.nowMillis = 0;
|
2373
|
-
};
|
2374
|
-
|
2375
|
-
jasmine.FakeTimer.prototype.tick = function(millis) {
|
2376
|
-
var oldMillis = this.nowMillis;
|
2377
|
-
var newMillis = oldMillis + millis;
|
2378
|
-
this.runFunctionsWithinRange(oldMillis, newMillis);
|
2379
|
-
this.nowMillis = newMillis;
|
2380
|
-
};
|
2381
|
-
|
2382
|
-
jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
|
2383
|
-
var scheduledFunc;
|
2384
|
-
var funcsToRun = [];
|
2385
|
-
for (var timeoutKey in this.scheduledFunctions) {
|
2386
|
-
scheduledFunc = this.scheduledFunctions[timeoutKey];
|
2387
|
-
if (scheduledFunc != jasmine.undefined &&
|
2388
|
-
scheduledFunc.runAtMillis >= oldMillis &&
|
2389
|
-
scheduledFunc.runAtMillis <= nowMillis) {
|
2390
|
-
funcsToRun.push(scheduledFunc);
|
2391
|
-
this.scheduledFunctions[timeoutKey] = jasmine.undefined;
|
2392
|
-
}
|
2393
|
-
}
|
2394
|
-
|
2395
|
-
if (funcsToRun.length > 0) {
|
2396
|
-
funcsToRun.sort(function(a, b) {
|
2397
|
-
return a.runAtMillis - b.runAtMillis;
|
2398
|
-
});
|
2399
|
-
for (var i = 0; i < funcsToRun.length; ++i) {
|
2400
|
-
try {
|
2401
|
-
var funcToRun = funcsToRun[i];
|
2402
|
-
this.nowMillis = funcToRun.runAtMillis;
|
2403
|
-
funcToRun.funcToCall();
|
2404
|
-
if (funcToRun.recurring) {
|
2405
|
-
this.scheduleFunction(funcToRun.timeoutKey,
|
2406
|
-
funcToRun.funcToCall,
|
2407
|
-
funcToRun.millis,
|
2408
|
-
true);
|
2409
|
-
}
|
2410
|
-
} catch(e) {
|
2411
|
-
}
|
2412
|
-
}
|
2413
|
-
this.runFunctionsWithinRange(oldMillis, nowMillis);
|
2414
|
-
}
|
2415
|
-
};
|
2416
|
-
|
2417
|
-
jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
|
2418
|
-
this.scheduledFunctions[timeoutKey] = {
|
2419
|
-
runAtMillis: this.nowMillis + millis,
|
2420
|
-
funcToCall: funcToCall,
|
2421
|
-
recurring: recurring,
|
2422
|
-
timeoutKey: timeoutKey,
|
2423
|
-
millis: millis
|
2424
|
-
};
|
2425
|
-
};
|
2426
|
-
|
2427
|
-
/**
|
2428
|
-
* @namespace
|
2429
|
-
*/
|
2430
|
-
jasmine.Clock = {
|
2431
|
-
defaultFakeTimer: new jasmine.FakeTimer(),
|
2432
|
-
|
2433
|
-
reset: function() {
|
2434
|
-
jasmine.Clock.assertInstalled();
|
2435
|
-
jasmine.Clock.defaultFakeTimer.reset();
|
2436
|
-
},
|
2437
|
-
|
2438
|
-
tick: function(millis) {
|
2439
|
-
jasmine.Clock.assertInstalled();
|
2440
|
-
jasmine.Clock.defaultFakeTimer.tick(millis);
|
2441
|
-
},
|
2442
|
-
|
2443
|
-
runFunctionsWithinRange: function(oldMillis, nowMillis) {
|
2444
|
-
jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
|
2445
|
-
},
|
2446
|
-
|
2447
|
-
scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
|
2448
|
-
jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
|
2449
|
-
},
|
2450
|
-
|
2451
|
-
useMock: function() {
|
2452
|
-
if (!jasmine.Clock.isInstalled()) {
|
2453
|
-
var spec = jasmine.getEnv().currentSpec;
|
2454
|
-
spec.after(jasmine.Clock.uninstallMock);
|
2455
|
-
|
2456
|
-
jasmine.Clock.installMock();
|
2457
|
-
}
|
2458
|
-
},
|
2459
|
-
|
2460
|
-
installMock: function() {
|
2461
|
-
jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
|
2462
|
-
},
|
2463
|
-
|
2464
|
-
uninstallMock: function() {
|
2465
|
-
jasmine.Clock.assertInstalled();
|
2466
|
-
jasmine.Clock.installed = jasmine.Clock.real;
|
2467
|
-
},
|
2468
|
-
|
2469
|
-
real: {
|
2470
|
-
setTimeout: jasmine.getGlobal().setTimeout,
|
2471
|
-
clearTimeout: jasmine.getGlobal().clearTimeout,
|
2472
|
-
setInterval: jasmine.getGlobal().setInterval,
|
2473
|
-
clearInterval: jasmine.getGlobal().clearInterval
|
2474
|
-
},
|
2475
|
-
|
2476
|
-
assertInstalled: function() {
|
2477
|
-
if (!jasmine.Clock.isInstalled()) {
|
2478
|
-
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
2479
|
-
}
|
2480
|
-
},
|
2481
|
-
|
2482
|
-
isInstalled: function() {
|
2483
|
-
return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
|
2484
|
-
},
|
2485
|
-
|
2486
|
-
installed: null
|
2487
|
-
};
|
2488
|
-
jasmine.Clock.installed = jasmine.Clock.real;
|
2489
|
-
|
2490
|
-
//else for IE support
|
2491
|
-
jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
|
2492
|
-
if (jasmine.Clock.installed.setTimeout.apply) {
|
2493
|
-
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
2494
|
-
} else {
|
2495
|
-
return jasmine.Clock.installed.setTimeout(funcToCall, millis);
|
2496
|
-
}
|
2497
|
-
};
|
2498
|
-
|
2499
|
-
jasmine.getGlobal().setInterval = function(funcToCall, millis) {
|
2500
|
-
if (jasmine.Clock.installed.setInterval.apply) {
|
2501
|
-
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
2502
|
-
} else {
|
2503
|
-
return jasmine.Clock.installed.setInterval(funcToCall, millis);
|
2504
|
-
}
|
2505
|
-
};
|
2506
|
-
|
2507
|
-
jasmine.getGlobal().clearTimeout = function(timeoutKey) {
|
2508
|
-
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2509
|
-
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
2510
|
-
} else {
|
2511
|
-
return jasmine.Clock.installed.clearTimeout(timeoutKey);
|
2512
|
-
}
|
2513
|
-
};
|
2514
|
-
|
2515
|
-
jasmine.getGlobal().clearInterval = function(timeoutKey) {
|
2516
|
-
if (jasmine.Clock.installed.clearTimeout.apply) {
|
2517
|
-
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
2518
|
-
} else {
|
2519
|
-
return jasmine.Clock.installed.clearInterval(timeoutKey);
|
2520
|
-
}
|
2521
|
-
};
|
2522
2523
|
|
2523
2524
|
jasmine.version_= {
|
2524
2525
|
"major": 1,
|
2525
|
-
"minor":
|
2526
|
+
"minor": 2,
|
2526
2527
|
"build": 0,
|
2527
|
-
"revision":
|
2528
|
+
"revision": 1337005947
|
2528
2529
|
};
|
data/vendor/jquery/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.8.2
|