sdl4r 0.9.9 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +70 -1
- data/LICENSE +499 -497
- data/Rakefile +38 -28
- data/TODO +194 -45
- data/doc/classes/SDL4R/AbbreviationTimezoneProxy.html +151 -0
- data/doc/classes/SDL4R/ConstantTimezone.html +129 -0
- data/doc/classes/SDL4R/Element.html +148 -0
- data/doc/classes/SDL4R/Reader.html +683 -0
- data/doc/classes/SDL4R/RelativeTimezone.html +187 -0
- data/doc/classes/SDL4R/SdlBinary.html +188 -0
- data/doc/classes/SDL4R/SdlParseError.html +110 -0
- data/doc/classes/SDL4R/SdlTimeSpan.html +651 -0
- data/doc/classes/SDL4R/Serializer.html +557 -0
- data/doc/classes/SDL4R/Serializer/Ref.html +138 -0
- data/doc/classes/SDL4R/TZAbbreviationDB/Record.html +117 -0
- data/doc/classes/SDL4R/Tag.html +1274 -0
- data/doc/classes/SDL4R/Token.html +131 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGELOG.html +290 -0
- data/doc/files/LICENSE.html +53 -0
- data/doc/files/README.html +405 -0
- data/doc/files/lib/sdl4r/abbreviation_timezone_proxy_rb.html +63 -0
- data/doc/files/lib/sdl4r/constant_timezone_rb.html +54 -0
- data/doc/files/lib/sdl4r/element_rb.html +54 -0
- data/doc/files/lib/sdl4r/reader_rb.html +68 -0
- data/doc/files/lib/sdl4r/relative_timezone_rb.html +62 -0
- data/doc/files/lib/sdl4r/sdl4r_rb.html +66 -0
- data/doc/files/lib/sdl4r/sdl4r_tzinfo_rb.html +64 -0
- data/doc/files/lib/sdl4r/sdl4r_version_rb.html +54 -0
- data/doc/files/lib/sdl4r/sdl_binary_rb.html +54 -0
- data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +54 -0
- data/doc/files/lib/sdl4r/sdl_time_span_rb.html +54 -0
- data/doc/files/lib/sdl4r/serializer_rb.html +62 -0
- data/doc/files/lib/sdl4r/tag_rb.html +66 -0
- data/doc/files/lib/sdl4r/token_rb.html +54 -0
- data/doc/files/lib/sdl4r/tokenizer_rb.html +64 -0
- data/doc/files/lib/sdl4r/tz_abbreviation_db_rb.html +67 -0
- data/doc/files/lib/sdl4r_rb.html +54 -0
- data/doc/files/lib/sdl4r_tzinfo_rb.html +54 -0
- data/doc/fr_class_index.html +23 -0
- data/doc/fr_file_index.html +40 -0
- data/doc/fr_method_index.html +4711 -0
- data/doc/index.html +15 -0
- data/doc/rdoc-style.css +328 -0
- data/lib/sdl4r.rb +3 -1
- data/lib/sdl4r/abbreviation_timezone_proxy.rb +38 -0
- data/lib/sdl4r/constant_timezone.rb +58 -0
- data/{test/sdl4r/sdl_test.rb → lib/sdl4r/element.rb} +19 -14
- data/lib/sdl4r/reader.rb +772 -0
- data/lib/sdl4r/relative_timezone.rb +156 -0
- data/lib/sdl4r/sdl4r.rb +187 -45
- data/lib/sdl4r/sdl4r_tzinfo.rb +75 -0
- data/lib/sdl4r/sdl4r_version.rb +24 -0
- data/lib/sdl4r/sdl_parse_error.rb +1 -1
- data/lib/sdl4r/sdl_time_span.rb +5 -1
- data/lib/sdl4r/serializer.rb +473 -60
- data/lib/sdl4r/tag.rb +126 -51
- data/lib/sdl4r/token.rb +49 -0
- data/lib/sdl4r/tokenizer.rb +431 -0
- data/lib/sdl4r/tz_abbreviation_db.rb +266 -0
- data/read_jprof.html +16934 -0
- data/read_jprof_pull.html +14451 -0
- data/read_prof.html +4983 -0
- data/read_prof_pull.html +4896 -0
- data/test/sdl4r/parser_test.rb +577 -503
- data/test/sdl4r/read_jprof.rb +58 -0
- data/test/sdl4r/read_prof.rb +70 -0
- data/test/sdl4r/reader_test.rb +173 -0
- data/test/sdl4r/relative_timezone_test.rb +102 -0
- data/test/sdl4r/sdl4r_test.rb +611 -528
- data/test/sdl4r/sdl4r_tzinfo_test.rb +108 -0
- data/test/sdl4r/sdl_test_case.rb +60 -0
- data/test/sdl4r/serializer_test.rb +448 -11
- data/test/sdl4r/tag_test.rb +84 -5
- data/test/sdl4r/tokenizer_test.rb +128 -0
- metadata +69 -11
- data/lib/sdl4r/parser.rb +0 -648
- data/lib/sdl4r/parser/reader.rb +0 -184
- data/lib/sdl4r/parser/time_span_with_zone.rb +0 -57
- data/lib/sdl4r/parser/token.rb +0 -138
- data/lib/sdl4r/parser/tokenizer.rb +0 -507
@@ -0,0 +1,187 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: SDL4R::RelativeTimezone [RDoc: Simple Declarative Language for Ruby]</title>
|
5
|
+
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
SDL4R::RelativeTimezone
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/sdl4r/relative_timezone_rb.html">lib/sdl4r/relative_timezone.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>TZInfo::Timezone</strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
Represents a Timezone which is distant from a standard timezone by a fixed
|
47
|
+
offset.
|
48
|
+
</p>
|
49
|
+
</div>
|
50
|
+
<div id='method-list'>
|
51
|
+
<h2>Methods</h2>
|
52
|
+
<h3>public class</h3>
|
53
|
+
<ol>
|
54
|
+
<li><a href="#M000043">get</a></li>
|
55
|
+
<li><a href="#M000044">get_proxy</a></li>
|
56
|
+
<li><a href="#M000045">new</a></li>
|
57
|
+
</ol>
|
58
|
+
<h3>public instance</h3>
|
59
|
+
<ol>
|
60
|
+
<li><a href="#M000046">period_for_utc</a></li>
|
61
|
+
<li><a href="#M000047">periods_for_local</a></li>
|
62
|
+
</ol>
|
63
|
+
</div>
|
64
|
+
<div id='section'>
|
65
|
+
<div id='attribute-list'>
|
66
|
+
<h2 class='section-bar'>Attributes</h2>
|
67
|
+
<div class='name-list'>
|
68
|
+
<table>
|
69
|
+
<tr class='top-aligned-row context-row'>
|
70
|
+
<td class='context-item-name'>identifier</td>
|
71
|
+
<td class='context-item-value'>[R]</td>
|
72
|
+
<td class='context-item-desc'></td>
|
73
|
+
</tr>
|
74
|
+
<tr class='top-aligned-row context-row'>
|
75
|
+
<td class='context-item-name'>relative_offset</td>
|
76
|
+
<td class='context-item-value'>[R]</td>
|
77
|
+
<td class='context-item-desc'></td>
|
78
|
+
</tr>
|
79
|
+
</table>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
<div id='methods'>
|
83
|
+
<h2>Public class methods</h2>
|
84
|
+
<div class='method public-class' id='method-M000043'>
|
85
|
+
<a name='M000043'></a>
|
86
|
+
<div class='synopsis'>
|
87
|
+
<span class='name'>get</span>
|
88
|
+
<span class='arguments'>(identifier)</span>
|
89
|
+
</div>
|
90
|
+
<div class='description'>
|
91
|
+
<p>
|
92
|
+
Returns a timezone by its identifier (e.g. “Europe/London“,
|
93
|
+
“America/Chicago“ or “UTC”).
|
94
|
+
</p>
|
95
|
+
<p>
|
96
|
+
Supports relative timezones in the following formats: “UTC+2”,
|
97
|
+
“GMT+01:30”, “Europe/Paris-10:00”.
|
98
|
+
</p>
|
99
|
+
<p>
|
100
|
+
Raises InvalidTimezoneIdentifier if the timezone couldn’t be found.
|
101
|
+
</p>
|
102
|
+
</div>
|
103
|
+
<div class='source'>
|
104
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000043-source'); return false">
|
105
|
+
[show source]
|
106
|
+
</a>
|
107
|
+
<pre id='M000043-source'> <span class="ruby-comment cmt"># File lib/sdl4r/relative_timezone.rb, line 38</span>
38: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">identifier</span>)
39: <span class="ruby-identifier">base_identifier</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span> = <span class="ruby-constant">RelativeTimezone</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse_relative_identifier</span>(<span class="ruby-identifier">identifier</span>)
40: 
41: <span class="ruby-identifier">tz</span> = <span class="ruby-constant">TZAbbreviationDB</span>.<span class="ruby-identifier">get_timezone</span>(<span class="ruby-identifier">base_identifier</span>)
42: 
43: <span class="ruby-identifier">offset</span> <span class="ruby-value">?
44: </span> <span class="ruby-constant">RelativeTimezone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">base_identifier</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">offset_text</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span>, <span class="ruby-identifier">tz</span>) <span class="ruby-operator">:</span>
45: <span class="ruby-identifier">tz</span>
46: <span class="ruby-keyword kw">end</span></pre>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class='method public-class' id='method-M000044'>
|
111
|
+
<a name='M000044'></a>
|
112
|
+
<div class='synopsis'>
|
113
|
+
<span class='name'>get_proxy</span>
|
114
|
+
<span class='arguments'>(identifier)</span>
|
115
|
+
</div>
|
116
|
+
<div class='description'>
|
117
|
+
<p>
|
118
|
+
Returns a proxy for the Timezone with the given identifier. The proxy will
|
119
|
+
cause the real timezone to be loaded when an attempt is made to find a
|
120
|
+
period or convert a time. <a
|
121
|
+
href="RelativeTimezone.html#M000044">get_proxy</a> will not validate the
|
122
|
+
identifier. If an invalid identifier is specified, no exception will be
|
123
|
+
raised until the proxy is used.
|
124
|
+
</p>
|
125
|
+
<p>
|
126
|
+
Supports relative timezones in the following format:
|
127
|
+
“GMT+01:30”, “CET-10:00”.
|
128
|
+
</p>
|
129
|
+
</div>
|
130
|
+
<div class='source'>
|
131
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000044-source'); return false">
|
132
|
+
[show source]
|
133
|
+
</a>
|
134
|
+
<pre id='M000044-source'> <span class="ruby-comment cmt"># File lib/sdl4r/relative_timezone.rb, line 56</span>
56: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_proxy</span>(<span class="ruby-identifier">identifier</span>)
57: <span class="ruby-identifier">base_identifier</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span> = <span class="ruby-constant">RelativeTimezone</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse_relative_identifier</span>(<span class="ruby-identifier">identifier</span>)
58: 
59: <span class="ruby-identifier">proxy</span> = <span class="ruby-constant">TZAbbreviationDB</span>.<span class="ruby-identifier">get_timezone_proxy</span>(<span class="ruby-identifier">base_identifier</span>)
60: 
61: <span class="ruby-identifier">offset</span> <span class="ruby-value">?
62: </span> <span class="ruby-constant">RelativeTimezone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">base_identifier</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">offset_text</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span>, <span class="ruby-identifier">proxy</span>) <span class="ruby-operator">:</span>
63: <span class="ruby-identifier">proxy</span>
64: <span class="ruby-keyword kw">end</span></pre>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
<div class='method public-class' id='method-M000045'>
|
138
|
+
<a name='M000045'></a>
|
139
|
+
<div class='synopsis'>
|
140
|
+
<span class='name'>new</span>
|
141
|
+
<span class='arguments'>(identifier, offset_text, offset, base_timezone)</span>
|
142
|
+
</div>
|
143
|
+
<div class='source'>
|
144
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000045-source'); return false">
|
145
|
+
[show source]
|
146
|
+
</a>
|
147
|
+
<pre id='M000045-source'> <span class="ruby-comment cmt"># File lib/sdl4r/relative_timezone.rb, line 103</span>
103: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span>, <span class="ruby-identifier">base_timezone</span>)
104: <span class="ruby-identifier">o</span> = <span class="ruby-keyword kw">super</span>()
105: <span class="ruby-identifier">o</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:_initialize</span>, <span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">offset_text</span>, <span class="ruby-identifier">offset</span>, <span class="ruby-identifier">base_timezone</span>)
106: <span class="ruby-identifier">o</span>
107: <span class="ruby-keyword kw">end</span></pre>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<h2>Public instance methods</h2>
|
151
|
+
<div class='method public-instance' id='method-M000046'>
|
152
|
+
<a name='M000046'></a>
|
153
|
+
<div class='synopsis'>
|
154
|
+
<span class='name'>period_for_utc</span>
|
155
|
+
<span class='arguments'>(utc)</span>
|
156
|
+
</div>
|
157
|
+
<div class='source'>
|
158
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000046-source'); return false">
|
159
|
+
[show source]
|
160
|
+
</a>
|
161
|
+
<pre id='M000046-source'> <span class="ruby-comment cmt"># File lib/sdl4r/relative_timezone.rb, line 127</span>
127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">utc</span>)
128: <span class="ruby-identifier">period</span> = <span class="ruby-ivar">@base_timezone</span>.<span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">utc</span>)
129: 
130: <span class="ruby-identifier">translated_offset</span> =
131: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span> <span class="ruby-value">?
132: </span> <span class="ruby-constant">TZInfo</span><span class="ruby-operator">::</span><span class="ruby-constant">TimezoneOffsetInfo</span>.<span class="ruby-identifier">new</span>(
133: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">utc_offset</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@relative_offset</span>,
134: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">std_offset</span>,
135: (<span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">abbreviation</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@relative_offset_text</span>).<span class="ruby-identifier">to_sym</span>) <span class="ruby-operator">:</span>
136: <span class="ruby-keyword kw">nil</span>
137: 
138: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TZInfo</span><span class="ruby-operator">::</span><span class="ruby-constant">TimezonePeriod</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">translated_offset</span>)
139: <span class="ruby-keyword kw">end</span></pre>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
<div class='method public-instance' id='method-M000047'>
|
165
|
+
<a name='M000047'></a>
|
166
|
+
<div class='synopsis'>
|
167
|
+
<span class='name'>periods_for_local</span>
|
168
|
+
<span class='arguments'>(local)</span>
|
169
|
+
</div>
|
170
|
+
<div class='source'>
|
171
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000047-source'); return false">
|
172
|
+
[show source]
|
173
|
+
</a>
|
174
|
+
<pre id='M000047-source'> <span class="ruby-comment cmt"># File lib/sdl4r/relative_timezone.rb, line 141</span>
141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">periods_for_local</span>(<span class="ruby-identifier">local</span>)
142: <span class="ruby-identifier">periods</span> = <span class="ruby-ivar">@base_timezone</span>.<span class="ruby-identifier">periods_for_local</span>(<span class="ruby-identifier">local</span>)
143: 
144: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">periods</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">period</span><span class="ruby-operator">|</span>
145: <span class="ruby-identifier">translated_offset</span> =
146: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span> <span class="ruby-value">?
147: </span> <span class="ruby-constant">TZInfo</span><span class="ruby-operator">::</span><span class="ruby-constant">TimezoneOffsetInfo</span>.<span class="ruby-identifier">new</span>(
148: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">utc_offset</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@relative_offset</span>,
149: <span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">std_offset</span>,
150: (<span class="ruby-identifier">period</span>.<span class="ruby-identifier">offset</span>.<span class="ruby-identifier">abbreviation</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@relative_offset_text</span>).<span class="ruby-identifier">to_sym</span>) <span class="ruby-operator">:</span>
151: <span class="ruby-keyword kw">nil</span>
152: <span class="ruby-constant">TZInfo</span><span class="ruby-operator">::</span><span class="ruby-constant">TimezonePeriod</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">translated_offset</span>)
153: }
154: <span class="ruby-keyword kw">end</span></pre>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
<div id='footer-push'></div>
|
182
|
+
</div>
|
183
|
+
<div id='footer'>
|
184
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
185
|
+
</div>
|
186
|
+
</body>
|
187
|
+
</html>
|
@@ -0,0 +1,188 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: SDL4R::SdlBinary [RDoc: Simple Declarative Language for Ruby]</title>
|
5
|
+
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
SDL4R::SdlBinary
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/sdl4r/sdl_binary_rb.html">lib/sdl4r/sdl_binary.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Object</strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
Represents a binary value.
|
47
|
+
</p>
|
48
|
+
<p>
|
49
|
+
This class was introduced to avoid the confusion between a Ruby String and
|
50
|
+
a binary literal.
|
51
|
+
</p>
|
52
|
+
</div>
|
53
|
+
<div id='method-list'>
|
54
|
+
<h2>Methods</h2>
|
55
|
+
<h3>public class</h3>
|
56
|
+
<ol>
|
57
|
+
<li><a href="#M000053">decode64</a></li>
|
58
|
+
<li><a href="#M000048">new</a></li>
|
59
|
+
</ol>
|
60
|
+
<h3>public instance</h3>
|
61
|
+
<ol>
|
62
|
+
<li><a href="#M000049">==</a></li>
|
63
|
+
<li><a href="#M000050">eql?</a></li>
|
64
|
+
<li><a href="#M000051">hash</a></li>
|
65
|
+
<li><a href="#M000052">to_s</a></li>
|
66
|
+
</ol>
|
67
|
+
</div>
|
68
|
+
<div id='section'>
|
69
|
+
<div id='attribute-list'>
|
70
|
+
<h2 class='section-bar'>Attributes</h2>
|
71
|
+
<div class='name-list'>
|
72
|
+
<table>
|
73
|
+
<tr class='top-aligned-row context-row'>
|
74
|
+
<td class='context-item-name'>bytes</td>
|
75
|
+
<td class='context-item-value'>[RW]</td>
|
76
|
+
<td class='context-item-desc'></td>
|
77
|
+
</tr>
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
<div id='methods'>
|
82
|
+
<h2>Public class methods</h2>
|
83
|
+
<div class='method public-class' id='method-M000053'>
|
84
|
+
<a name='M000053'></a>
|
85
|
+
<div class='synopsis'>
|
86
|
+
<span class='name'>decode64</span>
|
87
|
+
<span class='arguments'>(s)</span>
|
88
|
+
</div>
|
89
|
+
<div class='description'>
|
90
|
+
<p>
|
91
|
+
Decodes the specified base-64 encoded string and returns a corresponding <a
|
92
|
+
href="SdlBinary.html">SdlBinary</a> instance. <tt>s</tt> might not include
|
93
|
+
the conventional starting and ending square brackets.
|
94
|
+
</p>
|
95
|
+
</div>
|
96
|
+
<div class='source'>
|
97
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000053-source'); return false">
|
98
|
+
[show source]
|
99
|
+
</a>
|
100
|
+
<pre id='M000053-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 57</span>
57: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
58: <span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"\n\r\t "</span>)
59: 
60: <span class="ruby-identifier">binary</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
61: 
62: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">binary</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span>
63: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"bad binary literal"</span>
64: <span class="ruby-keyword kw">end</span>
65: 
66: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">binary</span>)
67: <span class="ruby-keyword kw">end</span></pre>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
<div class='method public-class' id='method-M000048'>
|
104
|
+
<a name='M000048'></a>
|
105
|
+
<div class='synopsis'>
|
106
|
+
<span class='name'>new</span>
|
107
|
+
<span class='arguments'>(bytes)</span>
|
108
|
+
</div>
|
109
|
+
<div class='description'>
|
110
|
+
<p>
|
111
|
+
<tt>value</tt>: a String containing the bytes
|
112
|
+
</p>
|
113
|
+
</div>
|
114
|
+
<div class='source'>
|
115
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000048-source'); return false">
|
116
|
+
[show source]
|
117
|
+
</a>
|
118
|
+
<pre id='M000048-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bytes</span>)
34: <span class="ruby-ivar">@bytes</span> = <span class="ruby-identifier">bytes</span>
35: <span class="ruby-keyword kw">end</span></pre>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
<h2>Public instance methods</h2>
|
122
|
+
<div class='method public-instance' id='method-M000049'>
|
123
|
+
<a name='M000049'></a>
|
124
|
+
<div class='synopsis'>
|
125
|
+
<span class='name'>==</span>
|
126
|
+
<span class='arguments'>(o)</span>
|
127
|
+
</div>
|
128
|
+
<div class='source'>
|
129
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000049-source'); return false">
|
130
|
+
[show source]
|
131
|
+
</a>
|
132
|
+
<pre id='M000049-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 37</span>
37: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">o</span>)
38: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">o</span>)
39: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
40: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bytes</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">bytes</span>
41: <span class="ruby-keyword kw">end</span></pre>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
<div class='method public-instance' id='method-M000050'>
|
136
|
+
<a name='M000050'></a>
|
137
|
+
<div class='synopsis'>
|
138
|
+
<span class='name'>eql?</span>
|
139
|
+
<span class='arguments'>(o)</span>
|
140
|
+
</div>
|
141
|
+
<div class='description'>
|
142
|
+
<p>
|
143
|
+
Alias for #==
|
144
|
+
</p>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
<div class='method public-instance' id='method-M000051'>
|
148
|
+
<a name='M000051'></a>
|
149
|
+
<div class='synopsis'>
|
150
|
+
<span class='name'>hash</span>
|
151
|
+
<span class='arguments'>()</span>
|
152
|
+
</div>
|
153
|
+
<div class='source'>
|
154
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000051-source'); return false">
|
155
|
+
[show source]
|
156
|
+
</a>
|
157
|
+
<pre id='M000051-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 45</span>
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
46: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">hash</span>
47: <span class="ruby-keyword kw">end</span></pre>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
<div class='method public-instance' id='method-M000052'>
|
161
|
+
<a name='M000052'></a>
|
162
|
+
<div class='synopsis'>
|
163
|
+
<span class='name'>to_s</span>
|
164
|
+
<span class='arguments'>()</span>
|
165
|
+
</div>
|
166
|
+
<div class='description'>
|
167
|
+
<p>
|
168
|
+
Returns the bytes base64-encoded.
|
169
|
+
</p>
|
170
|
+
</div>
|
171
|
+
<div class='source'>
|
172
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000052-source'); return false">
|
173
|
+
[show source]
|
174
|
+
</a>
|
175
|
+
<pre id='M000052-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 50</span>
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
51: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">bytes</span>)
52: <span class="ruby-keyword kw">end</span></pre>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
<div id='footer-push'></div>
|
183
|
+
</div>
|
184
|
+
<div id='footer'>
|
185
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
186
|
+
</div>
|
187
|
+
</body>
|
188
|
+
</html>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: SDL4R::SdlParseError [RDoc: Simple Declarative Language for Ruby]</title>
|
5
|
+
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
SDL4R::SdlParseError
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/sdl4r/sdl_parse_error_rb.html">lib/sdl4r/sdl_parse_error.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>StandardError</strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
An exception describing a problem with an SDL document’s structure
|
47
|
+
</p>
|
48
|
+
</div>
|
49
|
+
<div id='method-list'>
|
50
|
+
<h2>Methods</h2>
|
51
|
+
<h3>public class</h3>
|
52
|
+
<ol>
|
53
|
+
<li><a href="#M000054">new</a></li>
|
54
|
+
</ol>
|
55
|
+
</div>
|
56
|
+
<div id='section'>
|
57
|
+
<div id='attribute-list'>
|
58
|
+
<h2 class='section-bar'>Attributes</h2>
|
59
|
+
<div class='name-list'>
|
60
|
+
<table>
|
61
|
+
<tr class='top-aligned-row context-row'>
|
62
|
+
<td class='context-item-name'>line</td>
|
63
|
+
<td class='context-item-value'>[R]</td>
|
64
|
+
<td class='context-item-desc'></td>
|
65
|
+
</tr>
|
66
|
+
<tr class='top-aligned-row context-row'>
|
67
|
+
<td class='context-item-name'>position</td>
|
68
|
+
<td class='context-item-value'>[R]</td>
|
69
|
+
<td class='context-item-desc'></td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
<div id='methods'>
|
75
|
+
<h2>Public class methods</h2>
|
76
|
+
<div class='method public-class' id='method-M000054'>
|
77
|
+
<a name='M000054'></a>
|
78
|
+
<div class='synopsis'>
|
79
|
+
<span class='name'>new</span>
|
80
|
+
<span class='arguments'>(description, line_no, position, line = nil)</span>
|
81
|
+
</div>
|
82
|
+
<div class='description'>
|
83
|
+
<p>
|
84
|
+
Note: Line and positioning numbering start with 1 rather than 0 to be
|
85
|
+
consistent with most editors.
|
86
|
+
</p>
|
87
|
+
<p>
|
88
|
+
<tt>description</tt> A description of the problem. <tt>lineNo</tt> The line
|
89
|
+
on which the error occured or -1 for unknown <tt>position</tt> The position
|
90
|
+
(within the line) where the error occured or -1 for unknown
|
91
|
+
</p>
|
92
|
+
</div>
|
93
|
+
<div class='source'>
|
94
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000054-source'); return false">
|
95
|
+
[show source]
|
96
|
+
</a>
|
97
|
+
<pre id='M000054-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_parse_error.rb, line 36</span>
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">description</span>, <span class="ruby-identifier">line_no</span>, <span class="ruby-identifier">position</span>, <span class="ruby-identifier">line</span> = <span class="ruby-keyword kw">nil</span>)
37: <span class="ruby-keyword kw">super</span>(
38: <span class="ruby-node">"#{description} Line "</span> <span class="ruby-operator">+</span> ((<span class="ruby-identifier">line_no</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">line_no</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>)<span class="ruby-operator">?</span> <span class="ruby-value str">"unknown"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">line_no</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-operator">+</span>
39: <span class="ruby-value str">", Position "</span> <span class="ruby-operator">+</span> ((<span class="ruby-identifier">position</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">position</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>)<span class="ruby-operator">?</span> <span class="ruby-value str">"unknown"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">position</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">+</span>
40: ((<span class="ruby-identifier">line</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">position</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>)<span class="ruby-operator">?</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">position</span> <span class="ruby-value">? </span><span class="ruby-value str">" "</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">position</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">:</span> <span class="ruby-value str">""</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">"^"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">""</span>))
41: 
42: <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">line_no</span>
43: <span class="ruby-ivar">@position</span> = <span class="ruby-identifier">position</span>
44: <span class="ruby-keyword kw">end</span></pre>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<div id='footer-push'></div>
|
105
|
+
</div>
|
106
|
+
<div id='footer'>
|
107
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
108
|
+
</div>
|
109
|
+
</body>
|
110
|
+
</html>
|