riot-js 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ [submodule "xpcomcore/lib/riot"]
2
+ path = xpcomcore/lib/riot
3
+ url = git://github.com/conflagrationjs/riotjs.git
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require 'pathname'
3
4
 
4
5
  begin
5
6
  require 'jeweler'
@@ -10,35 +11,24 @@ begin
10
11
  gem.email = "gabriel.gironda@gmail.com"
11
12
  gem.homepage = "http://github.com/gabrielg/riot-js"
12
13
  gem.authors = ["ggironda"]
13
-
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
+
15
+ gem.add_dependency "xpcomcore-rubygem"
16
+ gem.add_development_dependency "jsdoc-toolkit"
15
17
  end
16
18
  Jeweler::GemcutterTasks.new
17
19
  rescue LoadError
18
20
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
19
21
  end
20
22
 
21
- # require 'rake/testtask'
22
- # Rake::TestTask.new(:test) do |test|
23
- # test.libs << 'lib' << 'test'
24
- # test.pattern = 'test/**/*_test.rb'
25
- # test.verbose = true
26
- # end
27
- #
28
- # task :test => :check_dependencies
29
- #
30
- # task :default => :test
31
- #
32
- # require 'rake/rdoctask'
33
- # Rake::RDocTask.new do |rdoc|
34
- # if File.exist?('VERSION')
35
- # version = File.read('VERSION')
36
- # else
37
- # version = ""
38
- # end
39
- #
40
- # rdoc.rdoc_dir = 'rdoc'
41
- # rdoc.title = "riot-js #{version}"
42
- # rdoc.rdoc_files.include('README*')
43
- # rdoc.rdoc_files.include('lib/**/*.rb')
44
- # end
23
+
24
+
25
+ gem 'jsdoc-toolkit'
26
+ require 'jsdoc-toolkit/doc_task'
27
+ desc "Builds the docs."
28
+ JsDocToolkit::DocTask.new(:doc) do |doc|
29
+ doc.jsdoc_dir = 'xpcomcore/doc'
30
+ doc.jsdoc_files << 'xpcomcore/lib'
31
+ end
32
+
33
+ task :test => :check_dependencies
34
+ task :default => :test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -0,0 +1 @@
1
+ warn("There isn't much here, buddy. Just us lonely old Ruby files.")
@@ -0,0 +1,60 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{riotjs}
8
+ s.version = "0.0.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = %w(ggironda alexyoung)
12
+ s.date = %q{2009-10-20}
13
+ s.description = %q{JS version of the Riot testing framework}
14
+ s.email = %q{hello@conflagrationjs.org}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/riotjs.rb",
27
+ "riotjs.gemspec",
28
+ "xpcomcore/doc/files.html",
29
+ "xpcomcore/doc/index.html",
30
+ "xpcomcore/doc/symbols/_global_.html",
31
+ "xpcomcore/doc/symbols/src/xpcomcore_lib_riot.js.html",
32
+ "xpcomcore/lib/riot.js",
33
+ "xpcomcore/lib/riot/README.textile",
34
+ "xpcomcore/lib/riot/riot.js",
35
+ "xpcomcore/lib/riot/riotjs.html",
36
+ "xpcomcore/lib/riot/test.js",
37
+ "xpcomcore/test/"
38
+ ]
39
+ s.homepage = %q{http://github.com/conflagrationjs/riotjs}
40
+ s.rdoc_options = ["--charset=UTF-8"]
41
+ s.require_paths = ["lib"]
42
+ s.rubygems_version = %q{1.3.5}
43
+ s.summary = %q{JavaScript version of the Riot unit testing framework}
44
+
45
+ if s.respond_to? :specification_version then
46
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
+ s.specification_version = 3
48
+
49
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<xpcomcore-rubygem>, [">= 0"])
51
+ s.add_development_dependency(%q<jsdoc-toolkit>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<xpcomcore-rubygem>, [">= 0"])
54
+ s.add_dependency(%q<jsdoc-toolkit>, [">= 0"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<xpcomcore-rubygem>, [">= 0"])
58
+ s.add_dependency(%q<jsdoc-toolkit>, [">= 0"])
59
+ end
60
+ end
@@ -0,0 +1,216 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+
7
+ <title>JsDoc Reference - File Index</title>
8
+ <meta name="generator" content="JsDoc Toolkit" />
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <div id="header">
178
+ </div>
179
+
180
+ <div id="index">
181
+ <div align="center"><a href="index.html">Class Index</a>
182
+ | <a href="files.html">File Index</a></div>
183
+ <hr />
184
+ <h2>Classes</h2>
185
+ <ul class="classList">
186
+
187
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
188
+
189
+ </ul>
190
+ <hr />
191
+ </div>
192
+
193
+ <div id="content">
194
+ <h1 class="classTitle">File Index</h1>
195
+
196
+
197
+ <div>
198
+ <h2><a href="symbols/src/xpcomcore_lib_riot.js.html">xpcomcore/lib/riot.js</a></h2>
199
+
200
+ <dl>
201
+
202
+
203
+
204
+
205
+ </dl>
206
+ </div>
207
+ <hr />
208
+
209
+
210
+ </div>
211
+ <div class="fineprint" style="clear:both">
212
+
213
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Fri Oct 16 2009 18:12:16 GMT-0500 (CDT)
214
+ </div>
215
+ </body>
216
+ </html>
@@ -0,0 +1,210 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+
7
+ <title>JsDoc Reference - Index</title>
8
+ <meta name="generator" content="JsDoc Toolkit" />
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <div id="header">
178
+ </div>
179
+
180
+ <div id="index">
181
+ <div align="center"><a href="index.html">Class Index</a>
182
+ | <a href="files.html">File Index</a></div>
183
+ <hr />
184
+ <h2>Classes</h2>
185
+ <ul class="classList">
186
+
187
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
188
+
189
+ </ul>
190
+ <hr />
191
+ </div>
192
+
193
+ <div id="content">
194
+ <h1 class="classTitle">Class Index</h1>
195
+
196
+
197
+ <div>
198
+ <h2><a href="symbols/_global_.html">_global_</a></h2>
199
+
200
+ </div>
201
+ <hr />
202
+
203
+
204
+ </div>
205
+ <div class="fineprint" style="clear:both">
206
+
207
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Fri Oct 16 2009 18:12:16 GMT-0500 (CDT)
208
+ </div>
209
+ </body>
210
+ </html>
@@ -0,0 +1,249 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="JsDoc Toolkit" />
7
+
8
+ <title>JsDoc Reference - _global_</title>
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <!-- ============================== header ================================= -->
178
+ <!-- begin static/header.html -->
179
+ <div id="header">
180
+ </div>
181
+ <!-- end static/header.html -->
182
+
183
+ <!-- ============================== classes index ============================ -->
184
+ <div id="index">
185
+ <!-- begin publish.classesIndex -->
186
+ <div align="center"><a href="../index.html">Class Index</a>
187
+ | <a href="../files.html">File Index</a></div>
188
+ <hr />
189
+ <h2>Classes</h2>
190
+ <ul class="classList">
191
+
192
+ <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
193
+
194
+ </ul>
195
+ <hr />
196
+ <!-- end publish.classesIndex -->
197
+ </div>
198
+
199
+ <div id="content">
200
+ <!-- ============================== class title ============================ -->
201
+ <h1 class="classTitle">
202
+
203
+ Built-In Namespace _global_
204
+ </h1>
205
+
206
+ <!-- ============================== class summary ========================== -->
207
+ <p class="description">
208
+
209
+
210
+
211
+
212
+
213
+
214
+ </p>
215
+
216
+ <!-- ============================== constructor summary ==================== -->
217
+
218
+
219
+ <!-- ============================== properties summary ===================== -->
220
+
221
+
222
+ <!-- ============================== methods summary ======================== -->
223
+
224
+ <!-- ============================== events summary ======================== -->
225
+
226
+
227
+ <!-- ============================== constructor details ==================== -->
228
+
229
+
230
+ <!-- ============================== field details ========================== -->
231
+
232
+
233
+ <!-- ============================== method details ========================= -->
234
+
235
+
236
+ <!-- ============================== event details ========================= -->
237
+
238
+
239
+ <hr />
240
+ </div>
241
+
242
+
243
+ <!-- ============================== footer ================================= -->
244
+ <div class="fineprint" style="clear:both">
245
+
246
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Fri Oct 16 2009 18:12:16 GMT-0500 (CDT)
247
+ </div>
248
+ </body>
249
+ </html>
@@ -0,0 +1,8 @@
1
+ <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
2
+ .KEYW {color: #933;}
3
+ .COMM {color: #bbb; font-style: italic;}
4
+ .NUMB {color: #393;}
5
+ .STRN {color: #393;}
6
+ .REGX {color: #339;}
7
+ .line {border-right: 1px dotted #666; color: #666; font-style: normal;}
8
+ </style></head><body><pre><span class='line'> 1</span> <span class="NAME">puts</span><span class="PUNC">(</span><span class="STRN">"Hi from riot-js."</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
@@ -0,0 +1,381 @@
1
+ /*jslint white: false plusplus: false onevar: false browser: true evil: true*/
2
+ /*global window: true*/
3
+ var Riot = {
4
+ results: [],
5
+ contexts: [],
6
+
7
+ run: function(tests) {
8
+ if (typeof XPCOMCore !== 'undefined') {
9
+ Riot.formatter = new Riot.Formatters.XPComCore();
10
+ Riot.runAndReport(tests);
11
+ Sys.exit(Riot.exitCode);
12
+ } else if (typeof window === 'undefined') {
13
+ Riot.formatter = new Riot.Formatters.Text();
14
+ Riot.runAndReport(tests);
15
+ java.lang.System.exit(Riot.exitCode);
16
+ } else {
17
+ Riot.formatter = new Riot.Formatters.HTML();
18
+ var onload = window.onload;
19
+ window.onload = function() {
20
+ if (onload) { window.onload(); }
21
+ Riot.runAndReport(tests);
22
+ };
23
+ }
24
+ },
25
+
26
+ runAndReport: function(tests) {
27
+ this.running = true;
28
+ var benchmark = Riot.Benchmark.run(1, function() { Riot.runAllContexts(tests); });
29
+ Riot.formatter.separator();
30
+ Riot.summariseAllResults();
31
+ Riot.formatter.line(benchmark);
32
+ this.running = false;
33
+ },
34
+
35
+ runAllContexts: function(tests) {
36
+ if (typeof tests !== 'undefined') {
37
+ this.withDSL(tests)();
38
+ }
39
+
40
+ for (var i = 0; i < this.contexts.length; i++) {
41
+ this.contexts[i].run();
42
+ }
43
+ },
44
+
45
+ functionBody: function(fn) {
46
+ return '(' + fn.toString().replace(/\s+$/, '') + ')()';
47
+ },
48
+
49
+ withDSL: function(fn, context) {
50
+ var body = this.functionBody(fn),
51
+ f = new Function('context', 'given', 'asserts', 'should', 'setup', 'teardown', body),
52
+ args = [
53
+ Riot.context,
54
+ Riot.given,
55
+ function() { return context.asserts.apply(context, arguments); },
56
+ function() { return context.should.apply(context, arguments); },
57
+ function() { return context.setup.apply(context, arguments); },
58
+ function() { return context.teardown.apply(context, arguments); }
59
+ ];
60
+
61
+ return function() { f.apply(Riot, args); };
62
+ },
63
+
64
+ context: function(title, callback) {
65
+ var context = new Riot.Context(title, callback);
66
+
67
+ if (this.running) {
68
+ context.run();
69
+ } else {
70
+ Riot.contexts.push(context);
71
+ }
72
+
73
+ return context;
74
+ },
75
+
76
+ given: function(title, callback) {
77
+ title = 'Given ' + title;
78
+ return Riot.context(title, callback);
79
+ },
80
+
81
+ summariseAllResults: function() { return this.summarise(this.results); },
82
+
83
+ summarise: function(results) {
84
+ var failures = 0;
85
+ for (var i = 0; i < results.length; i++) {
86
+ if (!results[i].pass) { failures++; }
87
+ }
88
+ this.formatter.line(results.length + ' assertions: ' + failures + ' failures');
89
+ this.exitCode = failures > 0 ? 1 : 0;
90
+ },
91
+
92
+ addResult: function(context, assertion, pass) {
93
+ var result = {
94
+ assertion: assertion,
95
+ pass: pass,
96
+ context: context
97
+ };
98
+ this.results.push(result);
99
+ }
100
+ };
101
+
102
+ Riot.Benchmark = {
103
+ results: [],
104
+
105
+ addResult: function(start, end) {
106
+ this.results.push(end - start);
107
+ },
108
+
109
+ displayResults: function() {
110
+ var total = 0,
111
+ seconds = 0,
112
+ i = 0;
113
+ for (i = 0; i < this.results.length; i++) {
114
+ total += this.results[i];
115
+ }
116
+ seconds = total / 1000;
117
+ return 'Elapsed time: ' + total + 'ms (' + seconds + ' seconds)';
118
+ },
119
+
120
+ run: function(times, callback) {
121
+ this.results = [];
122
+ for (var i = 0; i < times; i++) {
123
+ var start = new Date(),
124
+ end = null;
125
+ callback();
126
+ end = new Date();
127
+ this.addResult(start, end);
128
+ }
129
+ return this.displayResults();
130
+ }
131
+ };
132
+
133
+ Riot.Formatters = {
134
+ HTML: function() {
135
+ function display(html) {
136
+ var results = document.getElementById('test-results');
137
+ results.innerHTML += html;
138
+ }
139
+
140
+ this.line = function(text) {
141
+ display('<p>' + text + '</p>');
142
+ };
143
+
144
+ this.pass = function(message) {
145
+ display('<p class="pass">' + message + '</p>');
146
+ };
147
+
148
+ this.fail = function(message) {
149
+ display('<p class="fail">' + message + '</p>');
150
+ };
151
+
152
+ this.error = function(message, exception) {
153
+ this.fail(message);
154
+ display('<p class="exception">Exception: ' + exception + '</p>');
155
+ };
156
+
157
+ this.context = function(name) {
158
+ display('<h3>' + name + '</h3>');
159
+ };
160
+
161
+ this.separator = function() {
162
+ display('<hr />');
163
+ };
164
+ },
165
+
166
+ Text: function() {
167
+ function display(text) {
168
+ print(text);
169
+ }
170
+
171
+ this.line = function(text) {
172
+ display(text);
173
+ };
174
+
175
+ this.pass = function(message) {
176
+ this.line(' + ' + message + '');
177
+ };
178
+
179
+ this.fail = function(message) {
180
+ this.line(' - ' + message + '');
181
+ };
182
+
183
+ this.error = function(message, exception) {
184
+ this.fail(message);
185
+ this.line(' Exception: ' + exception);
186
+ };
187
+
188
+ this.context = function(name) {
189
+ this.line(name);
190
+ };
191
+
192
+ this.separator = function() {
193
+ this.line('');
194
+ };
195
+ },
196
+
197
+ XPComCore: function() {
198
+ var formatter = new Riot.Formatters.Text();
199
+ formatter.line = function(text) {
200
+ puts(text);
201
+ };
202
+ return formatter;
203
+ }
204
+ };
205
+
206
+ Riot.Context = function(name, callback) {
207
+ this.name = name;
208
+ this.callback = callback;
209
+ this.assertions = [];
210
+ this.should = this.asserts;
211
+ };
212
+
213
+ Riot.Context.prototype = {
214
+ asserts: function(name, result) {
215
+ var assertion = new Riot.Assertion(this.name, name, result);
216
+ this.assertions.push(assertion);
217
+ return assertion;
218
+ },
219
+
220
+ setup: function(setupFunction) {
221
+ this.setupFunction = setupFunction;
222
+ },
223
+
224
+ teardown: function(teardownFunction) {
225
+ this.teardownFunction = teardownFunction;
226
+ },
227
+
228
+ runSetup: function() {
229
+ if (typeof this.setupFunction !== 'undefined') {
230
+ return this.setupFunction();
231
+ }
232
+ },
233
+
234
+ runTeardown: function() {
235
+ if (typeof this.teardownFunction !== 'undefined') {
236
+ return this.teardownFunction();
237
+ }
238
+ },
239
+
240
+ run: function() {
241
+ Riot.formatter.context(this.name);
242
+ Riot.withDSL(this.callback, this)();
243
+ this.runSetup();
244
+ for (var i = 0; i < this.assertions.length; i++) {
245
+ var pass = false,
246
+ assertion = this.assertions[i];
247
+ try {
248
+ assertion.run();
249
+ pass = true;
250
+ Riot.formatter.pass(assertion.name);
251
+ } catch (e) {
252
+ if (typeof e.name !== 'undefined' && e.name === 'Riot.AssertionFailure') {
253
+ Riot.formatter.fail(e.message);
254
+ } else {
255
+ Riot.formatter.error(assertion.name, e);
256
+ }
257
+ }
258
+
259
+ Riot.addResult(this.name, assertion.name, pass);
260
+ }
261
+ this.runTeardown();
262
+ }
263
+ };
264
+
265
+ Riot.AssertionFailure = function(message) {
266
+ var error = new Error(message);
267
+ error.name = 'Riot.AssertionFailure';
268
+ return error;
269
+ };
270
+
271
+ Riot.Assertion = function(contextName, name, expected) {
272
+ this.name = name;
273
+ this.expectedValue = expected;
274
+ this.contextName = contextName;
275
+ this.kindOf = this.typeOf;
276
+ this.isTypeOf = this.typeOf;
277
+
278
+ this.setAssertion(function(actual) {
279
+ if ((actual() === null) || (actual() === undefined)) {
280
+ throw(new Riot.AssertionFailure("Expected a value but got '" + actual() + "'"));
281
+ }
282
+ });
283
+ };
284
+
285
+ Riot.Assertion.prototype = {
286
+ setAssertion: function(assertion) {
287
+ this.assertion = assertion;
288
+ },
289
+
290
+ run: function() {
291
+ var that = this;
292
+ this.assertion(function() { return that.expected(); });
293
+ },
294
+
295
+ fail: function(message) {
296
+ throw(new Riot.AssertionFailure(message));
297
+ },
298
+
299
+ expected: function() {
300
+ if (typeof this.expectedMemo === 'undefined') {
301
+ if (typeof this.expectedValue === 'function') {
302
+ try {
303
+ this.expectedMemo = this.expectedValue();
304
+ } catch (exception) {
305
+ this.expectedValue = exception;
306
+ }
307
+ } else {
308
+ this.expectedMemo = this.expectedValue;
309
+ }
310
+ }
311
+ return this.expectedMemo;
312
+ },
313
+
314
+ /* Assertions */
315
+ equals: function(expected) {
316
+ this.setAssertion(function(actual) {
317
+ if (actual() !== expected) {
318
+ this.fail(expected + ' does not equal: ' + actual());
319
+ }
320
+ });
321
+ },
322
+
323
+ matches: function(expected) {
324
+ this.setAssertion(function(actual) {
325
+ if (!expected.test(actual())) {
326
+ this.fail("Expected '" + actual() + "' to match '" + expected + "'");
327
+ }
328
+ });
329
+ },
330
+
331
+ raises: function(expected) {
332
+ this.setAssertion(function(actual) {
333
+ try {
334
+ actual();
335
+ return;
336
+ } catch (exception) {
337
+ if (expected !== exception) {
338
+ this.fail('raised ' + exception + ' instead of ' + expected);
339
+ }
340
+ }
341
+ this.fail('did not raise ' + expected);
342
+ });
343
+ },
344
+
345
+ typeOf: function(expected) {
346
+ this.setAssertion(function(actual) {
347
+ var t = typeof actual();
348
+ if (t === 'object') {
349
+ if (actual()) {
350
+ if (typeof actual().length === 'number' &&
351
+ !(actual.propertyIsEnumerable('length')) &&
352
+ typeof actual().splice === 'function') {
353
+ t = 'array';
354
+ }
355
+ } else {
356
+ t = 'null';
357
+ }
358
+ }
359
+
360
+ if (t !== expected.toLowerCase()) {
361
+ this.fail(expected + ' is not a type of ' + actual());
362
+ }
363
+ });
364
+ },
365
+
366
+ isTrue: function() {
367
+ this.setAssertion(function(actual) {
368
+ if (actual() !== true) {
369
+ this.fail(actual() + ' was not true');
370
+ }
371
+ });
372
+ },
373
+
374
+ isNull: function() {
375
+ this.setAssertion(function(actual) {
376
+ if (actual() !== null) {
377
+ this.fail(actual() + ' was not null');
378
+ }
379
+ });
380
+ }
381
+ };
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riot-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ggironda
@@ -9,10 +9,29 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-06 00:00:00 -05:00
12
+ date: 2009-10-24 00:00:00 -05:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: xpcomcore-rubygem
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: jsdoc-toolkit
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
16
35
  description: JS version of the Riot testing framework
17
36
  email: gabriel.gironda@gmail.com
18
37
  executables: []
@@ -25,10 +44,18 @@ extra_rdoc_files:
25
44
  files:
26
45
  - .document
27
46
  - .gitignore
47
+ - .gitmodules
28
48
  - LICENSE
29
49
  - README.rdoc
30
50
  - Rakefile
31
51
  - VERSION
52
+ - lib/riotjs.rb
53
+ - riotjs.gemspec
54
+ - xpcomcore/doc/files.html
55
+ - xpcomcore/doc/index.html
56
+ - xpcomcore/doc/symbols/_global_.html
57
+ - xpcomcore/doc/symbols/src/xpcomcore_lib_riot.js.html
58
+ - xpcomcore/lib/riot.js
32
59
  has_rdoc: true
33
60
  homepage: http://github.com/gabrielg/riot-js
34
61
  licenses: []