sdl4r 0.9.9 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/CHANGELOG +70 -1
  2. data/LICENSE +499 -497
  3. data/Rakefile +38 -28
  4. data/TODO +194 -45
  5. data/doc/classes/SDL4R/AbbreviationTimezoneProxy.html +151 -0
  6. data/doc/classes/SDL4R/ConstantTimezone.html +129 -0
  7. data/doc/classes/SDL4R/Element.html +148 -0
  8. data/doc/classes/SDL4R/Reader.html +683 -0
  9. data/doc/classes/SDL4R/RelativeTimezone.html +187 -0
  10. data/doc/classes/SDL4R/SdlBinary.html +188 -0
  11. data/doc/classes/SDL4R/SdlParseError.html +110 -0
  12. data/doc/classes/SDL4R/SdlTimeSpan.html +651 -0
  13. data/doc/classes/SDL4R/Serializer.html +557 -0
  14. data/doc/classes/SDL4R/Serializer/Ref.html +138 -0
  15. data/doc/classes/SDL4R/TZAbbreviationDB/Record.html +117 -0
  16. data/doc/classes/SDL4R/Tag.html +1274 -0
  17. data/doc/classes/SDL4R/Token.html +131 -0
  18. data/doc/created.rid +1 -0
  19. data/doc/files/CHANGELOG.html +290 -0
  20. data/doc/files/LICENSE.html +53 -0
  21. data/doc/files/README.html +405 -0
  22. data/doc/files/lib/sdl4r/abbreviation_timezone_proxy_rb.html +63 -0
  23. data/doc/files/lib/sdl4r/constant_timezone_rb.html +54 -0
  24. data/doc/files/lib/sdl4r/element_rb.html +54 -0
  25. data/doc/files/lib/sdl4r/reader_rb.html +68 -0
  26. data/doc/files/lib/sdl4r/relative_timezone_rb.html +62 -0
  27. data/doc/files/lib/sdl4r/sdl4r_rb.html +66 -0
  28. data/doc/files/lib/sdl4r/sdl4r_tzinfo_rb.html +64 -0
  29. data/doc/files/lib/sdl4r/sdl4r_version_rb.html +54 -0
  30. data/doc/files/lib/sdl4r/sdl_binary_rb.html +54 -0
  31. data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +54 -0
  32. data/doc/files/lib/sdl4r/sdl_time_span_rb.html +54 -0
  33. data/doc/files/lib/sdl4r/serializer_rb.html +62 -0
  34. data/doc/files/lib/sdl4r/tag_rb.html +66 -0
  35. data/doc/files/lib/sdl4r/token_rb.html +54 -0
  36. data/doc/files/lib/sdl4r/tokenizer_rb.html +64 -0
  37. data/doc/files/lib/sdl4r/tz_abbreviation_db_rb.html +67 -0
  38. data/doc/files/lib/sdl4r_rb.html +54 -0
  39. data/doc/files/lib/sdl4r_tzinfo_rb.html +54 -0
  40. data/doc/fr_class_index.html +23 -0
  41. data/doc/fr_file_index.html +40 -0
  42. data/doc/fr_method_index.html +4711 -0
  43. data/doc/index.html +15 -0
  44. data/doc/rdoc-style.css +328 -0
  45. data/lib/sdl4r.rb +3 -1
  46. data/lib/sdl4r/abbreviation_timezone_proxy.rb +38 -0
  47. data/lib/sdl4r/constant_timezone.rb +58 -0
  48. data/{test/sdl4r/sdl_test.rb → lib/sdl4r/element.rb} +19 -14
  49. data/lib/sdl4r/reader.rb +772 -0
  50. data/lib/sdl4r/relative_timezone.rb +156 -0
  51. data/lib/sdl4r/sdl4r.rb +187 -45
  52. data/lib/sdl4r/sdl4r_tzinfo.rb +75 -0
  53. data/lib/sdl4r/sdl4r_version.rb +24 -0
  54. data/lib/sdl4r/sdl_parse_error.rb +1 -1
  55. data/lib/sdl4r/sdl_time_span.rb +5 -1
  56. data/lib/sdl4r/serializer.rb +473 -60
  57. data/lib/sdl4r/tag.rb +126 -51
  58. data/lib/sdl4r/token.rb +49 -0
  59. data/lib/sdl4r/tokenizer.rb +431 -0
  60. data/lib/sdl4r/tz_abbreviation_db.rb +266 -0
  61. data/read_jprof.html +16934 -0
  62. data/read_jprof_pull.html +14451 -0
  63. data/read_prof.html +4983 -0
  64. data/read_prof_pull.html +4896 -0
  65. data/test/sdl4r/parser_test.rb +577 -503
  66. data/test/sdl4r/read_jprof.rb +58 -0
  67. data/test/sdl4r/read_prof.rb +70 -0
  68. data/test/sdl4r/reader_test.rb +173 -0
  69. data/test/sdl4r/relative_timezone_test.rb +102 -0
  70. data/test/sdl4r/sdl4r_test.rb +611 -528
  71. data/test/sdl4r/sdl4r_tzinfo_test.rb +108 -0
  72. data/test/sdl4r/sdl_test_case.rb +60 -0
  73. data/test/sdl4r/serializer_test.rb +448 -11
  74. data/test/sdl4r/tag_test.rb +84 -5
  75. data/test/sdl4r/tokenizer_test.rb +128 -0
  76. metadata +69 -11
  77. data/lib/sdl4r/parser.rb +0 -648
  78. data/lib/sdl4r/parser/reader.rb +0 -184
  79. data/lib/sdl4r/parser/time_span_with_zone.rb +0 -57
  80. data/lib/sdl4r/parser/token.rb +0 -138
  81. data/lib/sdl4r/parser/tokenizer.rb +0 -507
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>RDoc: Simple Declarative Language for Ruby</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ </head>
7
+ <frameset border='1' bordercolor='gray' cols='20%, *' frameborder='1'>
8
+ <frameset rows='15%, 35%, 50%'>
9
+ <frame name='Files' src='fr_file_index.html' title='Files'></frame>
10
+ <frame name='Classes' src='fr_class_index.html'></frame>
11
+ <frame name='Methods' src='fr_method_index.html'></frame>
12
+ </frameset>
13
+ <frame name='docwin' src='files/README.html'></frame>
14
+ </frameset>
15
+ </html>
@@ -0,0 +1,328 @@
1
+ html, body {
2
+ height: 100%; }
3
+
4
+ body {
5
+ font-family: Lucida Grande, Verdana, Arial, Helvetica, sans-serif;
6
+ font-size: 90%;
7
+ margin: 0;
8
+ padding: 0;
9
+ background: white;
10
+ color: black; }
11
+
12
+ #wrapper {
13
+ min-height: 100%;
14
+ height: auto !important;
15
+ height: 100%;
16
+ margin: 0 auto -43px; }
17
+
18
+ #footer-push {
19
+ height: 43px; }
20
+
21
+ div.header, #footer {
22
+ background: #eee; }
23
+
24
+ #footer {
25
+ border-top: 1px solid silver;
26
+ margin-top: 12px;
27
+ padding: 0 2em;
28
+ line-height: 30px;
29
+ text-align: center;
30
+ font-variant: small-caps;
31
+ font-size: 95%; }
32
+
33
+ .clearing:after {
34
+ content: ".";
35
+ visibility: hidden;
36
+ height: 0;
37
+ display: block;
38
+ clear: both; }
39
+ * html .clearing {
40
+ height: 1px; }
41
+ .clearing *:first-child + html {
42
+ overflow: hidden; }
43
+
44
+ h1, h2, h3, h4, h5, h6 {
45
+ margin: 0;
46
+ font-weight: normal; }
47
+
48
+ a {
49
+ color: #0b3e71; }
50
+ a:hover {
51
+ background: #336699;
52
+ text-decoration: none;
53
+ color: #eef; }
54
+
55
+ #diagram img {
56
+ border: 0; }
57
+
58
+ #description a, .method .description a, .header a {
59
+ color: #336699; }
60
+ #description a:hover, .method .description a:hover, .header a:hover {
61
+ color: #eee; }
62
+ #description h1 a, #description h2 a, #description h3 a, #description h4 a, #description h5 a, #description h6 a, .method .description h1 a, .method .description h2 a, .method .description h3 a, .method .description h4 a, .method .description h5 a, .method .description h6 a, .header h1 a, .header h2 a, .header h3 a, .header h4 a, .header h5 a, .header h6 a {
63
+ color: #0b3e71; }
64
+
65
+ ol {
66
+ margin: 0;
67
+ padding: 0;
68
+ list-style: none; }
69
+ ol li {
70
+ margin-left: 0;
71
+ white-space: nowrap; }
72
+ ol li.other {
73
+ display: none; }
74
+
75
+ ol.expanded li.other {
76
+ display: list-item; }
77
+
78
+ table {
79
+ margin-bottom: 1em;
80
+ font-size: 1em;
81
+ border-collapse: collapse; }
82
+ table td, table th {
83
+ padding: .4em .8em; }
84
+ table thead {
85
+ background-color: #e8e8e8; }
86
+ table thead th {
87
+ font-variant: small-caps;
88
+ color: #666666; }
89
+ table tr {
90
+ border-bottom: 1px solid silver; }
91
+
92
+ #index a.show, div.header a.show {
93
+ text-decoration: underline;
94
+ font-style: italic;
95
+ color: #666666; }
96
+ #index a.show:after, div.header a.show:after {
97
+ content: " ..."; }
98
+ #index a.show:hover, div.header a.show:hover {
99
+ color: black;
100
+ background: #ffe; }
101
+
102
+ #index {
103
+ font: 85%/1.2 Arial, Helvetica, sans-serif; }
104
+ #index a {
105
+ text-decoration: none; }
106
+ #index h1 {
107
+ padding: .2em .5em .1em;
108
+ background: #ccc;
109
+ font: small-caps 1.2em Georgia, serif;
110
+ color: #333;
111
+ border-bottom: 1px solid gray; }
112
+ #index form {
113
+ margin: 0;
114
+ padding: 0; }
115
+ #index form input {
116
+ margin: .4em 3px 0 .4em;
117
+ width: 80%; }
118
+ #index form #search.untouched {
119
+ color: #777777; }
120
+ #index form .clear_button {
121
+ -moz-border-radius: 7px;
122
+ -webkit-border-radius: 7px;
123
+ background: #AAA;
124
+ color: white;
125
+ padding: 0 5px 1px 5px;
126
+ cursor: pointer; }
127
+ #index ol {
128
+ padding: .4em .5em; }
129
+ #index ol li {
130
+ white-space: nowrap; }
131
+ #index #index-entries li a {
132
+ padding: 1px 2px; }
133
+ #index #index-entries.classes {
134
+ font-size: 1.1em; }
135
+ #index #index-entries.classes ol {
136
+ padding: 0; }
137
+ #index #index-entries.classes span.nodoc {
138
+ display: none; }
139
+ #index #index-entries.classes span.nodoc, #index #index-entries.classes a {
140
+ font-weight: bold; }
141
+ #index #index-entries.classes .parent {
142
+ font-weight: normal; }
143
+ #index #index-entries.methods li, #index #search-results.methods li {
144
+ margin-bottom: 0.2em; }
145
+ #index #index-entries.methods li a .method_name, #index #search-results.methods li a .method_name {
146
+ margin-right: 0.25em; }
147
+ #index #index-entries.methods li a .module_name, #index #search-results.methods li a .module_name {
148
+ color: #666666; }
149
+ #index #index-entries.methods li a:hover .module_name, #index #search-results.methods li a:hover .module_name {
150
+ color: #ddd; }
151
+
152
+ #attribute-list .context-item-name {
153
+ font-weight: bold; }
154
+
155
+ div.header {
156
+ font-size: 80%;
157
+ padding: .5em 2%;
158
+ font-family: Arial, Helvetica, sans-serif;
159
+ border-bottom: 1px solid silver; }
160
+ div.header .name {
161
+ font-size: 1.6em;
162
+ font-family: Georgia, serif; }
163
+ div.header .name .type {
164
+ color: #666666;
165
+ font-size: 80%;
166
+ font-variant: small-caps; }
167
+ div.header h1.name {
168
+ font-size: 2.2em; }
169
+ div.header .paths, div.header .last-update, div.header .parent {
170
+ color: #666666; }
171
+ div.header .last-update .datetime {
172
+ color: #484848; }
173
+ div.header .parent {
174
+ margin-top: .3em; }
175
+ div.header .parent strong {
176
+ font-weight: normal;
177
+ color: #484848; }
178
+
179
+ #content {
180
+ padding: 12px 2%; }
181
+ div.class #content {
182
+ position: relative;
183
+ width: 72%; }
184
+ #content pre, #content .method .synopsis {
185
+ font: 14px Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; }
186
+ #content pre {
187
+ color: black;
188
+ background: #eee;
189
+ border: 1px solid silver;
190
+ padding: .5em .8em;
191
+ overflow: auto; }
192
+ #content p code, #content p tt, #content li code, #content li tt, #content dl code, #content dl tt {
193
+ font: 14px Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
194
+ background: #ffffe3;
195
+ padding: 2px 3px;
196
+ line-height: 1.4; }
197
+ #content h1 code, #content h1 tt, #content h2 code, #content h2 tt, #content h3 code, #content h3 tt, #content h4 code, #content h4 tt, #content h5 code, #content h5 tt, #content h6 code, #content h6 tt {
198
+ font-size: 1.1em; }
199
+ #content #text {
200
+ position: relative; }
201
+ #content #description p {
202
+ margin-top: .5em; }
203
+ #content #description h1, #content #description h2, #content #description h3, #content #description h4, #content #description h5, #content #description h6 {
204
+ font-family: Georgia, serif; }
205
+ #content #description h1 {
206
+ font-size: 2.2em;
207
+ margin-bottom: .2em;
208
+ border-bottom: 3px double #d8d8d8;
209
+ padding-bottom: .1em; }
210
+ #content #description h2 {
211
+ font-size: 1.8em;
212
+ color: #0e3062;
213
+ margin: .8em 0 .3em 0; }
214
+ #content #description h3 {
215
+ font-size: 1.6em;
216
+ margin: .8em 0 .3em 0;
217
+ color: #666666; }
218
+ #content #description h4 {
219
+ font-size: 1.4em;
220
+ margin: .8em 0 .3em 0; }
221
+ #content #description h5 {
222
+ font-size: 1.2em;
223
+ margin: .8em 0 .3em 0;
224
+ color: #0e3062; }
225
+ #content #description h6 {
226
+ font-size: 1.0em;
227
+ margin: .8em 0 .3em 0;
228
+ color: #666666; }
229
+ #content #description ul, #content #description ol, #content .method .description ul, #content .method .description ol {
230
+ margin: .8em 0;
231
+ padding-left: 1.5em; }
232
+ #content #description ol, #content .method .description ol {
233
+ list-style: decimal; }
234
+ #content #description ol li, #content .method .description ol li {
235
+ white-space: normal; }
236
+
237
+ #method-list {
238
+ position: absolute;
239
+ top: 0px;
240
+ right: -33%;
241
+ width: 28%;
242
+ background: #eee;
243
+ border: 1px solid silver;
244
+ padding: .4em 1%;
245
+ overflow: hidden; }
246
+ #method-list h2 {
247
+ font-size: 1.3em; }
248
+ #method-list h3 {
249
+ font-variant: small-caps;
250
+ text-transform: capitalize;
251
+ font-family: Georgia, serif;
252
+ color: #666;
253
+ font-size: 1.1em; }
254
+ #method-list ol {
255
+ padding: 0 0 .5em .5em; }
256
+
257
+ #context {
258
+ border-top: 1px dashed silver;
259
+ margin-top: 1em;
260
+ margin-bottom: 1em; }
261
+
262
+ #context h2, #section h2 {
263
+ font: small-caps 1.2em Georgia, serif;
264
+ color: #444;
265
+ margin: 1em 0 .2em 0; }
266
+
267
+ #methods .method {
268
+ border: 1px solid silver;
269
+ margin-top: .5em;
270
+ background: #eee; }
271
+ #methods .method .synopsis {
272
+ color: black;
273
+ background: silver;
274
+ padding: .2em 1em; }
275
+ #methods .method .synopsis .name {
276
+ font-weight: bold; }
277
+ #methods .method .synopsis a {
278
+ text-decoration: none; }
279
+ #methods .method .description {
280
+ padding: 0 1em; }
281
+ #methods .method .description pre {
282
+ background: #f8f8f8; }
283
+ #methods .method .source {
284
+ margin: .5em 0; }
285
+ #methods .method .source-toggle {
286
+ font-size: 85%;
287
+ margin-left: 1em; }
288
+ #methods .public-class {
289
+ background: #ffffe4; }
290
+ #methods .public-instance .synopsis {
291
+ color: #eee;
292
+ background: #336699; }
293
+
294
+ #content .method .source pre {
295
+ background: #262626;
296
+ color: #ffdead;
297
+ margin: 1em;
298
+ padding: 0.5em;
299
+ border: 1px dashed #999;
300
+ overflow: auto; }
301
+ #content .method .source pre .ruby-constant {
302
+ color: #7fffd4;
303
+ background: transparent; }
304
+ #content .method .source pre .ruby-keyword {
305
+ color: #00ffff;
306
+ background: transparent; }
307
+ #content .method .source pre .ruby-ivar {
308
+ color: #eedd82;
309
+ background: transparent; }
310
+ #content .method .source pre .ruby-operator {
311
+ color: #00ffee;
312
+ background: transparent; }
313
+ #content .method .source pre .ruby-identifier {
314
+ color: #ffdead;
315
+ background: transparent; }
316
+ #content .method .source pre .ruby-node {
317
+ color: #ffa07a;
318
+ background: transparent; }
319
+ #content .method .source pre .ruby-comment {
320
+ color: #b22222;
321
+ font-weight: bold;
322
+ background: transparent; }
323
+ #content .method .source pre .ruby-regexp {
324
+ color: #ffa07a;
325
+ background: transparent; }
326
+ #content .method .source pre .ruby-value {
327
+ color: #7fffd4;
328
+ background: transparent; }
@@ -18,4 +18,6 @@
18
18
  # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
19
  #++
20
20
 
21
- require File.dirname(__FILE__) + '/sdl4r/tag'
21
+ module SDL4R # :nodoc:
22
+ require File.dirname(__FILE__) + '/sdl4r/tag'
23
+ end
@@ -0,0 +1,38 @@
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+
4
+ module SDL4R
5
+ class AbbreviationTimezoneProxy < TZInfo::Timezone
6
+
7
+ def self.new(identifier, consider_modern_abbreviations)
8
+ o = super()
9
+ o._initialize(identifier, consider_modern_abbreviations)
10
+ o
11
+ end
12
+
13
+ def _initialize(identifier, consider_modern_abbreviations)
14
+ @identifier = identifier
15
+ @consider_modern_abbreviations = consider_modern_abbreviations
16
+ @actual_timezone = nil
17
+ end
18
+
19
+ def actual_timezone
20
+ unless @actual_timezone
21
+ @actual_timezone = get_timezone(identifier, consider_modern_abbreviations)
22
+ end
23
+ @actual_timezone
24
+ end
25
+
26
+ def identifier
27
+ @identifier
28
+ end
29
+
30
+ def period_for_utc(utc)
31
+ actual_timezone.period_for_utc(utc)
32
+ end
33
+
34
+ def periods_for_local(local)
35
+ actual_timezone.periods_for_local(local)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+
4
+ #--
5
+ #
6
+ # Simple Declarative Language (SDL) for Ruby
7
+ # Copyright 2005 Ikayzo, inc.
8
+ #
9
+ # This program is free software. You can distribute or modify it under the
10
+ # terms of the GNU Lesser General Public License version 2.1 as published by
11
+ # the Free Software Foundation.
12
+ #
13
+ # This program is distributed AS IS and WITHOUT WARRANTY. OF ANY KIND,
14
+ # INCLUDING MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
15
+ # See the GNU Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public License
18
+ # along with this program; if not, contact the Free Software Foundation, Inc.,
19
+ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
+ #++
21
+
22
+ module SDL4R
23
+
24
+ # A timezone like 'JST' that has only one definition whatever the place and the time.
25
+ #
26
+ class ConstantTimezone < TZInfo::Timezone
27
+
28
+ def self.new(identifier, utc_offset, std_offset)
29
+ o = super()
30
+ o.send(:_initialize, identifier, utc_offset, std_offset)
31
+ o
32
+ end
33
+
34
+ def _initialize(identifier, utc_offset, std_offset) # :nodoc:
35
+ raise ArgumentError, 'identifier' if identifier.nil?
36
+ raise ArgumentError, 'utc_offset' if utc_offset.nil?
37
+ raise ArgumentError, 'std_offset' if std_offset.nil?
38
+
39
+ @identifier = identifier
40
+ @utc_offset = utc_offset
41
+ @std_offset = std_offset
42
+ @period = TZInfo::TimezonePeriod.new(
43
+ nil, nil, TZInfo::TimezoneOffsetInfo.new(@utc_offset, @std_offset, @identifier.to_sym))
44
+ end
45
+
46
+ def identifier
47
+ @identifier
48
+ end
49
+
50
+ def period_for_utc(utc)
51
+ @period
52
+ end
53
+
54
+ def periods_for_local(local)
55
+ [@period]
56
+ end
57
+ end
58
+ end