evergreen 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/README.rdoc +8 -6
- data/lib/evergreen.rb +8 -6
- data/lib/evergreen/application.rb +2 -5
- data/lib/evergreen/helper.rb +33 -0
- data/lib/evergreen/runner.rb +1 -1
- data/lib/evergreen/server.rb +1 -0
- data/lib/evergreen/suite.rb +6 -0
- data/lib/evergreen/version.rb +1 -1
- data/lib/evergreen/views/run.erb +16 -6
- data/lib/jasmine/Contribute.markdown +8 -7
- data/lib/jasmine/Gemfile +0 -1
- data/lib/jasmine/README.markdown +1 -8
- data/lib/jasmine/Rakefile +26 -15
- data/lib/jasmine/Release.markdown +8 -6
- data/lib/jasmine/config.rb +29 -0
- data/lib/jasmine/jasmine-core.gemspec +9 -2
- data/lib/jasmine/jasmine_dev.thor +1 -0
- data/lib/jasmine/jshint/run.js +1 -1
- data/lib/jasmine/lib/jasmine-core/jasmine-html.js +427 -1
- data/lib/jasmine/lib/jasmine-core/jasmine.css +81 -166
- data/lib/jasmine/lib/jasmine-core/jasmine.js +245 -192
- data/lib/jasmine/lib/jasmine-core/version.rb +1 -1
- data/lib/jasmine/spec/core/MatchersSpec.js +273 -0
- data/lib/jasmine/spec/core/PrettyPrintSpec.js +7 -0
- data/lib/jasmine/spec/html/HTMLReporterSpec.js +209 -0
- data/lib/jasmine/spec/node_suite.js +2 -2
- data/lib/jasmine/spec/runner.html +10 -3
- data/lib/jasmine/spec/spec_helper.rb +51 -0
- data/lib/jasmine/spec/tasks/build_distribution_spec.rb +33 -0
- data/lib/jasmine/spec/tasks/build_github_pages_spec.rb +69 -0
- data/lib/jasmine/spec/tasks/build_standalone_distribution_spec.rb +109 -0
- data/lib/jasmine/spec/tasks/build_standalone_runner_spec.rb +63 -0
- data/lib/jasmine/spec/tasks/count_specs_spec.rb +26 -0
- data/lib/jasmine/spec/tasks/execute_specs_spec.rb +81 -0
- data/lib/jasmine/spec/tasks/jshint_spec.rb +39 -0
- data/lib/jasmine/spec/tasks/release_spec.rb +39 -0
- data/lib/jasmine/spec/tasks/version_spec.rb +55 -0
- data/lib/jasmine/spec/templates/runner.html.erb +3 -3
- data/lib/jasmine/src/core/Env.js +10 -2
- data/lib/jasmine/src/core/Matchers.js +33 -4
- data/lib/jasmine/src/core/PrettyPrinter.js +2 -2
- data/lib/jasmine/src/core/base.js +15 -0
- data/lib/jasmine/src/core/mock-timeout.js +0 -0
- data/lib/jasmine/src/html/HtmlReporter.js +101 -0
- data/lib/jasmine/src/html/HtmlReporterHelpers.js +60 -0
- data/lib/jasmine/src/html/ReporterView.js +164 -0
- data/lib/jasmine/src/html/SpecView.js +79 -0
- data/lib/jasmine/src/html/SuiteView.js +22 -0
- data/lib/jasmine/src/html/TrivialReporter.js +3 -1
- data/lib/jasmine/src/html/_HTMLReporter.scss +302 -0
- data/lib/jasmine/src/html/_TrivialReporter.scss +169 -0
- data/lib/jasmine/src/html/jasmine.css +81 -166
- data/lib/jasmine/src/html/jasmine.scss +2 -0
- data/lib/jasmine/src/templates/version.js.erb +1 -0
- data/lib/jasmine/src/version.js +3 -2
- data/lib/jasmine/src/version.json +1 -1
- data/lib/jasmine/tasks/jasmine_dev.rb +18 -0
- data/lib/jasmine/tasks/jasmine_dev/base.rb +54 -0
- data/lib/jasmine/tasks/jasmine_dev/build_distribution.rb +53 -0
- data/lib/jasmine/tasks/jasmine_dev/build_github_pages.rb +31 -0
- data/lib/jasmine/tasks/jasmine_dev/build_standalone_distribution.rb +49 -0
- data/lib/jasmine/tasks/jasmine_dev/build_standalone_runner.rb +59 -0
- data/lib/jasmine/tasks/jasmine_dev/count_specs.rb +29 -0
- data/lib/jasmine/tasks/jasmine_dev/execute_specs.rb +52 -0
- data/lib/jasmine/tasks/jasmine_dev/js_hint.rb +13 -0
- data/lib/jasmine/tasks/jasmine_dev/release.rb +16 -0
- data/lib/jasmine/tasks/jasmine_dev/sources.rb +32 -0
- data/lib/jasmine/tasks/jasmine_dev/version.rb +62 -0
- data/spec/helper_spec.rb +25 -0
- data/spec/suite1/spec/javascripts/{spec_helper.coffee → helpers/spec_helper.coffee} +0 -0
- data/spec/suite1/spec/javascripts/{spec_helper.js → helpers/spec_helper.js} +0 -0
- data/spec/suite1/spec/javascripts/templates_spec.js +6 -6
- data/spec/suite2/spec/awesome_spec.js +1 -1
- data/spec/suite_spec.rb +6 -0
- metadata +116 -52
- data/lib/jasmine/src/SourcesList.json +0 -7
- data/lib/jasmine/tasks/build_dist.rb +0 -48
- data/lib/jasmine/tasks/build_specs.rb +0 -50
- data/lib/jasmine/tasks/helpers.rb +0 -50
- data/lib/jasmine/tasks/pages.rb +0 -13
- data/lib/jasmine/tasks/spec.rb +0 -37
- data/lib/jasmine/tasks/standalone.rb +0 -91
- data/lib/jasmine/tasks/version.rb +0 -5
@@ -1,166 +1,81 @@
|
|
1
|
-
body {
|
2
|
-
|
3
|
-
}
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
.
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
.
|
22
|
-
|
23
|
-
}
|
24
|
-
|
25
|
-
.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
|
31
|
-
.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
.
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
.
|
43
|
-
|
44
|
-
}
|
45
|
-
|
46
|
-
|
47
|
-
.
|
48
|
-
|
49
|
-
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
.
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
.suite.
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
.
|
70
|
-
|
71
|
-
}
|
72
|
-
|
73
|
-
.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
}
|
78
|
-
|
79
|
-
.
|
80
|
-
|
81
|
-
|
82
|
-
}
|
83
|
-
|
84
|
-
.spec.failed {
|
85
|
-
background-color: #fbb;
|
86
|
-
border-color: red;
|
87
|
-
}
|
88
|
-
|
89
|
-
.spec.passed {
|
90
|
-
background-color: #bfb;
|
91
|
-
border-color: green;
|
92
|
-
}
|
93
|
-
|
94
|
-
.spec.skipped {
|
95
|
-
background-color: #bbb;
|
96
|
-
}
|
97
|
-
|
98
|
-
.messages {
|
99
|
-
border-left: 1px dashed gray;
|
100
|
-
padding-left: 1em;
|
101
|
-
padding-right: 1em;
|
102
|
-
}
|
103
|
-
|
104
|
-
.passed {
|
105
|
-
background-color: #cfc;
|
106
|
-
display: none;
|
107
|
-
}
|
108
|
-
|
109
|
-
.failed {
|
110
|
-
background-color: #fbb;
|
111
|
-
}
|
112
|
-
|
113
|
-
.skipped {
|
114
|
-
color: #777;
|
115
|
-
background-color: #eee;
|
116
|
-
display: none;
|
117
|
-
}
|
118
|
-
|
119
|
-
|
120
|
-
/*.resultMessage {*/
|
121
|
-
/*white-space: pre;*/
|
122
|
-
/*}*/
|
123
|
-
|
124
|
-
.resultMessage span.result {
|
125
|
-
display: block;
|
126
|
-
line-height: 2em;
|
127
|
-
color: black;
|
128
|
-
}
|
129
|
-
|
130
|
-
.resultMessage .mismatch {
|
131
|
-
color: black;
|
132
|
-
}
|
133
|
-
|
134
|
-
.stackTrace {
|
135
|
-
white-space: pre;
|
136
|
-
font-size: .8em;
|
137
|
-
margin-left: 10px;
|
138
|
-
max-height: 5em;
|
139
|
-
overflow: auto;
|
140
|
-
border: 1px inset red;
|
141
|
-
padding: 1em;
|
142
|
-
background: #eef;
|
143
|
-
}
|
144
|
-
|
145
|
-
.finished-at {
|
146
|
-
padding-left: 1em;
|
147
|
-
font-size: .6em;
|
148
|
-
}
|
149
|
-
|
150
|
-
.show-passed .passed,
|
151
|
-
.show-skipped .skipped {
|
152
|
-
display: block;
|
153
|
-
}
|
154
|
-
|
155
|
-
|
156
|
-
#jasmine_content {
|
157
|
-
position:fixed;
|
158
|
-
right: 100%;
|
159
|
-
}
|
160
|
-
|
161
|
-
.runner {
|
162
|
-
border: 1px solid gray;
|
163
|
-
display: block;
|
164
|
-
margin: 5px 0;
|
165
|
-
padding: 2px 0 2px 10px;
|
166
|
-
}
|
1
|
+
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
|
2
|
+
|
3
|
+
#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
|
4
|
+
#HTMLReporter a { text-decoration: none; }
|
5
|
+
#HTMLReporter a:hover { text-decoration: underline; }
|
6
|
+
#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
|
7
|
+
#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
|
8
|
+
#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
|
9
|
+
#HTMLReporter .version { color: #aaaaaa; }
|
10
|
+
#HTMLReporter .banner { margin-top: 14px; }
|
11
|
+
#HTMLReporter .duration { color: #aaaaaa; float: right; }
|
12
|
+
#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
|
13
|
+
#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
|
14
|
+
#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
|
15
|
+
#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
|
16
|
+
#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
|
17
|
+
#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
|
18
|
+
#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
|
19
|
+
#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
|
20
|
+
#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
|
21
|
+
#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
|
22
|
+
#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
23
|
+
#HTMLReporter .runningAlert { background-color: #666666; }
|
24
|
+
#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
|
25
|
+
#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
|
26
|
+
#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
|
27
|
+
#HTMLReporter .passingAlert { background-color: #a6b779; }
|
28
|
+
#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
|
29
|
+
#HTMLReporter .failingAlert { background-color: #cf867e; }
|
30
|
+
#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
|
31
|
+
#HTMLReporter .results { margin-top: 14px; }
|
32
|
+
#HTMLReporter #details { display: none; }
|
33
|
+
#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
|
34
|
+
#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
|
35
|
+
#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
|
36
|
+
#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
|
37
|
+
#HTMLReporter.showDetails .summary { display: none; }
|
38
|
+
#HTMLReporter.showDetails #details { display: block; }
|
39
|
+
#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
|
40
|
+
#HTMLReporter .summary { margin-top: 14px; }
|
41
|
+
#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
|
42
|
+
#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
|
43
|
+
#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
|
44
|
+
#HTMLReporter .description + .suite { margin-top: 0; }
|
45
|
+
#HTMLReporter .suite { margin-top: 14px; }
|
46
|
+
#HTMLReporter .suite a { color: #333333; }
|
47
|
+
#HTMLReporter #details .specDetail { margin-bottom: 28px; }
|
48
|
+
#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
|
49
|
+
#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
|
50
|
+
#HTMLReporter .resultMessage span.result { display: block; }
|
51
|
+
#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
|
52
|
+
|
53
|
+
#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
|
54
|
+
#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
|
55
|
+
#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
|
56
|
+
#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
|
57
|
+
#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
|
58
|
+
#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
|
59
|
+
#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
|
60
|
+
#TrivialReporter .runner.running { background-color: yellow; }
|
61
|
+
#TrivialReporter .options { text-align: right; font-size: .8em; }
|
62
|
+
#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
|
63
|
+
#TrivialReporter .suite .suite { margin: 5px; }
|
64
|
+
#TrivialReporter .suite.passed { background-color: #dfd; }
|
65
|
+
#TrivialReporter .suite.failed { background-color: #fdd; }
|
66
|
+
#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
|
67
|
+
#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
|
68
|
+
#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
|
69
|
+
#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
|
70
|
+
#TrivialReporter .spec.skipped { background-color: #bbb; }
|
71
|
+
#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
|
72
|
+
#TrivialReporter .passed { background-color: #cfc; display: none; }
|
73
|
+
#TrivialReporter .failed { background-color: #fbb; }
|
74
|
+
#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
|
75
|
+
#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
|
76
|
+
#TrivialReporter .resultMessage .mismatch { color: black; }
|
77
|
+
#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
|
78
|
+
#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
|
79
|
+
#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
|
80
|
+
#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
|
81
|
+
#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
|
data/lib/jasmine/src/version.js
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'json'
|
3
|
+
require 'tilt'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
$:.unshift(File.join(File.dirname(__FILE__), "jasmine_dev"))
|
7
|
+
|
8
|
+
require "base"
|
9
|
+
require "sources"
|
10
|
+
require "js_hint"
|
11
|
+
require "build_distribution"
|
12
|
+
require "build_github_pages"
|
13
|
+
require "build_standalone_distribution"
|
14
|
+
require "build_standalone_runner"
|
15
|
+
require "count_specs"
|
16
|
+
require "execute_specs"
|
17
|
+
require "release"
|
18
|
+
require "version"
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class JasmineDev < Thor
|
2
|
+
include Thor::Actions
|
3
|
+
|
4
|
+
def self.source_root
|
5
|
+
File.dirname(__FILE__)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.source_paths
|
9
|
+
[
|
10
|
+
File.join(JasmineDev.project_root, 'lib', 'jasmine-core'),
|
11
|
+
JasmineDev.project_root
|
12
|
+
]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.project_root
|
16
|
+
File.join(JasmineDev.source_root, '..', '..')
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.spacer
|
20
|
+
"\n--------------------"
|
21
|
+
end
|
22
|
+
|
23
|
+
no_tasks do
|
24
|
+
# allows merged stdout in test with low-harassment
|
25
|
+
def run_with_output(*run_args)
|
26
|
+
say run *run_args
|
27
|
+
end
|
28
|
+
|
29
|
+
def node_installed?
|
30
|
+
return true if has_node?
|
31
|
+
|
32
|
+
say "Node.js is required to develop Jasmine. Please visit http://nodejs.org to install.",
|
33
|
+
:red
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
def has_node?
|
38
|
+
run "which node", :verbose => false, :capture => true
|
39
|
+
$?.exitstatus == 0
|
40
|
+
end
|
41
|
+
|
42
|
+
def pages_submodule_installed?
|
43
|
+
return true if has_pages_submodule?
|
44
|
+
|
45
|
+
say "Submodule for Github Pages isn't present. Run git submodule update --init",
|
46
|
+
:red
|
47
|
+
false
|
48
|
+
end
|
49
|
+
|
50
|
+
def has_pages_submodule?
|
51
|
+
File.exist?(File.join(JasmineDev.project_root, 'pages', 'index.html'))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
class JasmineDev < Thor
|
2
|
+
|
3
|
+
desc "build_distribution", "Build Jasmine js & css files"
|
4
|
+
def build_distribution(directory = "./lib/jasmine-core")
|
5
|
+
invoke :js_hint
|
6
|
+
|
7
|
+
say JasmineDev.spacer
|
8
|
+
|
9
|
+
say "Building Jasmine distribution from source into #{directory}", :cyan
|
10
|
+
|
11
|
+
say 'Building JavaScript...', :yellow
|
12
|
+
|
13
|
+
inside directory do
|
14
|
+
create_file "jasmine.js",
|
15
|
+
concat_contents_of(jasmine_js_paths),
|
16
|
+
:force => true
|
17
|
+
create_file "jasmine-html.js",
|
18
|
+
concat_contents_of(jasmine_html_js_paths),
|
19
|
+
:force => true
|
20
|
+
end
|
21
|
+
|
22
|
+
say 'Building CSS...', :yellow
|
23
|
+
|
24
|
+
run "compass compile", :capture => true
|
25
|
+
|
26
|
+
copy_file File.join("#{JasmineDev.project_root}", 'src', 'html', 'jasmine.css'),
|
27
|
+
File.join(directory, 'jasmine.css')
|
28
|
+
end
|
29
|
+
|
30
|
+
no_tasks do
|
31
|
+
def jasmine_js_paths
|
32
|
+
paths = JasmineDev::JASMINE_SOURCES[:core].collect do |f|
|
33
|
+
File.join(JasmineDev.project_root, 'src', 'core', f)
|
34
|
+
end
|
35
|
+
|
36
|
+
paths << File.join(JasmineDev.project_root, 'src', 'version.js')
|
37
|
+
paths
|
38
|
+
end
|
39
|
+
|
40
|
+
def jasmine_html_js_paths
|
41
|
+
JasmineDev::JASMINE_SOURCES[:html].collect do |f|
|
42
|
+
File.join(JasmineDev.project_root, 'src', 'html', f)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def concat_contents_of(paths)
|
47
|
+
paths.inject("") do |string, path|
|
48
|
+
string << File.read(path)
|
49
|
+
string
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class JasmineDev < Thor
|
2
|
+
|
3
|
+
desc "build_github_pages", "Build static pages for pivotal.github.com/jasmine"
|
4
|
+
def build_github_pages(pages_dir = File.expand_path(File.join('.', 'pages')))
|
5
|
+
say JasmineDev.spacer
|
6
|
+
|
7
|
+
say "Building Github Pages...", :cyan
|
8
|
+
|
9
|
+
return unless pages_submodule_installed?
|
10
|
+
|
11
|
+
pages_output = File.join(pages_dir, 'pages_output')
|
12
|
+
FileUtils.rm_r(pages_output) if File.exist?(pages_output)
|
13
|
+
|
14
|
+
inside File.join('pages', 'pages_source') do
|
15
|
+
run_with_output "frank export #{pages_output}", :capture => true
|
16
|
+
end
|
17
|
+
|
18
|
+
pages_files = Dir.chdir(pages_output) { Dir.glob('*') }
|
19
|
+
|
20
|
+
pages_files.each do |file|
|
21
|
+
source_path = File.join(pages_output, file)
|
22
|
+
destination_path = File.join(pages_dir, file)
|
23
|
+
|
24
|
+
if File.directory?(source_path)
|
25
|
+
directory source_path, destination_path
|
26
|
+
else
|
27
|
+
copy_file source_path, destination_path
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class JasmineDev < Thor
|
2
|
+
include Thor::Actions
|
3
|
+
|
4
|
+
desc "build_standalone_distribution", "Build Jasmine standalone distribution"
|
5
|
+
def build_standalone_distribution(download_dir = File.expand_path(File.join('.', 'pages', 'downloads')))
|
6
|
+
invoke :build_distribution
|
7
|
+
|
8
|
+
say JasmineDev.spacer
|
9
|
+
|
10
|
+
say "Building standalone distribution...", :cyan
|
11
|
+
|
12
|
+
say "Staging files...", :yellow
|
13
|
+
|
14
|
+
lib_files.each do |f|
|
15
|
+
copy_file f, File.join(standalone_temp_dir, 'lib', "jasmine-#{version_string}", f)
|
16
|
+
end
|
17
|
+
|
18
|
+
['src', 'spec'].each do |dir|
|
19
|
+
directory File.join('lib', 'jasmine-core', 'example', dir),
|
20
|
+
File.join(standalone_temp_dir, dir)
|
21
|
+
end
|
22
|
+
|
23
|
+
invoke :build_standalone_runner
|
24
|
+
|
25
|
+
say "Zipping distribution...", :yellow
|
26
|
+
|
27
|
+
inside standalone_temp_dir do
|
28
|
+
run_with_output "zip -rq ../jasmine-standalone-#{version_string}.zip ."
|
29
|
+
|
30
|
+
say "Copying Zip file to downloads directory", :yellow
|
31
|
+
run "cp ../jasmine-standalone-#{version_string}.zip #{download_dir}"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
no_tasks do
|
37
|
+
def standalone_temp_dir
|
38
|
+
@standalone_temp_dir ||= File.join(Dir.tmpdir, 'jasmine_standalone', "jasmine-standalone-#{version_string}")
|
39
|
+
end
|
40
|
+
|
41
|
+
def lib_files
|
42
|
+
%w{ jasmine.js jasmine-html.js jasmine.css MIT.LICENSE }
|
43
|
+
end
|
44
|
+
|
45
|
+
def example_path
|
46
|
+
File.join('lib', "jasmine-#{version_string}")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|