sdl4r 0.9.3 → 0.9.4
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/CHANGELOG +13 -0
- data/README +2 -2
- data/Rakefile +3 -3
- data/TODO.txt +28 -11
- data/doc/classes/SDL4R.html +681 -0
- data/doc/classes/SDL4R/Parser.html +314 -0
- data/doc/classes/SDL4R/SdlBinary.html +303 -0
- data/doc/classes/SDL4R/SdlParseError.html +185 -0
- data/doc/classes/SDL4R/SdlTimeSpan.html +948 -0
- data/doc/classes/SDL4R/Tag.html +2028 -0
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +130 -0
- data/doc/files/LICENSE.html +756 -0
- data/doc/files/README.html +606 -0
- data/doc/files/lib/sdl4r/parser/reader_rb.html +108 -0
- data/doc/files/lib/sdl4r/parser/time_span_with_zone_rb.html +101 -0
- data/doc/files/lib/sdl4r/parser/token_rb.html +101 -0
- data/doc/files/lib/sdl4r/parser/tokenizer_rb.html +101 -0
- data/doc/files/lib/sdl4r/parser_rb.html +108 -0
- data/doc/files/lib/sdl4r/sdl4r_rb.html +111 -0
- data/doc/files/lib/sdl4r/sdl_binary_rb.html +101 -0
- data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +101 -0
- data/doc/files/lib/sdl4r/sdl_time_span_rb.html +101 -0
- data/doc/files/lib/sdl4r/tag_rb.html +110 -0
- data/doc/files/lib/sdl4r_rb.html +101 -0
- data/doc/fr_file_index.html +2 -1
- data/doc/fr_method_index.html +88 -82
- data/lib/sdl4r.rb +18 -0
- data/lib/sdl4r/parser.rb +2 -9
- data/lib/sdl4r/{sdl.rb → sdl4r.rb} +46 -7
- data/lib/sdl4r/sdl_time_span.rb +6 -1
- data/lib/sdl4r/tag.rb +6 -7
- data/test/sdl4r/parser_test.rb +4 -16
- data/test/sdl4r/sdl4r_test.rb +3 -13
- data/test/sdl4r/sdl_test.rb +39 -0
- metadata +29 -6
@@ -0,0 +1,101 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: sdl4r.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>sdl4r.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/sdl4r.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Thu Aug 05 23:44:52 +0900 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if method_list -->
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="validator-badges">
|
97
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</body>
|
101
|
+
</html>
|
data/doc/fr_file_index.html
CHANGED
@@ -23,12 +23,13 @@
|
|
23
23
|
<a href="files/CHANGELOG.html">CHANGELOG</a><br />
|
24
24
|
<a href="files/LICENSE.html">LICENSE</a><br />
|
25
25
|
<a href="files/README.html">README</a><br />
|
26
|
+
<a href="files/lib/sdl4r_rb.html">lib/sdl4r.rb</a><br />
|
26
27
|
<a href="files/lib/sdl4r/parser_rb.html">lib/sdl4r/parser.rb</a><br />
|
27
28
|
<a href="files/lib/sdl4r/parser/reader_rb.html">lib/sdl4r/parser/reader.rb</a><br />
|
28
29
|
<a href="files/lib/sdl4r/parser/time_span_with_zone_rb.html">lib/sdl4r/parser/time_span_with_zone.rb</a><br />
|
29
30
|
<a href="files/lib/sdl4r/parser/token_rb.html">lib/sdl4r/parser/token.rb</a><br />
|
30
31
|
<a href="files/lib/sdl4r/parser/tokenizer_rb.html">lib/sdl4r/parser/tokenizer.rb</a><br />
|
31
|
-
<a href="files/lib/sdl4r/
|
32
|
+
<a href="files/lib/sdl4r/sdl4r_rb.html">lib/sdl4r/sdl4r.rb</a><br />
|
32
33
|
<a href="files/lib/sdl4r/sdl_binary_rb.html">lib/sdl4r/sdl_binary.rb</a><br />
|
33
34
|
<a href="files/lib/sdl4r/sdl_parse_error_rb.html">lib/sdl4r/sdl_parse_error.rb</a><br />
|
34
35
|
<a href="files/lib/sdl4r/sdl_time_span_rb.html">lib/sdl4r/sdl_time_span.rb</a><br />
|
data/doc/fr_method_index.html
CHANGED
@@ -20,88 +20,94 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/SDL4R/Tag.html#
|
24
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
25
|
-
<a href="classes/SDL4R/
|
26
|
-
<a href="classes/SDL4R/SdlBinary.html#
|
27
|
-
<a href="classes/SDL4R/
|
28
|
-
<a href="classes/SDL4R.html#
|
29
|
-
<a href="classes/SDL4R/Tag.html#
|
30
|
-
<a href="classes/SDL4R/Tag.html#
|
31
|
-
<a href="classes/SDL4R/Tag.html#
|
32
|
-
<a href="classes/SDL4R/Tag.html#
|
33
|
-
<a href="classes/SDL4R/Tag.html#
|
34
|
-
<a href="classes/SDL4R/Tag.html#
|
35
|
-
<a href="classes/SDL4R/Tag.html#
|
36
|
-
<a href="classes/SDL4R/Tag.html#
|
37
|
-
<a href="classes/SDL4R/Tag.html#
|
38
|
-
<a href="classes/SDL4R/Tag.html#
|
39
|
-
<a href="classes/SDL4R/Tag.html#
|
40
|
-
<a href="classes/SDL4R/Tag.html#
|
41
|
-
<a href="classes/SDL4R/Tag.html#
|
42
|
-
<a href="classes/SDL4R.html#
|
43
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
44
|
-
<a href="classes/SDL4R/
|
45
|
-
<a href="classes/SDL4R/
|
46
|
-
<a href="classes/SDL4R/
|
47
|
-
<a href="classes/SDL4R/
|
48
|
-
<a href="classes/SDL4R.html#
|
49
|
-
<a href="classes/SDL4R
|
50
|
-
<a href="classes/SDL4R/Tag.html#
|
51
|
-
<a href="classes/SDL4R/Tag.html#
|
52
|
-
<a href="classes/SDL4R/Tag.html#
|
53
|
-
<a href="classes/SDL4R/
|
54
|
-
<a href="classes/SDL4R/
|
55
|
-
<a href="classes/SDL4R/
|
56
|
-
<a href="classes/SDL4R/
|
57
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
58
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
59
|
-
<a href="classes/SDL4R/
|
60
|
-
<a href="classes/SDL4R/
|
61
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
62
|
-
<a href="classes/SDL4R/Tag.html#
|
63
|
-
<a href="classes/SDL4R/
|
64
|
-
<a href="classes/SDL4R/
|
65
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
66
|
-
<a href="classes/SDL4R/
|
67
|
-
<a href="classes/SDL4R/Tag.html#
|
68
|
-
<a href="classes/SDL4R/
|
69
|
-
<a href="classes/SDL4R/
|
70
|
-
<a href="classes/SDL4R.html#
|
71
|
-
<a href="classes/SDL4R/
|
72
|
-
<a href="classes/SDL4R
|
73
|
-
<a href="classes/SDL4R/
|
74
|
-
<a href="classes/SDL4R
|
75
|
-
<a href="classes/SDL4R/Tag.html#
|
76
|
-
<a href="classes/SDL4R/
|
77
|
-
<a href="classes/SDL4R/
|
78
|
-
<a href="classes/SDL4R/
|
79
|
-
<a href="classes/SDL4R/
|
80
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
81
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
82
|
-
<a href="classes/SDL4R/
|
83
|
-
<a href="classes/SDL4R/
|
84
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
85
|
-
<a href="classes/SDL4R.html#
|
86
|
-
<a href="classes/SDL4R/
|
87
|
-
<a href="classes/SDL4R/Tag.html#
|
88
|
-
<a href="classes/SDL4R/Tag.html#
|
89
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
90
|
-
<a href="classes/SDL4R
|
91
|
-
<a href="classes/SDL4R/Tag.html#
|
92
|
-
<a href="classes/SDL4R.html#
|
93
|
-
<a href="classes/SDL4R.html#
|
94
|
-
<a href="classes/SDL4R/
|
95
|
-
<a href="classes/SDL4R/SdlTimeSpan.html#
|
96
|
-
<a href="classes/SDL4R/
|
97
|
-
<a href="classes/SDL4R
|
98
|
-
<a href="classes/SDL4R
|
99
|
-
<a href="classes/SDL4R.html#
|
100
|
-
<a href="classes/SDL4R/
|
101
|
-
<a href="classes/SDL4R/
|
102
|
-
<a href="classes/SDL4R/
|
103
|
-
<a href="classes/SDL4R/
|
104
|
-
<a href="classes/SDL4R/
|
23
|
+
<a href="classes/SDL4R/Tag.html#M000016"><< (SDL4R::Tag)</a><br />
|
24
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000087"><=> (SDL4R::SdlTimeSpan)</a><br />
|
25
|
+
<a href="classes/SDL4R/Tag.html#M000052">== (SDL4R::Tag)</a><br />
|
26
|
+
<a href="classes/SDL4R/SdlBinary.html#M000056">== (SDL4R::SdlBinary)</a><br />
|
27
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000086">== (SDL4R::SdlTimeSpan)</a><br />
|
28
|
+
<a href="classes/SDL4R.html#M000001">SdlBinary (SDL4R)</a><br />
|
29
|
+
<a href="classes/SDL4R/Tag.html#M000015">add_child (SDL4R::Tag)</a><br />
|
30
|
+
<a href="classes/SDL4R/Tag.html#M000029">add_value (SDL4R::Tag)</a><br />
|
31
|
+
<a href="classes/SDL4R/Tag.html#M000036">attribute (SDL4R::Tag)</a><br />
|
32
|
+
<a href="classes/SDL4R/Tag.html#M000038">attributes (SDL4R::Tag)</a><br />
|
33
|
+
<a href="classes/SDL4R/Tag.html#M000042">attributes= (SDL4R::Tag)</a><br />
|
34
|
+
<a href="classes/SDL4R/Tag.html#M000024">child (SDL4R::Tag)</a><br />
|
35
|
+
<a href="classes/SDL4R/Tag.html#M000021">child_count (SDL4R::Tag)</a><br />
|
36
|
+
<a href="classes/SDL4R/Tag.html#M000022">children (SDL4R::Tag)</a><br />
|
37
|
+
<a href="classes/SDL4R/Tag.html#M000050">children_to_string (SDL4R::Tag)</a><br />
|
38
|
+
<a href="classes/SDL4R/Tag.html#M000023">children_values (SDL4R::Tag)</a><br />
|
39
|
+
<a href="classes/SDL4R/Tag.html#M000040">clear_attributes (SDL4R::Tag)</a><br />
|
40
|
+
<a href="classes/SDL4R/Tag.html#M000018">clear_children (SDL4R::Tag)</a><br />
|
41
|
+
<a href="classes/SDL4R/Tag.html#M000032">clear_values (SDL4R::Tag)</a><br />
|
42
|
+
<a href="classes/SDL4R.html#M000004">coerce_or_fail (SDL4R)</a><br />
|
43
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000065">day (SDL4R::SdlTimeSpan)</a><br />
|
44
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000064">days (SDL4R::SdlTimeSpan)</a><br />
|
45
|
+
<a href="classes/SDL4R/SdlBinary.html#M000060">decode64 (SDL4R::SdlBinary)</a><br />
|
46
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000085">eql? (SDL4R::SdlTimeSpan)</a><br />
|
47
|
+
<a href="classes/SDL4R/SdlBinary.html#M000057">eql? (SDL4R::SdlBinary)</a><br />
|
48
|
+
<a href="classes/SDL4R/Tag.html#M000051">eql? (SDL4R::Tag)</a><br />
|
49
|
+
<a href="classes/SDL4R.html#M000002">format (SDL4R)</a><br />
|
50
|
+
<a href="classes/SDL4R/Tag.html#M000037">has_attribute? (SDL4R::Tag)</a><br />
|
51
|
+
<a href="classes/SDL4R/Tag.html#M000025">has_child? (SDL4R::Tag)</a><br />
|
52
|
+
<a href="classes/SDL4R/Tag.html#M000026">has_children? (SDL4R::Tag)</a><br />
|
53
|
+
<a href="classes/SDL4R/Tag.html#M000030">has_value? (SDL4R::Tag)</a><br />
|
54
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000084">hash (SDL4R::SdlTimeSpan)</a><br />
|
55
|
+
<a href="classes/SDL4R/SdlBinary.html#M000058">hash (SDL4R::SdlBinary)</a><br />
|
56
|
+
<a href="classes/SDL4R/Tag.html#M000053">hash (SDL4R::Tag)</a><br />
|
57
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000067">hour (SDL4R::SdlTimeSpan)</a><br />
|
58
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000066">hours (SDL4R::SdlTimeSpan)</a><br />
|
59
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000072">milliseconds (SDL4R::SdlTimeSpan)</a><br />
|
60
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000069">min (SDL4R::SdlTimeSpan)</a><br />
|
61
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000068">minutes (SDL4R::SdlTimeSpan)</a><br />
|
62
|
+
<a href="classes/SDL4R/Tag.html#M000043">name= (SDL4R::Tag)</a><br />
|
63
|
+
<a href="classes/SDL4R/Tag.html#M000044">namespace= (SDL4R::Tag)</a><br />
|
64
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000078">negate (SDL4R::SdlTimeSpan)</a><br />
|
65
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000062">new (SDL4R::SdlTimeSpan)</a><br />
|
66
|
+
<a href="classes/SDL4R/Parser.html#M000010">new (SDL4R::Parser)</a><br />
|
67
|
+
<a href="classes/SDL4R/Tag.html#M000013">new (SDL4R::Tag)</a><br />
|
68
|
+
<a href="classes/SDL4R/SdlBinary.html#M000055">new (SDL4R::SdlBinary)</a><br />
|
69
|
+
<a href="classes/SDL4R/SdlParseError.html#M000061">new (SDL4R::SdlParseError)</a><br />
|
70
|
+
<a href="classes/SDL4R/Tag.html#M000014">new_child (SDL4R::Tag)</a><br />
|
71
|
+
<a href="classes/SDL4R/Parser.html#M000012">new_date_time (SDL4R::Parser)</a><br />
|
72
|
+
<a href="classes/SDL4R.html#M000003">new_date_time (SDL4R)</a><br />
|
73
|
+
<a href="classes/SDL4R/Parser.html#M000011">parse (SDL4R::Parser)</a><br />
|
74
|
+
<a href="classes/SDL4R.html#M000006">read (SDL4R)</a><br />
|
75
|
+
<a href="classes/SDL4R/Tag.html#M000045">read (SDL4R::Tag)</a><br />
|
76
|
+
<a href="classes/SDL4R/Tag.html#M000046">read_from_io (SDL4R::Tag)</a><br />
|
77
|
+
<a href="classes/SDL4R/Tag.html#M000039">remove_attribute (SDL4R::Tag)</a><br />
|
78
|
+
<a href="classes/SDL4R/Tag.html#M000017">remove_child (SDL4R::Tag)</a><br />
|
79
|
+
<a href="classes/SDL4R/Tag.html#M000031">remove_value (SDL4R::Tag)</a><br />
|
80
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000079">roll_days (SDL4R::SdlTimeSpan)</a><br />
|
81
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000080">roll_hours (SDL4R::SdlTimeSpan)</a><br />
|
82
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000083">roll_milliseconds (SDL4R::SdlTimeSpan)</a><br />
|
83
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000081">roll_minutes (SDL4R::SdlTimeSpan)</a><br />
|
84
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000082">roll_seconds (SDL4R::SdlTimeSpan)</a><br />
|
85
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000071">sec (SDL4R::SdlTimeSpan)</a><br />
|
86
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000070">seconds (SDL4R::SdlTimeSpan)</a><br />
|
87
|
+
<a href="classes/SDL4R/Tag.html#M000035">set_attribute (SDL4R::Tag)</a><br />
|
88
|
+
<a href="classes/SDL4R/Tag.html#M000041">set_attributes (SDL4R::Tag)</a><br />
|
89
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000063">sign (SDL4R::SdlTimeSpan)</a><br />
|
90
|
+
<a href="classes/SDL4R.html#M000009">to_attribute_map (SDL4R)</a><br />
|
91
|
+
<a href="classes/SDL4R/Tag.html#M000027">to_child_hash (SDL4R::Tag)</a><br />
|
92
|
+
<a href="classes/SDL4R/Tag.html#M000028">to_child_string_hash (SDL4R::Tag)</a><br />
|
93
|
+
<a href="classes/SDL4R/Tag.html#M000048">to_s (SDL4R::Tag)</a><br />
|
94
|
+
<a href="classes/SDL4R/SdlBinary.html#M000059">to_s (SDL4R::SdlBinary)</a><br />
|
95
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000088">to_s (SDL4R::SdlTimeSpan)</a><br />
|
96
|
+
<a href="classes/SDL4R/Tag.html#M000049">to_string (SDL4R::Tag)</a><br />
|
97
|
+
<a href="classes/SDL4R.html#M000007">to_value (SDL4R)</a><br />
|
98
|
+
<a href="classes/SDL4R.html#M000008">to_value_array (SDL4R)</a><br />
|
99
|
+
<a href="classes/SDL4R/Tag.html#M000054">to_xml_string (SDL4R::Tag)</a><br />
|
100
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000074">total_hours (SDL4R::SdlTimeSpan)</a><br />
|
101
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000077">total_milliseconds (SDL4R::SdlTimeSpan)</a><br />
|
102
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000075">total_minutes (SDL4R::SdlTimeSpan)</a><br />
|
103
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000076">total_seconds (SDL4R::SdlTimeSpan)</a><br />
|
104
|
+
<a href="classes/SDL4R/SdlTimeSpan.html#M000073">usec (SDL4R::SdlTimeSpan)</a><br />
|
105
|
+
<a href="classes/SDL4R.html#M000005">validate_identifier (SDL4R)</a><br />
|
106
|
+
<a href="classes/SDL4R/Tag.html#M000020">value (SDL4R::Tag)</a><br />
|
107
|
+
<a href="classes/SDL4R/Tag.html#M000019">value= (SDL4R::Tag)</a><br />
|
108
|
+
<a href="classes/SDL4R/Tag.html#M000033">values (SDL4R::Tag)</a><br />
|
109
|
+
<a href="classes/SDL4R/Tag.html#M000034">values= (SDL4R::Tag)</a><br />
|
110
|
+
<a href="classes/SDL4R/Tag.html#M000047">write (SDL4R::Tag)</a><br />
|
105
111
|
</div>
|
106
112
|
</div>
|
107
113
|
</body>
|
data/lib/sdl4r.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#--
|
2
|
+
# Simple Declarative Language (SDL) for Ruby
|
3
|
+
# Copyright 2005 Ikayzo, inc.
|
4
|
+
#
|
5
|
+
# This program is free software. You can distribute or modify it under the
|
6
|
+
# terms of the GNU Lesser General Public License version 2.1 as published by
|
7
|
+
# the Free Software Foundation.
|
8
|
+
#
|
9
|
+
# This program is distributed AS IS and WITHOUT WARRANTY. OF ANY KIND,
|
10
|
+
# INCLUDING MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
# See the GNU Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public License
|
14
|
+
# along with this program; if not, contact the Free Software Foundation, Inc.,
|
15
|
+
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16
|
+
#++
|
17
|
+
|
18
|
+
require File.dirname(__FILE__) + '/sdl4r/tag'
|
data/lib/sdl4r/parser.rb
CHANGED
@@ -20,13 +20,6 @@ module SDL4R
|
|
20
20
|
|
21
21
|
require 'base64'
|
22
22
|
|
23
|
-
begin
|
24
|
-
# Try to use the Flt library, which defines DecNum
|
25
|
-
require "flt"
|
26
|
-
rescue LoadError
|
27
|
-
# Well, shouganai.
|
28
|
-
end
|
29
|
-
|
30
23
|
require File.dirname(__FILE__) + '/sdl_binary'
|
31
24
|
require File.dirname(__FILE__) + '/sdl_time_span'
|
32
25
|
require File.dirname(__FILE__) + '/sdl_parse_error'
|
@@ -107,7 +100,7 @@ module SDL4R
|
|
107
100
|
# end
|
108
101
|
#
|
109
102
|
def new_date_time(year, month, day, hour, min, sec, time_zone_offset)
|
110
|
-
|
103
|
+
SDL4R::new_date_time(year, month, day, hour, min, sec, time_zone_offset)
|
111
104
|
end
|
112
105
|
|
113
106
|
private
|
@@ -462,7 +455,7 @@ module SDL4R
|
|
462
455
|
if literal =~ /(.*)(L)$/i
|
463
456
|
return Integer($1)
|
464
457
|
elsif literal =~ /([^BDF]*)(BD)$/i
|
465
|
-
return (
|
458
|
+
return BigDecimal($1)
|
466
459
|
elsif literal =~ /([^BDF]*)(F|D)$/i
|
467
460
|
return Float($1)
|
468
461
|
elsif literal.count(".e") == 0
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require 'jcode'
|
19
19
|
require 'base64'
|
20
|
-
require '
|
20
|
+
require 'bigdecimal'
|
21
21
|
require 'date'
|
22
22
|
|
23
23
|
# Gathers utility methods.
|
@@ -66,13 +66,15 @@ module SDL4R
|
|
66
66
|
end
|
67
67
|
|
68
68
|
elsif o.is_a?(Float)
|
69
|
-
return o.to_s + "F"
|
69
|
+
return (o.to_s + "F")
|
70
70
|
|
71
71
|
elsif o.is_a?(Rational)
|
72
72
|
return o.to_f.to_s + "F"
|
73
73
|
|
74
|
-
elsif
|
75
|
-
|
74
|
+
elsif o.is_a?(BigDecimal)
|
75
|
+
s = o.to_s('F')
|
76
|
+
s.sub!(/\.0$/, "")
|
77
|
+
return "#{s}BD"
|
76
78
|
|
77
79
|
elsif o.nil?
|
78
80
|
return "null"
|
@@ -121,14 +123,51 @@ module SDL4R
|
|
121
123
|
return o.to_s
|
122
124
|
end
|
123
125
|
end
|
126
|
+
|
127
|
+
# Creates and returns the object representing a datetime (DateTime in the default implementation).
|
128
|
+
# This method is, by default, called by the Parser class.
|
129
|
+
# It could be overriden as follows in order to get Time instances from all the SDL4R parsers.
|
130
|
+
#
|
131
|
+
# module SDL4R
|
132
|
+
# def self.new_date_time(year, month, day, hour, min, sec, time_zone_offset)
|
133
|
+
# Time.utc(year, month, day, hour, min, sec)
|
134
|
+
# end
|
135
|
+
# end
|
136
|
+
#
|
137
|
+
def self.new_date_time(year, month, day, hour, min, sec, time_zone_offset)
|
138
|
+
DateTime.civil(year, month, day, hour, min, sec, time_zone_offset)
|
139
|
+
end
|
124
140
|
|
125
141
|
# Coerce the type to a standard SDL type or raises an ArgumentError.
|
126
142
|
#
|
127
|
-
#
|
128
|
-
#
|
143
|
+
# Returns +o+ if of the following classes:
|
144
|
+
# NilClass, String, Numeric, Float, TrueClass, FalseClass, Date, DateTime, Time,
|
145
|
+
# SdlTimeSpan, SdlBinary,
|
146
|
+
#
|
147
|
+
# Rationals are turned into Floats using Rational#to_f.
|
129
148
|
#
|
130
149
|
def self.coerce_or_fail(o)
|
131
|
-
|
150
|
+
case o
|
151
|
+
|
152
|
+
when Rational
|
153
|
+
return o.to_f
|
154
|
+
|
155
|
+
when NilClass,
|
156
|
+
String,
|
157
|
+
Numeric,
|
158
|
+
Float,
|
159
|
+
TrueClass,
|
160
|
+
FalseClass,
|
161
|
+
Date,
|
162
|
+
DateTime,
|
163
|
+
Time,
|
164
|
+
SdlTimeSpan,
|
165
|
+
SdlBinary
|
166
|
+
return o
|
167
|
+
|
168
|
+
end
|
169
|
+
|
170
|
+
raise ArgumentError, "#{o.class.name} is not coercible to an SDL type"
|
132
171
|
end
|
133
172
|
|
134
173
|
# Validates an SDL identifier String. SDL Identifiers must start with a
|
data/lib/sdl4r/sdl_time_span.rb
CHANGED
@@ -89,13 +89,15 @@ module SDL4R
|
|
89
89
|
def days
|
90
90
|
sign * (@totalMilliseconds.abs / MILLISECONDS_IN_DAY)
|
91
91
|
end
|
92
|
+
alias_method :day, :days
|
92
93
|
|
93
94
|
# The hours component.
|
94
95
|
#
|
95
96
|
def hours
|
96
97
|
return sign * ((@totalMilliseconds - (days * MILLISECONDS_IN_DAY)).abs / MILLISECONDS_IN_HOUR)
|
97
98
|
end
|
98
|
-
|
99
|
+
alias_method :hour, :hours
|
100
|
+
|
99
101
|
# The minutes component.
|
100
102
|
#
|
101
103
|
def minutes
|
@@ -103,6 +105,7 @@ module SDL4R
|
|
103
105
|
((@totalMilliseconds - (days * MILLISECONDS_IN_DAY) - (hours * MILLISECONDS_IN_HOUR)).abs /
|
104
106
|
MILLISECONDS_IN_MINUTE)
|
105
107
|
end
|
108
|
+
alias_method :min, :minutes
|
106
109
|
|
107
110
|
# The seconds component.
|
108
111
|
#
|
@@ -112,6 +115,7 @@ module SDL4R
|
|
112
115
|
(minutes * MILLISECONDS_IN_MINUTE)).abs /
|
113
116
|
MILLISECONDS_IN_SECOND)
|
114
117
|
end
|
118
|
+
alias_method :sec, :seconds
|
115
119
|
|
116
120
|
# The milliseconds component.
|
117
121
|
#
|
@@ -122,6 +126,7 @@ module SDL4R
|
|
122
126
|
(minutes * MILLISECONDS_IN_MINUTE) -
|
123
127
|
(seconds * MILLISECONDS_IN_SECOND)
|
124
128
|
end
|
129
|
+
alias_method :usec, :milliseconds
|
125
130
|
|
126
131
|
# Get the total number of hours in this time span. For example, if
|
127
132
|
# this time span represents two days, this method will return 48.
|