elabs_matchers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +38 -34
- data/README.md +103 -0
- data/doc/Cucumber.html +116 -0
- data/doc/ElabsMatchers/Cucumber/Common.html +145 -0
- data/doc/ElabsMatchers/Cucumber.html +108 -0
- data/doc/ElabsMatchers/Helpers/Capybara.html +241 -0
- data/doc/ElabsMatchers/Helpers/Common.html +213 -0
- data/doc/ElabsMatchers/Helpers/Fixtures.html +201 -0
- data/doc/ElabsMatchers/Helpers/Orm.html +289 -0
- data/doc/ElabsMatchers/Helpers/Session.html +497 -0
- data/doc/ElabsMatchers/Helpers.html +110 -0
- data/doc/ElabsMatchers/Matchers/Capybara/Common.html +1159 -0
- data/doc/ElabsMatchers/Matchers/Capybara.html +38 -11
- data/doc/ElabsMatchers/Matchers/Rspec/Allow.html +98 -0
- data/doc/ElabsMatchers/Matchers/Rspec/Common.html +332 -0
- data/doc/ElabsMatchers/Matchers/Rspec/Orm.html +231 -0
- data/doc/ElabsMatchers/Matchers/Rspec.html +41 -12
- data/doc/ElabsMatchers/Matchers.html +30 -13
- data/doc/ElabsMatchers/Orm/Post.html +1041 -0
- data/doc/ElabsMatchers/Orm.html +108 -0
- data/doc/ElabsMatchers.html +31 -15
- data/doc/_index.html +179 -12
- data/doc/class_list.html +21 -10
- data/doc/css/full_list.css +2 -0
- data/doc/css/style.css +19 -15
- data/doc/file.README.html +129 -48
- data/doc/file_list.html +20 -9
- data/doc/frames.html +1 -1
- data/doc/index.html +129 -48
- data/doc/js/app.js +20 -18
- data/doc/js/full_list.js +36 -12
- data/doc/js/jquery.js +3 -3
- data/doc/method_list.html +308 -9
- data/doc/top-level-namespace.html +115 -12
- data/elabs_matchers.gemspec +3 -1
- data/lib/elabs_matchers/cucumber/common.rb +2 -4
- data/lib/elabs_matchers/helpers/common.rb +3 -1
- data/lib/elabs_matchers/helpers/session.rb +61 -6
- data/lib/elabs_matchers/matchers/capybara/common.rb +58 -13
- data/lib/elabs_matchers/matchers/rspec/allow.rb +112 -0
- data/lib/elabs_matchers/orm/post.rb +18 -3
- data/lib/elabs_matchers/version.rb +1 -1
- data/spec/elabs_matchers/helpers/session_spec.rb +35 -0
- data/spec/elabs_matchers/matchers/capybara/common_spec.rb +1 -1
- data/spec/elabs_matchers/matchers/rspec/allow_spec.rb +80 -0
- data/spec/elabs_matchers/matchers/rspec/orm_spec.rb +3 -3
- data/spec/spec_helper.rb +10 -1
- metadata +109 -101
- data/.rvmrc +0 -1
- data/README.rdoc +0 -45
data/doc/file.README.html
CHANGED
@@ -2,17 +2,27 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
6
|
-
<title>
|
7
|
-
|
8
|
-
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
16
|
|
10
17
|
<script type="text/javascript" charset="utf-8">
|
11
18
|
relpath = '';
|
12
19
|
if (relpath != '') relpath += '/';
|
13
20
|
</script>
|
14
|
-
|
15
|
-
<script type="text/javascript" charset="utf-8" src="js/
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
16
26
|
|
17
27
|
</head>
|
18
28
|
<body>
|
@@ -31,71 +41,142 @@
|
|
31
41
|
</div>
|
32
42
|
|
33
43
|
<div id="search">
|
34
|
-
|
35
|
-
|
36
|
-
|
44
|
+
|
45
|
+
<a id="class_list_link" href="#">Class List</a>
|
46
|
+
|
47
|
+
<a id="method_list_link" href="#">Method List</a>
|
48
|
+
|
49
|
+
<a id="file_list_link" href="#">File List</a>
|
50
|
+
|
37
51
|
</div>
|
38
|
-
|
39
52
|
<div class="clear"></div>
|
40
53
|
</div>
|
41
54
|
|
42
55
|
<iframe id="search_frame"></iframe>
|
43
56
|
|
44
57
|
<div id="content"><div id='filecontents'><h1>Elabs matchers</h1>
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
|
54
|
-
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
</
|
58
|
+
|
59
|
+
<p><a href="http://travis-ci.org/elabs/elabs_matchers"><img src="https://secure.travis-ci.org/elabs/elabs_matchers.png" alt="Build Status"></a></p>
|
60
|
+
|
61
|
+
<p>Elabs matchers aims to extend existing rspec matchers from e.g Rspec, Rspec-rails and Capybara with a set
|
62
|
+
of less generic once. This could be things like asserting a table appearing in a certain way or check that
|
63
|
+
an active record instance has been successfully persisted after an update.</p>
|
64
|
+
|
65
|
+
<p>Below follows a list of matchers that the gem bundles. To get documentation about each matcher the source code is
|
66
|
+
your bast friend at this point.</p>
|
67
|
+
|
68
|
+
<h3>Model matchers:</h3>
|
69
|
+
|
70
|
+
<ul>
|
71
|
+
<li>hash.contain_hash({ "baz" => "bar" })</li>
|
72
|
+
<li>array.only_include("bar", "foo")</li>
|
73
|
+
<li>record.should persist(:title, "Blog post")</li>
|
74
|
+
<li>record.should allow("Blog post").as(:title)</li>
|
75
|
+
</ul>
|
76
|
+
|
77
|
+
<h3>Model helpers:</h3>
|
78
|
+
|
79
|
+
<ul>
|
80
|
+
<li>reload(post)</li>
|
81
|
+
<li>save_and_reload(post)</li>
|
82
|
+
</ul>
|
83
|
+
|
84
|
+
<h3>Acceptance matchers:</h3>
|
85
|
+
|
86
|
+
<ul>
|
87
|
+
<li>page.should have_options(["Yes", "No"])</li>
|
88
|
+
<li>page.should have_table_row('Posts', "Title" => "First", :year => "2012")</li>
|
89
|
+
<li>page.should have_attribute("Status", "Pending")</li>
|
90
|
+
<li>page.should have_image("Logo")</li>
|
91
|
+
<li>page.should have_header("Elabs")</li>
|
92
|
+
<li>page.should have_flash_notice("Success")</li>
|
93
|
+
<li>page.should have_flash_alert("Error")</li>
|
94
|
+
<li>page.should have_form_errors_on("Name", "Can't be blank")</li>
|
95
|
+
<li>page.should have_fields("Author" => "Adam", "Year" => "2011")</li>
|
96
|
+
</ul>
|
97
|
+
|
98
|
+
<h3>Acceptance helpers:</h3>
|
99
|
+
|
100
|
+
<ul>
|
101
|
+
<li>select_year_and_month("2010", "March", :from => "Birth date")</li>
|
102
|
+
<li>sign_in_as(user)</li>
|
103
|
+
<li>sign_out</li>
|
104
|
+
</ul>
|
105
|
+
|
106
|
+
<h3>Common helpers:</h3>
|
107
|
+
|
108
|
+
<ul>
|
109
|
+
<li>select_year_and_month("2010", "March", :from => "Birth date")</li>
|
110
|
+
<li>normalize_keys({ "First name" => "Adam" })</li>
|
111
|
+
<li>fixture_file("file.txt")</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
<h2>Setup</h2>
|
115
|
+
|
116
|
+
<p>add elabs_matchers to your Gemfile:</p>
|
117
|
+
|
118
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span>
|
119
|
+
</code></pre>
|
120
|
+
|
121
|
+
<p>if you're using Spork gem you need to tell bundler not to require the files for you:</p>
|
122
|
+
|
123
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:require</span> <span class='op'>=></span> <span class='kw'>false</span>
|
124
|
+
</code></pre>
|
125
|
+
|
126
|
+
<p>then you'll require them inside your spork prefork block:</p>
|
127
|
+
|
128
|
+
<pre class="code ruby"><code>Spork.prefork do
|
129
|
+
...
|
130
|
+
require 'elabs_matchers'
|
131
|
+
...
|
132
|
+
end
|
133
|
+
</code></pre>
|
134
|
+
|
135
|
+
<h2>Development</h2>
|
136
|
+
|
137
|
+
<pre class="code bash"><code>bundle exec rake
|
138
|
+
</code></pre>
|
139
|
+
|
140
|
+
<p>should run all the gem's specs.</p>
|
141
|
+
|
61
142
|
<h2>TODOS</h2>
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
</
|
143
|
+
|
144
|
+
<ul>
|
145
|
+
<li>Make yard document rspec matchers</li>
|
146
|
+
<li>Use matcher with RSpec::Matchers:DSL</li>
|
147
|
+
<li>Add contributors</li>
|
148
|
+
</ul>
|
149
|
+
|
68
150
|
<h2>License:</h2>
|
69
|
-
<pre class="code">
|
70
|
-
<span class='lparen token'>(</span><span class='The constant id'>The</span> <span class='MIT constant id'>MIT</span> <span class='License constant id'>License</span><span class='rparen token'>)</span>
|
71
151
|
|
72
|
-
|
152
|
+
<p>(The MIT License)</p>
|
153
|
+
|
154
|
+
<p>Copyright (c) 2012 Elabs AB</p>
|
73
155
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
156
|
+
<p>Permission is hereby granted, free of charge, to any person obtaining
|
157
|
+
a copy of this software and associated documentation files (the
|
158
|
+
'Software'), to deal in the Software without restriction, including
|
159
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
160
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
79
161
|
permit persons to whom the Software is furnished to do so, subject to
|
80
|
-
the following conditions
|
162
|
+
the following conditions:</p>
|
81
163
|
|
82
|
-
|
83
|
-
included in all copies or substantial portions of the Software
|
164
|
+
<p>The above copyright notice and this permission notice shall be
|
165
|
+
included in all copies or substantial portions of the Software.</p>
|
84
166
|
|
85
|
-
|
167
|
+
<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
86
168
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
87
169
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
88
170
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
89
171
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
90
172
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
91
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
|
92
|
-
</span></pre>
|
173
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
93
174
|
</div></div>
|
94
175
|
|
95
176
|
<div id="footer">
|
96
|
-
Generated on
|
177
|
+
Generated on Fri Feb 17 16:29:16 2012 by
|
97
178
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
98
|
-
0.
|
179
|
+
0.7.5 (ruby-1.9.3).
|
99
180
|
</div>
|
100
181
|
|
101
182
|
</body>
|
data/doc/file_list.html
CHANGED
@@ -2,11 +2,19 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html>
|
4
4
|
<head>
|
5
|
-
<meta
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
10
18
|
<base id="base_target" target="_parent" />
|
11
19
|
</head>
|
12
20
|
<body>
|
@@ -19,9 +27,13 @@
|
|
19
27
|
<div id="content">
|
20
28
|
<h1 id="full_list_header">File List</h1>
|
21
29
|
<div id="nav">
|
22
|
-
|
23
|
-
|
24
|
-
|
30
|
+
|
31
|
+
<a target="_self" href="class_list.html">Classes</a>
|
32
|
+
|
33
|
+
<a target="_self" href="method_list.html">Methods</a>
|
34
|
+
|
35
|
+
<a target="_self" href="file_list.html">Files</a>
|
36
|
+
|
25
37
|
</div>
|
26
38
|
<div id="search">Search: <input type="text" /></div>
|
27
39
|
|
@@ -35,4 +47,3 @@
|
|
35
47
|
</div>
|
36
48
|
</body>
|
37
49
|
</html>
|
38
|
-
|
data/doc/frames.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
-
<title>Documentation by YARD 0.
|
7
|
+
<title>Documentation by YARD 0.7.5</title>
|
8
8
|
</head>
|
9
9
|
<frameset cols="20%,*">
|
10
10
|
<frame name="list" src="class_list.html" />
|
data/doc/index.html
CHANGED
@@ -2,17 +2,27 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
6
|
-
<title>
|
7
|
-
|
8
|
-
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
16
|
|
10
17
|
<script type="text/javascript" charset="utf-8">
|
11
18
|
relpath = '';
|
12
19
|
if (relpath != '') relpath += '/';
|
13
20
|
</script>
|
14
|
-
|
15
|
-
<script type="text/javascript" charset="utf-8" src="js/
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
16
26
|
|
17
27
|
</head>
|
18
28
|
<body>
|
@@ -31,71 +41,142 @@
|
|
31
41
|
</div>
|
32
42
|
|
33
43
|
<div id="search">
|
34
|
-
|
35
|
-
|
36
|
-
|
44
|
+
|
45
|
+
<a id="class_list_link" href="#">Class List</a>
|
46
|
+
|
47
|
+
<a id="method_list_link" href="#">Method List</a>
|
48
|
+
|
49
|
+
<a id="file_list_link" href="#">File List</a>
|
50
|
+
|
37
51
|
</div>
|
38
|
-
|
39
52
|
<div class="clear"></div>
|
40
53
|
</div>
|
41
54
|
|
42
55
|
<iframe id="search_frame"></iframe>
|
43
56
|
|
44
57
|
<div id="content"><div id='filecontents'><h1>Elabs matchers</h1>
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
|
54
|
-
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
</
|
58
|
+
|
59
|
+
<p><a href="http://travis-ci.org/elabs/elabs_matchers"><img src="https://secure.travis-ci.org/elabs/elabs_matchers.png" alt="Build Status"></a></p>
|
60
|
+
|
61
|
+
<p>Elabs matchers aims to extend existing rspec matchers from e.g Rspec, Rspec-rails and Capybara with a set
|
62
|
+
of less generic once. This could be things like asserting a table appearing in a certain way or check that
|
63
|
+
an active record instance has been successfully persisted after an update.</p>
|
64
|
+
|
65
|
+
<p>Below follows a list of matchers that the gem bundles. To get documentation about each matcher the source code is
|
66
|
+
your bast friend at this point.</p>
|
67
|
+
|
68
|
+
<h3>Model matchers:</h3>
|
69
|
+
|
70
|
+
<ul>
|
71
|
+
<li>hash.contain_hash({ "baz" => "bar" })</li>
|
72
|
+
<li>array.only_include("bar", "foo")</li>
|
73
|
+
<li>record.should persist(:title, "Blog post")</li>
|
74
|
+
<li>record.should allow("Blog post").as(:title)</li>
|
75
|
+
</ul>
|
76
|
+
|
77
|
+
<h3>Model helpers:</h3>
|
78
|
+
|
79
|
+
<ul>
|
80
|
+
<li>reload(post)</li>
|
81
|
+
<li>save_and_reload(post)</li>
|
82
|
+
</ul>
|
83
|
+
|
84
|
+
<h3>Acceptance matchers:</h3>
|
85
|
+
|
86
|
+
<ul>
|
87
|
+
<li>page.should have_options(["Yes", "No"])</li>
|
88
|
+
<li>page.should have_table_row('Posts', "Title" => "First", :year => "2012")</li>
|
89
|
+
<li>page.should have_attribute("Status", "Pending")</li>
|
90
|
+
<li>page.should have_image("Logo")</li>
|
91
|
+
<li>page.should have_header("Elabs")</li>
|
92
|
+
<li>page.should have_flash_notice("Success")</li>
|
93
|
+
<li>page.should have_flash_alert("Error")</li>
|
94
|
+
<li>page.should have_form_errors_on("Name", "Can't be blank")</li>
|
95
|
+
<li>page.should have_fields("Author" => "Adam", "Year" => "2011")</li>
|
96
|
+
</ul>
|
97
|
+
|
98
|
+
<h3>Acceptance helpers:</h3>
|
99
|
+
|
100
|
+
<ul>
|
101
|
+
<li>select_year_and_month("2010", "March", :from => "Birth date")</li>
|
102
|
+
<li>sign_in_as(user)</li>
|
103
|
+
<li>sign_out</li>
|
104
|
+
</ul>
|
105
|
+
|
106
|
+
<h3>Common helpers:</h3>
|
107
|
+
|
108
|
+
<ul>
|
109
|
+
<li>select_year_and_month("2010", "March", :from => "Birth date")</li>
|
110
|
+
<li>normalize_keys({ "First name" => "Adam" })</li>
|
111
|
+
<li>fixture_file("file.txt")</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
<h2>Setup</h2>
|
115
|
+
|
116
|
+
<p>add elabs_matchers to your Gemfile:</p>
|
117
|
+
|
118
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span>
|
119
|
+
</code></pre>
|
120
|
+
|
121
|
+
<p>if you're using Spork gem you need to tell bundler not to require the files for you:</p>
|
122
|
+
|
123
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:require</span> <span class='op'>=></span> <span class='kw'>false</span>
|
124
|
+
</code></pre>
|
125
|
+
|
126
|
+
<p>then you'll require them inside your spork prefork block:</p>
|
127
|
+
|
128
|
+
<pre class="code ruby"><code>Spork.prefork do
|
129
|
+
...
|
130
|
+
require 'elabs_matchers'
|
131
|
+
...
|
132
|
+
end
|
133
|
+
</code></pre>
|
134
|
+
|
135
|
+
<h2>Development</h2>
|
136
|
+
|
137
|
+
<pre class="code bash"><code>bundle exec rake
|
138
|
+
</code></pre>
|
139
|
+
|
140
|
+
<p>should run all the gem's specs.</p>
|
141
|
+
|
61
142
|
<h2>TODOS</h2>
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
</
|
143
|
+
|
144
|
+
<ul>
|
145
|
+
<li>Make yard document rspec matchers</li>
|
146
|
+
<li>Use matcher with RSpec::Matchers:DSL</li>
|
147
|
+
<li>Add contributors</li>
|
148
|
+
</ul>
|
149
|
+
|
68
150
|
<h2>License:</h2>
|
69
|
-
<pre class="code">
|
70
|
-
<span class='lparen token'>(</span><span class='The constant id'>The</span> <span class='MIT constant id'>MIT</span> <span class='License constant id'>License</span><span class='rparen token'>)</span>
|
71
151
|
|
72
|
-
|
152
|
+
<p>(The MIT License)</p>
|
153
|
+
|
154
|
+
<p>Copyright (c) 2012 Elabs AB</p>
|
73
155
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
156
|
+
<p>Permission is hereby granted, free of charge, to any person obtaining
|
157
|
+
a copy of this software and associated documentation files (the
|
158
|
+
'Software'), to deal in the Software without restriction, including
|
159
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
160
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
79
161
|
permit persons to whom the Software is furnished to do so, subject to
|
80
|
-
the following conditions
|
162
|
+
the following conditions:</p>
|
81
163
|
|
82
|
-
|
83
|
-
included in all copies or substantial portions of the Software
|
164
|
+
<p>The above copyright notice and this permission notice shall be
|
165
|
+
included in all copies or substantial portions of the Software.</p>
|
84
166
|
|
85
|
-
|
167
|
+
<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
86
168
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
87
169
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
88
170
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
89
171
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
90
172
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
91
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
|
92
|
-
</span></pre>
|
173
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
93
174
|
</div></div>
|
94
175
|
|
95
176
|
<div id="footer">
|
96
|
-
Generated on
|
177
|
+
Generated on Fri Feb 17 16:29:16 2012 by
|
97
178
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
98
|
-
0.
|
179
|
+
0.7.5 (ruby-1.9.3).
|
99
180
|
</div>
|
100
181
|
|
101
182
|
</body>
|
data/doc/js/app.js
CHANGED
@@ -2,11 +2,11 @@ function createSourceLinks() {
|
|
2
2
|
$('.method_details_list .source_code').
|
3
3
|
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
4
4
|
$('.toggleSource').toggle(function() {
|
5
|
-
$(this).parent().
|
5
|
+
$(this).parent().nextAll('.source_code').slideDown(100);
|
6
6
|
$(this).text("Hide source");
|
7
7
|
},
|
8
8
|
function() {
|
9
|
-
$(this).parent().
|
9
|
+
$(this).parent().nextAll('.source_code').slideUp(100);
|
10
10
|
$(this).text("View source");
|
11
11
|
});
|
12
12
|
}
|
@@ -23,7 +23,7 @@ function createDefineLinks() {
|
|
23
23
|
function() {
|
24
24
|
$(this).prev().hide();
|
25
25
|
$(this).parent().prev().height(tHeight);
|
26
|
-
$(this).text("more...")
|
26
|
+
$(this).text("more...");
|
27
27
|
});
|
28
28
|
}
|
29
29
|
|
@@ -38,7 +38,7 @@ function createFullTreeLinks() {
|
|
38
38
|
function() {
|
39
39
|
$(this).parent().toggleClass('showAll');
|
40
40
|
$(this).parent().prev().height(tHeight);
|
41
|
-
$(this).text("show all")
|
41
|
+
$(this).text("show all");
|
42
42
|
});
|
43
43
|
}
|
44
44
|
|
@@ -93,13 +93,14 @@ function keyboardShortcuts() {
|
|
93
93
|
if (window.top.frames.main) return;
|
94
94
|
$(document).keypress(function(evt) {
|
95
95
|
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
|
96
|
-
if (typeof evt.
|
97
|
-
(evt.
|
98
|
-
evt.
|
96
|
+
if (typeof evt.target !== "undefined" &&
|
97
|
+
(evt.target.nodeName == "INPUT" ||
|
98
|
+
evt.target.nodeName == "TEXTAREA")) return;
|
99
99
|
switch (evt.charCode) {
|
100
100
|
case 67: case 99: $('#class_list_link').click(); break; // 'c'
|
101
101
|
case 77: case 109: $('#method_list_link').click(); break; // 'm'
|
102
102
|
case 70: case 102: $('#file_list_link').click(); break; // 'f'
|
103
|
+
default: break;
|
103
104
|
}
|
104
105
|
});
|
105
106
|
}
|
@@ -108,10 +109,10 @@ function summaryToggle() {
|
|
108
109
|
$('.summary_toggle').click(function() {
|
109
110
|
localStorage.summaryCollapsed = $(this).text();
|
110
111
|
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
111
|
-
var next = $(this).parent().parent().
|
112
|
+
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
112
113
|
if (next.hasClass('compact')) {
|
113
114
|
next.toggle();
|
114
|
-
next.
|
115
|
+
next.nextAll('ul.summary').first().toggle();
|
115
116
|
}
|
116
117
|
else if (next.hasClass('summary')) {
|
117
118
|
var list = $('<ul class="summary compact" />');
|
@@ -139,31 +140,32 @@ function fixOutsideWorldLinks() {
|
|
139
140
|
}
|
140
141
|
|
141
142
|
function generateTOC() {
|
142
|
-
if ($('#filecontents').length
|
143
|
+
if ($('#filecontents').length === 0) return;
|
143
144
|
var _toc = $('<ol class="top"></ol>');
|
144
145
|
var show = false;
|
145
146
|
var toc = _toc;
|
146
147
|
var counter = 0;
|
147
148
|
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
149
|
+
var i;
|
148
150
|
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
149
|
-
for (i
|
150
|
-
var lastTag = parseInt(tags[0][1]);
|
151
|
+
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
152
|
+
var lastTag = parseInt(tags[0][1], 10);
|
151
153
|
$(tags.join(', ')).each(function() {
|
152
154
|
if (this.id == "filecontents") return;
|
153
155
|
show = true;
|
154
|
-
var thisTag = parseInt(this.tagName[1]);
|
155
|
-
if (this.id.length
|
156
|
+
var thisTag = parseInt(this.tagName[1], 10);
|
157
|
+
if (this.id.length === 0) {
|
156
158
|
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
|
157
|
-
if ($('#' + proposedId).length > 0) proposedId += counter++;
|
159
|
+
if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
|
158
160
|
this.id = proposedId;
|
159
161
|
}
|
160
162
|
if (thisTag > lastTag) {
|
161
|
-
for (
|
163
|
+
for (i = 0; i < thisTag - lastTag; i++) {
|
162
164
|
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
|
163
165
|
}
|
164
166
|
}
|
165
167
|
if (thisTag < lastTag) {
|
166
|
-
for (
|
168
|
+
for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
|
167
169
|
}
|
168
170
|
toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
|
169
171
|
lastTag = thisTag;
|
@@ -185,7 +187,7 @@ function generateTOC() {
|
|
185
187
|
$(this).text('float');
|
186
188
|
$('#toc').toggleClass('nofloat');
|
187
189
|
}, function() {
|
188
|
-
$(this).text('left')
|
190
|
+
$(this).text('left');
|
189
191
|
$('#toc').toggleClass('nofloat');
|
190
192
|
});
|
191
193
|
}
|