Tamar 0.7.2 → 0.7.3
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.
- data/HISTORY +19 -2
- data/Rakefile +5 -0
- data/Tamar.gemspec +27 -2
- data/VERSION +1 -1
- data/src/luadist/CMakeLists.txt +42 -0
- data/src/luadist/COPYRIGHT +34 -0
- data/src/luadist/README +95 -0
- data/src/luadist/dist.cmake +436 -0
- data/src/luadist/dist.info +20 -0
- data/src/luadist/dist/config.lua.in +108 -0
- data/src/luadist/dist/dep.lua +283 -0
- data/src/luadist/dist/fetch.lua +234 -0
- data/src/luadist/dist/init.lua +616 -0
- data/src/luadist/dist/log.lua +37 -0
- data/src/luadist/dist/manifest.lua +204 -0
- data/src/luadist/dist/package.lua +271 -0
- data/src/luadist/dist/persist.lua +132 -0
- data/src/luadist/dist/sys.lua +436 -0
- data/src/luadist/doc/index.html +147 -0
- data/src/luadist/doc/luadoc.css +286 -0
- data/src/luadist/doc/modules/dist.dep.html +489 -0
- data/src/luadist/doc/modules/dist.fetch.html +197 -0
- data/src/luadist/doc/modules/dist.html +547 -0
- data/src/luadist/doc/modules/dist.log.html +187 -0
- data/src/luadist/doc/modules/dist.manifest.html +235 -0
- data/src/luadist/doc/modules/dist.package.html +323 -0
- data/src/luadist/doc/modules/dist.persist.html +345 -0
- data/src/luadist/doc/modules/dist.sys.html +1058 -0
- data/src/luadist/luadist +443 -0
- metadata +27 -2
@@ -0,0 +1,147 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>Reference</title>
|
6
|
+
<link rel="stylesheet" href="luadoc.css" type="text/css" />
|
7
|
+
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
|
8
|
+
</head>
|
9
|
+
|
10
|
+
<body>
|
11
|
+
<div id="container">
|
12
|
+
|
13
|
+
<div id="product">
|
14
|
+
<div id="product_logo"></div>
|
15
|
+
<div id="product_name"><big><b></b></big></div>
|
16
|
+
<div id="product_description"></div>
|
17
|
+
</div> <!-- id="product" -->
|
18
|
+
|
19
|
+
<div id="main">
|
20
|
+
|
21
|
+
<div id="navigation">
|
22
|
+
|
23
|
+
|
24
|
+
<h1>LuaDoc</h1>
|
25
|
+
<ul>
|
26
|
+
|
27
|
+
<li><strong>Index</strong></li>
|
28
|
+
|
29
|
+
</ul>
|
30
|
+
|
31
|
+
|
32
|
+
<!-- Module list -->
|
33
|
+
|
34
|
+
<h1>Modules</h1>
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li>
|
38
|
+
<a href="modules/dist.html">dist</a>
|
39
|
+
</li>
|
40
|
+
|
41
|
+
<li>
|
42
|
+
<a href="modules/dist.dep.html">dist.dep</a>
|
43
|
+
</li>
|
44
|
+
|
45
|
+
<li>
|
46
|
+
<a href="modules/dist.fetch.html">dist.fetch</a>
|
47
|
+
</li>
|
48
|
+
|
49
|
+
<li>
|
50
|
+
<a href="modules/dist.log.html">dist.log</a>
|
51
|
+
</li>
|
52
|
+
|
53
|
+
<li>
|
54
|
+
<a href="modules/dist.manifest.html">dist.manifest</a>
|
55
|
+
</li>
|
56
|
+
|
57
|
+
<li>
|
58
|
+
<a href="modules/dist.package.html">dist.package</a>
|
59
|
+
</li>
|
60
|
+
|
61
|
+
<li>
|
62
|
+
<a href="modules/dist.persist.html">dist.persist</a>
|
63
|
+
</li>
|
64
|
+
|
65
|
+
<li>
|
66
|
+
<a href="modules/dist.sys.html">dist.sys</a>
|
67
|
+
</li>
|
68
|
+
|
69
|
+
</ul>
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<!-- File list -->
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
</div> <!-- id="navigation" -->
|
81
|
+
|
82
|
+
<div id="content">
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<h2>Modules</h2>
|
87
|
+
<table class="module_list">
|
88
|
+
<!--<tr><td colspan="2">Modules</td></tr>-->
|
89
|
+
|
90
|
+
<tr>
|
91
|
+
<td class="name"><a href="modules/dist.html">dist</a></td>
|
92
|
+
<td class="summary">This file contains the basic functions of LuaDist.</td>
|
93
|
+
</tr>
|
94
|
+
|
95
|
+
<tr>
|
96
|
+
<td class="name"><a href="modules/dist.dep.html">dist.dep</a></td>
|
97
|
+
<td class="summary">Dependency handling functions.</td>
|
98
|
+
</tr>
|
99
|
+
|
100
|
+
<tr>
|
101
|
+
<td class="name"><a href="modules/dist.fetch.html">dist.fetch</a></td>
|
102
|
+
<td class="summary">This module is responsible for downloading contents using URIs.</td>
|
103
|
+
</tr>
|
104
|
+
|
105
|
+
<tr>
|
106
|
+
<td class="name"><a href="modules/dist.log.html">dist.log</a></td>
|
107
|
+
<td class="summary">Very simple log system.</td>
|
108
|
+
</tr>
|
109
|
+
|
110
|
+
<tr>
|
111
|
+
<td class="name"><a href="modules/dist.manifest.html">dist.manifest</a></td>
|
112
|
+
<td class="summary">The purpose of this module is to check and collect dist manifests.</td>
|
113
|
+
</tr>
|
114
|
+
|
115
|
+
<tr>
|
116
|
+
<td class="name"><a href="modules/dist.package.html">dist.package</a></td>
|
117
|
+
<td class="summary">Package handling functions.</td>
|
118
|
+
</tr>
|
119
|
+
|
120
|
+
<tr>
|
121
|
+
<td class="name"><a href="modules/dist.persist.html">dist.persist</a></td>
|
122
|
+
<td class="summary">Persistency table serializarion.</td>
|
123
|
+
</tr>
|
124
|
+
|
125
|
+
<tr>
|
126
|
+
<td class="name"><a href="modules/dist.sys.html">dist.sys</a></td>
|
127
|
+
<td class="summary">Host system dependent commands.</td>
|
128
|
+
</tr>
|
129
|
+
|
130
|
+
</table>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</div> <!-- id="content" -->
|
138
|
+
|
139
|
+
</div> <!-- id="main" -->
|
140
|
+
|
141
|
+
<div id="about">
|
142
|
+
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
|
143
|
+
</div> <!-- id="about" -->
|
144
|
+
|
145
|
+
</div> <!-- id="container" -->
|
146
|
+
</body>
|
147
|
+
</html>
|
@@ -0,0 +1,286 @@
|
|
1
|
+
body {
|
2
|
+
margin-left: 1em;
|
3
|
+
margin-right: 1em;
|
4
|
+
font-family: arial, helvetica, geneva, sans-serif;
|
5
|
+
background-color:#ffffff; margin:0px;
|
6
|
+
}
|
7
|
+
|
8
|
+
code {
|
9
|
+
font-family: "Andale Mono", monospace;
|
10
|
+
}
|
11
|
+
|
12
|
+
tt {
|
13
|
+
font-family: "Andale Mono", monospace;
|
14
|
+
}
|
15
|
+
|
16
|
+
body, td, th { font-size: 11pt; }
|
17
|
+
|
18
|
+
h1, h2, h3, h4 { margin-left: 0em; }
|
19
|
+
|
20
|
+
textarea, pre, tt { font-size:10pt; }
|
21
|
+
body, td, th { color:#000000; }
|
22
|
+
small { font-size:0.85em; }
|
23
|
+
h1 { font-size:1.5em; }
|
24
|
+
h2 { font-size:1.25em; }
|
25
|
+
h3 { font-size:1.15em; }
|
26
|
+
h4 { font-size:1.06em; }
|
27
|
+
|
28
|
+
a:link { font-weight:bold; color: #004080; text-decoration: none; }
|
29
|
+
a:visited { font-weight:bold; color: #006699; text-decoration: none; }
|
30
|
+
a:link:hover { text-decoration:underline; }
|
31
|
+
hr { color:#cccccc }
|
32
|
+
img { border-width: 0px; }
|
33
|
+
|
34
|
+
|
35
|
+
h3 { padding-top: 1em; }
|
36
|
+
|
37
|
+
p { margin-left: 1em; }
|
38
|
+
|
39
|
+
p.name {
|
40
|
+
font-family: "Andale Mono", monospace;
|
41
|
+
padding-top: 1em;
|
42
|
+
margin-left: 0em;
|
43
|
+
}
|
44
|
+
|
45
|
+
blockquote { margin-left: 3em; }
|
46
|
+
|
47
|
+
pre.example {
|
48
|
+
background-color: rgb(245, 245, 245);
|
49
|
+
border-top-width: 1px;
|
50
|
+
border-right-width: 1px;
|
51
|
+
border-bottom-width: 1px;
|
52
|
+
border-left-width: 1px;
|
53
|
+
border-top-style: solid;
|
54
|
+
border-right-style: solid;
|
55
|
+
border-bottom-style: solid;
|
56
|
+
border-left-style: solid;
|
57
|
+
border-top-color: silver;
|
58
|
+
border-right-color: silver;
|
59
|
+
border-bottom-color: silver;
|
60
|
+
border-left-color: silver;
|
61
|
+
padding: 1em;
|
62
|
+
margin-left: 1em;
|
63
|
+
margin-right: 1em;
|
64
|
+
font-family: "Andale Mono", monospace;
|
65
|
+
font-size: smaller;
|
66
|
+
}
|
67
|
+
|
68
|
+
|
69
|
+
hr {
|
70
|
+
margin-left: 0em;
|
71
|
+
background: #00007f;
|
72
|
+
border: 0px;
|
73
|
+
height: 1px;
|
74
|
+
}
|
75
|
+
|
76
|
+
ul { list-style-type: disc; }
|
77
|
+
|
78
|
+
table.index { border: 1px #00007f; }
|
79
|
+
table.index td { text-align: left; vertical-align: top; }
|
80
|
+
table.index ul { padding-top: 0em; margin-top: 0em; }
|
81
|
+
|
82
|
+
table {
|
83
|
+
border: 1px solid black;
|
84
|
+
border-collapse: collapse;
|
85
|
+
margin-left: auto;
|
86
|
+
margin-right: auto;
|
87
|
+
}
|
88
|
+
th {
|
89
|
+
border: 1px solid black;
|
90
|
+
padding: 0.5em;
|
91
|
+
}
|
92
|
+
td {
|
93
|
+
border: 1px solid black;
|
94
|
+
padding: 0.5em;
|
95
|
+
}
|
96
|
+
div.header, div.footer { margin-left: 0em; }
|
97
|
+
|
98
|
+
#container
|
99
|
+
{
|
100
|
+
margin-left: 1em;
|
101
|
+
margin-right: 1em;
|
102
|
+
background-color: #f0f0f0;
|
103
|
+
}
|
104
|
+
|
105
|
+
#product
|
106
|
+
{
|
107
|
+
text-align: center;
|
108
|
+
border-bottom: 1px solid #cccccc;
|
109
|
+
background-color: #ffffff;
|
110
|
+
}
|
111
|
+
|
112
|
+
#product big {
|
113
|
+
font-size: 2em;
|
114
|
+
}
|
115
|
+
|
116
|
+
#product_logo
|
117
|
+
{
|
118
|
+
}
|
119
|
+
|
120
|
+
#product_name
|
121
|
+
{
|
122
|
+
}
|
123
|
+
|
124
|
+
#product_description
|
125
|
+
{
|
126
|
+
}
|
127
|
+
|
128
|
+
#main
|
129
|
+
{
|
130
|
+
background-color: #f0f0f0;
|
131
|
+
border-left: 2px solid #cccccc;
|
132
|
+
}
|
133
|
+
|
134
|
+
#navigation
|
135
|
+
{
|
136
|
+
float: left;
|
137
|
+
width: 18em;
|
138
|
+
margin: 0;
|
139
|
+
vertical-align: top;
|
140
|
+
background-color: #f0f0f0;
|
141
|
+
overflow:visible;
|
142
|
+
}
|
143
|
+
|
144
|
+
#navigation h1 {
|
145
|
+
background-color:#e7e7e7;
|
146
|
+
font-size:1.1em;
|
147
|
+
color:#000000;
|
148
|
+
text-align:left;
|
149
|
+
margin:0px;
|
150
|
+
padding:0.2em;
|
151
|
+
border-top:1px solid #dddddd;
|
152
|
+
border-bottom:1px solid #dddddd;
|
153
|
+
}
|
154
|
+
|
155
|
+
#navigation ul
|
156
|
+
{
|
157
|
+
font-size:1em;
|
158
|
+
list-style-type: none;
|
159
|
+
padding: 0;
|
160
|
+
margin: 1px;
|
161
|
+
}
|
162
|
+
|
163
|
+
#navigation li
|
164
|
+
{
|
165
|
+
text-indent: -1em;
|
166
|
+
margin: 0em 0em 0em 0.5em;
|
167
|
+
display: block;
|
168
|
+
padding: 3px 0px 0px 12px;
|
169
|
+
}
|
170
|
+
|
171
|
+
#navigation li li a
|
172
|
+
{
|
173
|
+
padding: 0px 3px 0px -1em;
|
174
|
+
}
|
175
|
+
|
176
|
+
#content
|
177
|
+
{
|
178
|
+
margin-left: 18em;
|
179
|
+
padding: 1em;
|
180
|
+
border-left: 2px solid #cccccc;
|
181
|
+
border-right: 2px solid #cccccc;
|
182
|
+
background-color: #ffffff;
|
183
|
+
}
|
184
|
+
|
185
|
+
#about
|
186
|
+
{
|
187
|
+
clear: both;
|
188
|
+
margin: 0;
|
189
|
+
padding: 5px;
|
190
|
+
border-top: 2px solid #cccccc;
|
191
|
+
background-color: #ffffff;
|
192
|
+
}
|
193
|
+
|
194
|
+
@media print {
|
195
|
+
body {
|
196
|
+
font: 12pt "Times New Roman", "TimeNR", Times, serif;
|
197
|
+
}
|
198
|
+
a { font-weight:bold; color: #004080; text-decoration: underline; }
|
199
|
+
|
200
|
+
#main
|
201
|
+
#container
|
202
|
+
|
203
|
+
#content
|
204
|
+
|
205
|
+
#navigation
|
206
|
+
}
|
207
|
+
pre.example {
|
208
|
+
font-family: "Andale Mono", monospace;
|
209
|
+
font-size: 10pt;
|
210
|
+
page-break-inside: avoid;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
table.module_list td
|
215
|
+
{
|
216
|
+
border-width: 1px;
|
217
|
+
padding: 3px;
|
218
|
+
border-style: solid;
|
219
|
+
border-color: #cccccc;
|
220
|
+
}
|
221
|
+
table.module_list td.name { background-color: #f0f0f0; }
|
222
|
+
table.module_list td.summary { width: 100%; }
|
223
|
+
|
224
|
+
table.file_list
|
225
|
+
{
|
226
|
+
border-width: 1px;
|
227
|
+
border-style: solid;
|
228
|
+
border-color: #cccccc;
|
229
|
+
border-collapse: collapse;
|
230
|
+
}
|
231
|
+
table.file_list td
|
232
|
+
{
|
233
|
+
border-width: 1px;
|
234
|
+
padding: 3px;
|
235
|
+
border-style: solid;
|
236
|
+
border-color: #cccccc;
|
237
|
+
}
|
238
|
+
table.file_list td.name { background-color: #f0f0f0; }
|
239
|
+
table.file_list td.summary { width: 100%; }
|
240
|
+
|
241
|
+
|
242
|
+
table.function_list
|
243
|
+
{
|
244
|
+
border-width: 1px;
|
245
|
+
border-style: solid;
|
246
|
+
border-color: #cccccc;
|
247
|
+
border-collapse: collapse;
|
248
|
+
}
|
249
|
+
table.function_list td
|
250
|
+
{
|
251
|
+
border-width: 1px;
|
252
|
+
padding: 3px;
|
253
|
+
border-style: solid;
|
254
|
+
border-color: #cccccc;
|
255
|
+
}
|
256
|
+
table.function_list td.name { background-color: #f0f0f0; }
|
257
|
+
table.function_list td.summary { width: 100%; }
|
258
|
+
|
259
|
+
|
260
|
+
table.table_list
|
261
|
+
{
|
262
|
+
border-width: 1px;
|
263
|
+
border-style: solid;
|
264
|
+
border-color: #cccccc;
|
265
|
+
border-collapse: collapse;
|
266
|
+
}
|
267
|
+
table.table_list td
|
268
|
+
{
|
269
|
+
border-width: 1px;
|
270
|
+
padding: 3px;
|
271
|
+
border-style: solid;
|
272
|
+
border-color: #cccccc;
|
273
|
+
}
|
274
|
+
table.table_list td.name { background-color: #f0f0f0; }
|
275
|
+
table.table_list td.summary { width: 100%; }
|
276
|
+
|
277
|
+
dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
|
278
|
+
dl.function dd {padding-bottom: 1em;}
|
279
|
+
dl.function h3 {padding: 0; margin: 0; font-size: medium;}
|
280
|
+
|
281
|
+
dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;}
|
282
|
+
dl.table dd {padding-bottom: 1em;}
|
283
|
+
dl.table h3 {padding: 0; margin: 0; font-size: medium;}
|
284
|
+
|
285
|
+
#TODO: make module_list, file_list, function_list, table_list inherit from a list
|
286
|
+
|
@@ -0,0 +1,489 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>Reference</title>
|
6
|
+
<link rel="stylesheet" href="../luadoc.css" type="text/css" />
|
7
|
+
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
|
8
|
+
</head>
|
9
|
+
|
10
|
+
<body>
|
11
|
+
<div id="container">
|
12
|
+
|
13
|
+
<div id="product">
|
14
|
+
<div id="product_logo"></div>
|
15
|
+
<div id="product_name"><big><b></b></big></div>
|
16
|
+
<div id="product_description"></div>
|
17
|
+
</div> <!-- id="product" -->
|
18
|
+
|
19
|
+
<div id="main">
|
20
|
+
|
21
|
+
<div id="navigation">
|
22
|
+
|
23
|
+
|
24
|
+
<h1>LuaDoc</h1>
|
25
|
+
<ul>
|
26
|
+
|
27
|
+
<li><a href="../index.html">Index</a></li>
|
28
|
+
|
29
|
+
</ul>
|
30
|
+
|
31
|
+
|
32
|
+
<!-- Module list -->
|
33
|
+
|
34
|
+
<h1>Modules</h1>
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li>
|
38
|
+
<a href="../modules/dist.html">dist</a>
|
39
|
+
</li>
|
40
|
+
|
41
|
+
<li><strong>dist.dep</strong></li>
|
42
|
+
|
43
|
+
<li>
|
44
|
+
<a href="../modules/dist.fetch.html">dist.fetch</a>
|
45
|
+
</li>
|
46
|
+
|
47
|
+
<li>
|
48
|
+
<a href="../modules/dist.log.html">dist.log</a>
|
49
|
+
</li>
|
50
|
+
|
51
|
+
<li>
|
52
|
+
<a href="../modules/dist.manifest.html">dist.manifest</a>
|
53
|
+
</li>
|
54
|
+
|
55
|
+
<li>
|
56
|
+
<a href="../modules/dist.package.html">dist.package</a>
|
57
|
+
</li>
|
58
|
+
|
59
|
+
<li>
|
60
|
+
<a href="../modules/dist.persist.html">dist.persist</a>
|
61
|
+
</li>
|
62
|
+
|
63
|
+
<li>
|
64
|
+
<a href="../modules/dist.sys.html">dist.sys</a>
|
65
|
+
</li>
|
66
|
+
|
67
|
+
</ul>
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<!-- File list -->
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
</div><!-- id="navigation" -->
|
79
|
+
|
80
|
+
<div id="content">
|
81
|
+
|
82
|
+
<h1>Module <code>dist.dep</code></h1>
|
83
|
+
|
84
|
+
<p>Dependency handling functions. Dependencies are represented in LuaDist through strings with a dist name followed by a comma-separated list of constraints. Each constraint consists of an operator and a version number. In this string format, version numbers are represented as naturally as possible, like they are used by upstream projects (e.g. "2.0beta3"). Internally, LuaDist converts them to a purely numeric representation, allowing comparison following some "common sense" heuristics. The precise specification of the comparison criteria is the source code of this module, but the test/test_deps.lua file included with LuaDist provides some insights on what these criteria are.</p>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<h2>Functions</h2>
|
91
|
+
<table class="function_list">
|
92
|
+
|
93
|
+
<tr>
|
94
|
+
<td class="name" nowrap><a href="#__eq">__eq</a> (v1, v2)</td>
|
95
|
+
<td class="summary">Equality comparison for versions.</td>
|
96
|
+
</tr>
|
97
|
+
|
98
|
+
<tr>
|
99
|
+
<td class="name" nowrap><a href="#__lt">__lt</a> (v1, v2)</td>
|
100
|
+
<td class="summary">Size comparison for versions.</td>
|
101
|
+
</tr>
|
102
|
+
|
103
|
+
<tr>
|
104
|
+
<td class="name" nowrap><a href="#compareVersions">compareVersions</a> (a, b)</td>
|
105
|
+
<td class="summary">Utility function to compare version numbers given as strings.</td>
|
106
|
+
</tr>
|
107
|
+
|
108
|
+
<tr>
|
109
|
+
<td class="name" nowrap><a href="#constrain">constrain</a> (version, constraints)</td>
|
110
|
+
<td class="summary">Check if a version string is satisfied by a constraint string.</td>
|
111
|
+
</tr>
|
112
|
+
|
113
|
+
<tr>
|
114
|
+
<td class="name" nowrap><a href="#matchConstraints">matchConstraints</a> (version, constraints)</td>
|
115
|
+
<td class="summary">Check if a version satisfies a set of constraints.</td>
|
116
|
+
</tr>
|
117
|
+
|
118
|
+
<tr>
|
119
|
+
<td class="name" nowrap><a href="#parseConstraint">parseConstraint</a> (input)</td>
|
120
|
+
<td class="summary">Consumes a constraint from a string, converting it to table format.</td>
|
121
|
+
</tr>
|
122
|
+
|
123
|
+
<tr>
|
124
|
+
<td class="name" nowrap><a href="#parseConstraints">parseConstraints</a> (input)</td>
|
125
|
+
<td class="summary">Convert a list of constraints from string to table format.</td>
|
126
|
+
</tr>
|
127
|
+
|
128
|
+
<tr>
|
129
|
+
<td class="name" nowrap><a href="#parseVersion">parseVersion</a> (vstring)</td>
|
130
|
+
<td class="summary">Parse a version string, converting to table format.</td>
|
131
|
+
</tr>
|
132
|
+
|
133
|
+
<tr>
|
134
|
+
<td class="name" nowrap><a href="#partialMatch">partialMatch</a> (version, requested)</td>
|
135
|
+
<td class="summary">A more lenient check for equivalence between versions.</td>
|
136
|
+
</tr>
|
137
|
+
|
138
|
+
<tr>
|
139
|
+
<td class="name" nowrap><a href="#split">split</a> (name)</td>
|
140
|
+
<td class="summary">Split dist name into name and constraints.</td>
|
141
|
+
</tr>
|
142
|
+
|
143
|
+
</table>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<br/>
|
151
|
+
<br/>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<h2><a name="functions"></a>Functions</h2>
|
156
|
+
<dl class="function">
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<dt><a name="__eq"></a><strong>__eq</strong> (v1, v2)</dt>
|
161
|
+
<dd>
|
162
|
+
Equality comparison for versions. All version numbers must be equal. If both versions have revision numbers, they must be equal; otherwise the revision number is ignored.
|
163
|
+
|
164
|
+
|
165
|
+
<h3>Parameters</h3>
|
166
|
+
<ul>
|
167
|
+
|
168
|
+
<li>
|
169
|
+
v1: table: version table to compare.
|
170
|
+
</li>
|
171
|
+
|
172
|
+
<li>
|
173
|
+
v2: table: version table to compare.
|
174
|
+
</li>
|
175
|
+
|
176
|
+
</ul>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<h3>Return value:</h3>
|
184
|
+
boolean: true if they are considered equivalent.
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</dd>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<dt><a name="__lt"></a><strong>__lt</strong> (v1, v2)</dt>
|
194
|
+
<dd>
|
195
|
+
Size comparison for versions. All version numbers are compared. If both versions have revision numbers, they are compared; otherwise the revision number is ignored.
|
196
|
+
|
197
|
+
|
198
|
+
<h3>Parameters</h3>
|
199
|
+
<ul>
|
200
|
+
|
201
|
+
<li>
|
202
|
+
v1: table: version table to compare.
|
203
|
+
</li>
|
204
|
+
|
205
|
+
<li>
|
206
|
+
v2: table: version table to compare.
|
207
|
+
</li>
|
208
|
+
|
209
|
+
</ul>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<h3>Return value:</h3>
|
217
|
+
boolean: true if v1 is considered lower than v2.
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
</dd>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<dt><a name="compareVersions"></a><strong>compareVersions</strong> (a, b)</dt>
|
227
|
+
<dd>
|
228
|
+
Utility function to compare version numbers given as strings.
|
229
|
+
|
230
|
+
|
231
|
+
<h3>Parameters</h3>
|
232
|
+
<ul>
|
233
|
+
|
234
|
+
<li>
|
235
|
+
a: string: one version.
|
236
|
+
</li>
|
237
|
+
|
238
|
+
<li>
|
239
|
+
b: string: another version.
|
240
|
+
</li>
|
241
|
+
|
242
|
+
</ul>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<h3>Return value:</h3>
|
250
|
+
boolean: True if a > b.
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</dd>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<dt><a name="constrain"></a><strong>constrain</strong> (version, constraints)</dt>
|
260
|
+
<dd>
|
261
|
+
Check if a version string is satisfied by a constraint string.
|
262
|
+
|
263
|
+
|
264
|
+
<h3>Parameters</h3>
|
265
|
+
<ul>
|
266
|
+
|
267
|
+
<li>
|
268
|
+
version: string: A version in string format
|
269
|
+
</li>
|
270
|
+
|
271
|
+
<li>
|
272
|
+
constraints: string: Constraints in string format.
|
273
|
+
</li>
|
274
|
+
|
275
|
+
</ul>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<h3>Return value:</h3>
|
283
|
+
boolean: True if version satisfies all constraints, false otherwise.
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</dd>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<dt><a name="matchConstraints"></a><strong>matchConstraints</strong> (version, constraints)</dt>
|
293
|
+
<dd>
|
294
|
+
Check if a version satisfies a set of constraints.
|
295
|
+
|
296
|
+
|
297
|
+
<h3>Parameters</h3>
|
298
|
+
<ul>
|
299
|
+
|
300
|
+
<li>
|
301
|
+
version: table: A version in table format
|
302
|
+
</li>
|
303
|
+
|
304
|
+
<li>
|
305
|
+
constraints: table: An array of constraints in table format.
|
306
|
+
</li>
|
307
|
+
|
308
|
+
</ul>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<h3>Return value:</h3>
|
316
|
+
boolean: True if version satisfies all constraints, false otherwise.
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
</dd>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<dt><a name="parseConstraint"></a><strong>parseConstraint</strong> (input)</dt>
|
326
|
+
<dd>
|
327
|
+
Consumes a constraint from a string, converting it to table format. For example, a string ">= 1.0, > 2.0" is converted to a table in the format {op = ">=", version={1,0}} and the rest, "> 2.0", is returned back to the caller.
|
328
|
+
|
329
|
+
|
330
|
+
<h3>Parameters</h3>
|
331
|
+
<ul>
|
332
|
+
|
333
|
+
<li>
|
334
|
+
input: string: A list of constraints in string format.
|
335
|
+
</li>
|
336
|
+
|
337
|
+
</ul>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
<h3>Return value:</h3>
|
345
|
+
(table, string) or nil: A table representing the same constraints and the string with the unused input, or nil if the input string is invalid.
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
</dd>
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
<dt><a name="parseConstraints"></a><strong>parseConstraints</strong> (input)</dt>
|
355
|
+
<dd>
|
356
|
+
Convert a list of constraints from string to table format. For example, a string ">= 1.0, < 2.0" is converted to a table in the format {{op = ">=", version={1,0}}, {op = "<", version={2,0}}}. Version tables use a metatable allowing later comparison through relational operators.
|
357
|
+
|
358
|
+
|
359
|
+
<h3>Parameters</h3>
|
360
|
+
<ul>
|
361
|
+
|
362
|
+
<li>
|
363
|
+
input: string: A list of constraints in string format.
|
364
|
+
</li>
|
365
|
+
|
366
|
+
</ul>
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
<h3>Return value:</h3>
|
374
|
+
table or nil: A table representing the same constraints, or nil if the input string is invalid.
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
</dd>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
<dt><a name="parseVersion"></a><strong>parseVersion</strong> (vstring)</dt>
|
384
|
+
<dd>
|
385
|
+
Parse a version string, converting to table format. A version table contains all components of the version string converted to numeric format, stored in the array part of the table. If the version contains a revision, it is stored numerically in the 'revision' field. The original string representation of the string is preserved in the 'string' field. Returned version tables use a metatable allowing later comparison through relational operators.
|
386
|
+
|
387
|
+
|
388
|
+
<h3>Parameters</h3>
|
389
|
+
<ul>
|
390
|
+
|
391
|
+
<li>
|
392
|
+
vstring: string: A version number in string format.
|
393
|
+
</li>
|
394
|
+
|
395
|
+
</ul>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
<h3>Return value:</h3>
|
403
|
+
table or nil: A version table or nil if the input string contains invalid characters.
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
</dd>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
<dt><a name="partialMatch"></a><strong>partialMatch</strong> (version, requested)</dt>
|
413
|
+
<dd>
|
414
|
+
A more lenient check for equivalence between versions. This returns true if the requested components of a version match and ignore the ones that were not given. For example, when requesting "2", then "2", "2.1", "2.3.5-9"... all match. When requesting "2.1", then "2.1", "2.1.3" match, but "2.2" doesn't.
|
415
|
+
|
416
|
+
|
417
|
+
<h3>Parameters</h3>
|
418
|
+
<ul>
|
419
|
+
|
420
|
+
<li>
|
421
|
+
version: string or table: Version to be tested; may be in string format or already parsed into a table.
|
422
|
+
</li>
|
423
|
+
|
424
|
+
<li>
|
425
|
+
requested: string or table: Version requested; may be in string format or already parsed into a table.
|
426
|
+
</li>
|
427
|
+
|
428
|
+
</ul>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
<h3>Return value:</h3>
|
436
|
+
boolean: True if the tested version matches the requested version, false otherwise.
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
</dd>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
<dt><a name="split"></a><strong>split</strong> (name)</dt>
|
446
|
+
<dd>
|
447
|
+
Split dist name into name and constraints.
|
448
|
+
|
449
|
+
|
450
|
+
<h3>Parameters</h3>
|
451
|
+
<ul>
|
452
|
+
|
453
|
+
<li>
|
454
|
+
name: string: A string containing name and version constraints eg. "lua-5.1.4" or "luajit >= 1.0 < 2.0"
|
455
|
+
</li>
|
456
|
+
|
457
|
+
</ul>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
<h3>Return value:</h3>
|
465
|
+
string, string: Returns separated name and constraints
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
</dd>
|
470
|
+
|
471
|
+
|
472
|
+
</dl>
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</div> <!-- id="content" -->
|
480
|
+
|
481
|
+
</div> <!-- id="main" -->
|
482
|
+
|
483
|
+
<div id="about">
|
484
|
+
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
|
485
|
+
</div> <!-- id="about" -->
|
486
|
+
|
487
|
+
</div> <!-- id="container" -->
|
488
|
+
</body>
|
489
|
+
</html>
|