lab419-config 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +27 -0
- data/Rakefile +20 -0
- data/config.rb +7 -0
- data/lab419-config.gemspec +30 -0
- data/lib/doc/Lab419.html +156 -0
- data/lib/doc/Lab419/Config.html +184 -0
- data/lib/doc/Lab419/Config/Data.html +372 -0
- data/lib/doc/Lab419/Config/Parser.html +469 -0
- data/lib/doc/Lab419/Config/Reader.html +604 -0
- data/lib/doc/Lab419/Config/Source.html +429 -0
- data/lib/doc/created.rid +6 -0
- data/lib/doc/index.html +115 -0
- data/lib/doc/lab419/config/data_rb.html +54 -0
- data/lib/doc/lab419/config/parser_rb.html +52 -0
- data/lib/doc/lab419/config/reader_rb.html +58 -0
- data/lib/doc/lab419/config/source_rb.html +52 -0
- data/lib/doc/lab419/config_rb.html +54 -0
- data/lib/doc/rdoc.css +701 -0
- data/lib/lab419/config.rb +2 -0
- data/lib/lab419/config/data.rb +58 -0
- data/lib/lab419/config/parser.rb +81 -0
- data/lib/lab419/config/reader.rb +80 -0
- data/lib/lab419/config/source.rb +56 -0
- data/specs/config_data_spec.rb +68 -0
- data/specs/config_reader_spec.rb +133 -0
- data/specs/config_source_spec.rb +74 -0
- data/specs/custom_handler_spec.rb +40 -0
- metadata +109 -0
data/Manifest
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
Manifest
|
2
|
+
Rakefile
|
3
|
+
config.rb
|
4
|
+
lab419-config.gemspec
|
5
|
+
lib/doc/Lab419.html
|
6
|
+
lib/doc/Lab419/Config.html
|
7
|
+
lib/doc/Lab419/Config/Data.html
|
8
|
+
lib/doc/Lab419/Config/Parser.html
|
9
|
+
lib/doc/Lab419/Config/Reader.html
|
10
|
+
lib/doc/Lab419/Config/Source.html
|
11
|
+
lib/doc/created.rid
|
12
|
+
lib/doc/index.html
|
13
|
+
lib/doc/lab419/config/data_rb.html
|
14
|
+
lib/doc/lab419/config/parser_rb.html
|
15
|
+
lib/doc/lab419/config/reader_rb.html
|
16
|
+
lib/doc/lab419/config/source_rb.html
|
17
|
+
lib/doc/lab419/config_rb.html
|
18
|
+
lib/doc/rdoc.css
|
19
|
+
lib/lab419/config.rb
|
20
|
+
lib/lab419/config/data.rb
|
21
|
+
lib/lab419/config/parser.rb
|
22
|
+
lib/lab419/config/reader.rb
|
23
|
+
lib/lab419/config/source.rb
|
24
|
+
specs/config_data_spec.rb
|
25
|
+
specs/config_reader_spec.rb
|
26
|
+
specs/config_source_spec.rb
|
27
|
+
specs/custom_handler_spec.rb
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "rake"
|
3
|
+
require "echoe"
|
4
|
+
|
5
|
+
Echoe.new "lab419-config", "0.1" do | b |
|
6
|
+
b.description = "Lab419, Labrador for Ruby1.9, Configuration File and DSL Tool"
|
7
|
+
b.summary = "Create configuration file readers or DSLs with a highly adaptable configuration reader"
|
8
|
+
b.url = "http://bitbucket.org/robertdober/lab419/"
|
9
|
+
b.author = "Robert Dober"
|
10
|
+
b.email = "robert.dober@gmail.com"
|
11
|
+
b.ignore_pattern = %w{ tmp/* .*.sw? doc/* }
|
12
|
+
b.development_dependencies = []
|
13
|
+
end
|
14
|
+
|
15
|
+
Dir[ File.join( File.dirname( __FILE__ ), %w{ tasks *.rake } ) ].
|
16
|
+
sort.
|
17
|
+
each do | ext |
|
18
|
+
load ext
|
19
|
+
end
|
20
|
+
|
data/config.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{lab419-config}
|
5
|
+
s.version = "0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Robert Dober"]
|
9
|
+
s.date = %q{2010-05-23}
|
10
|
+
s.description = %q{Lab419, Labrador for Ruby1.9, Configuration File and DSL Tool}
|
11
|
+
s.email = %q{robert.dober@gmail.com}
|
12
|
+
s.extra_rdoc_files = ["lib/doc/Lab419.html", "lib/doc/Lab419/Config.html", "lib/doc/Lab419/Config/Data.html", "lib/doc/Lab419/Config/Parser.html", "lib/doc/Lab419/Config/Reader.html", "lib/doc/Lab419/Config/Source.html", "lib/doc/created.rid", "lib/doc/index.html", "lib/doc/lab419/config/data_rb.html", "lib/doc/lab419/config/parser_rb.html", "lib/doc/lab419/config/reader_rb.html", "lib/doc/lab419/config/source_rb.html", "lib/doc/lab419/config_rb.html", "lib/doc/rdoc.css", "lib/lab419/config.rb", "lib/lab419/config/data.rb", "lib/lab419/config/parser.rb", "lib/lab419/config/reader.rb", "lib/lab419/config/source.rb"]
|
13
|
+
s.files = ["Manifest", "Rakefile", "config.rb", "lab419-config.gemspec", "lib/doc/Lab419.html", "lib/doc/Lab419/Config.html", "lib/doc/Lab419/Config/Data.html", "lib/doc/Lab419/Config/Parser.html", "lib/doc/Lab419/Config/Reader.html", "lib/doc/Lab419/Config/Source.html", "lib/doc/created.rid", "lib/doc/index.html", "lib/doc/lab419/config/data_rb.html", "lib/doc/lab419/config/parser_rb.html", "lib/doc/lab419/config/reader_rb.html", "lib/doc/lab419/config/source_rb.html", "lib/doc/lab419/config_rb.html", "lib/doc/rdoc.css", "lib/lab419/config.rb", "lib/lab419/config/data.rb", "lib/lab419/config/parser.rb", "lib/lab419/config/reader.rb", "lib/lab419/config/source.rb", "specs/config_data_spec.rb", "specs/config_reader_spec.rb", "specs/config_source_spec.rb", "specs/custom_handler_spec.rb"]
|
14
|
+
s.homepage = %q{http://bitbucket.org/robertdober/lab419/}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Lab419-config"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{lab419-config}
|
18
|
+
s.rubygems_version = %q{1.3.6}
|
19
|
+
s.summary = %q{Create configuration file readers or DSLs with a highly adaptable configuration reader}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/lib/doc/Lab419.html
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: Lab419</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="module">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lab419/config/parser_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lab419/config/parser.rb">lab419/config/parser.rb</a></li>
|
43
|
+
|
44
|
+
<li><a href="./lab419/config/data_rb.html?TB_iframe=true&height=550&width=785"
|
45
|
+
class="thickbox" title="lab419/config/data.rb">lab419/config/data.rb</a></li>
|
46
|
+
|
47
|
+
<li><a href="./lab419/config/source_rb.html?TB_iframe=true&height=550&width=785"
|
48
|
+
class="thickbox" title="lab419/config/source.rb">lab419/config/source.rb</a></li>
|
49
|
+
|
50
|
+
<li><a href="./lab419/config/reader_rb.html?TB_iframe=true&height=550&width=785"
|
51
|
+
class="thickbox" title="lab419/config/reader.rb">lab419/config/reader.rb</a></li>
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<!-- Parent Class -->
|
63
|
+
|
64
|
+
|
65
|
+
<!-- Namespace Contents -->
|
66
|
+
|
67
|
+
<div id="namespace-list-section" class="section">
|
68
|
+
<h3 class="section-header">Namespace</h3>
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
<li><span class="type">MODULE</span> <a href="Lab419/Config.html">Lab419::Config</a></li>
|
72
|
+
|
73
|
+
</ul>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
|
77
|
+
<!-- Method Quickref -->
|
78
|
+
|
79
|
+
|
80
|
+
<!-- Included Modules -->
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div id="project-metadata">
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<div id="classindex-section" class="section project-section">
|
89
|
+
<h3 class="section-header">Class Index
|
90
|
+
<span class="search-toggle"><img src="./images/find.png"
|
91
|
+
height="16" width="16" alt="[+]"
|
92
|
+
title="show/hide quicksearch" /></span></h3>
|
93
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
94
|
+
<fieldset>
|
95
|
+
<legend>Quicksearch</legend>
|
96
|
+
<input type="text" name="quicksearch" value=""
|
97
|
+
class="quicksearch-field" />
|
98
|
+
</fieldset>
|
99
|
+
</form>
|
100
|
+
|
101
|
+
<ul class="link-list">
|
102
|
+
|
103
|
+
<li><a href="./Lab419.html">Lab419</a></li>
|
104
|
+
|
105
|
+
<li><a href="./Lab419/Config.html">Lab419::Config</a></li>
|
106
|
+
|
107
|
+
<li><a href="./Lab419/Config/Data.html">Lab419::Config::Data</a></li>
|
108
|
+
|
109
|
+
<li><a href="./Lab419/Config/Parser.html">Lab419::Config::Parser</a></li>
|
110
|
+
|
111
|
+
<li><a href="./Lab419/Config/Reader.html">Lab419::Config::Reader</a></li>
|
112
|
+
|
113
|
+
<li><a href="./Lab419/Config/Source.html">Lab419::Config::Source</a></li>
|
114
|
+
|
115
|
+
</ul>
|
116
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div id="documentation">
|
124
|
+
<h1 class="module">Lab419</h1>
|
125
|
+
|
126
|
+
<div id="description">
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<!-- Constants -->
|
131
|
+
|
132
|
+
|
133
|
+
<!-- Attributes -->
|
134
|
+
|
135
|
+
|
136
|
+
<!-- Methods -->
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
143
|
+
|
144
|
+
<p>Disabled; run with --debug to generate this.</p>
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div id="validator-badges">
|
149
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
150
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
151
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
</body>
|
155
|
+
</html>
|
156
|
+
|
@@ -0,0 +1,184 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: Lab419::Config</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="module">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="../index.html">Home</a>
|
29
|
+
<a href="../index.html#classes">Classes</a>
|
30
|
+
<a href="../index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="../lab419/config/parser_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lab419/config/parser.rb">lab419/config/parser.rb</a></li>
|
43
|
+
|
44
|
+
<li><a href="../lab419/config/data_rb.html?TB_iframe=true&height=550&width=785"
|
45
|
+
class="thickbox" title="lab419/config/data.rb">lab419/config/data.rb</a></li>
|
46
|
+
|
47
|
+
<li><a href="../lab419/config/source_rb.html?TB_iframe=true&height=550&width=785"
|
48
|
+
class="thickbox" title="lab419/config/source.rb">lab419/config/source.rb</a></li>
|
49
|
+
|
50
|
+
<li><a href="../lab419/config/reader_rb.html?TB_iframe=true&height=550&width=785"
|
51
|
+
class="thickbox" title="lab419/config/reader.rb">lab419/config/reader.rb</a></li>
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<!-- Parent Class -->
|
63
|
+
|
64
|
+
|
65
|
+
<!-- Namespace Contents -->
|
66
|
+
|
67
|
+
<div id="namespace-list-section" class="section">
|
68
|
+
<h3 class="section-header">Namespace</h3>
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
<li><span class="type">MODULE</span> <a href="Config/Parser.html">Lab419::Config::Parser</a></li>
|
72
|
+
|
73
|
+
<li><span class="type">CLASS</span> <a href="Config/Data.html">Lab419::Config::Data</a></li>
|
74
|
+
|
75
|
+
<li><span class="type">CLASS</span> <a href="Config/Reader.html">Lab419::Config::Reader</a></li>
|
76
|
+
|
77
|
+
<li><span class="type">CLASS</span> <a href="Config/Source.html">Lab419::Config::Source</a></li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
<!-- Method Quickref -->
|
84
|
+
|
85
|
+
|
86
|
+
<!-- Included Modules -->
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
<div id="project-metadata">
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<div id="classindex-section" class="section project-section">
|
95
|
+
<h3 class="section-header">Class Index
|
96
|
+
<span class="search-toggle"><img src="../images/find.png"
|
97
|
+
height="16" width="16" alt="[+]"
|
98
|
+
title="show/hide quicksearch" /></span></h3>
|
99
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
100
|
+
<fieldset>
|
101
|
+
<legend>Quicksearch</legend>
|
102
|
+
<input type="text" name="quicksearch" value=""
|
103
|
+
class="quicksearch-field" />
|
104
|
+
</fieldset>
|
105
|
+
</form>
|
106
|
+
|
107
|
+
<ul class="link-list">
|
108
|
+
|
109
|
+
<li><a href="../Lab419.html">Lab419</a></li>
|
110
|
+
|
111
|
+
<li><a href="../Lab419/Config.html">Lab419::Config</a></li>
|
112
|
+
|
113
|
+
<li><a href="../Lab419/Config/Data.html">Lab419::Config::Data</a></li>
|
114
|
+
|
115
|
+
<li><a href="../Lab419/Config/Parser.html">Lab419::Config::Parser</a></li>
|
116
|
+
|
117
|
+
<li><a href="../Lab419/Config/Reader.html">Lab419::Config::Reader</a></li>
|
118
|
+
|
119
|
+
<li><a href="../Lab419/Config/Source.html">Lab419::Config::Source</a></li>
|
120
|
+
|
121
|
+
</ul>
|
122
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div id="documentation">
|
130
|
+
<h1 class="module">Lab419::Config</h1>
|
131
|
+
|
132
|
+
<div id="description">
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<!-- Constants -->
|
137
|
+
|
138
|
+
<div id="constants-list" class="section">
|
139
|
+
<h3 class="section-header">Constants</h3>
|
140
|
+
<dl>
|
141
|
+
|
142
|
+
<dt><a name="IllegalMonitorState">IllegalMonitorState</a></dt>
|
143
|
+
|
144
|
+
<dd class="description"></dd>
|
145
|
+
|
146
|
+
|
147
|
+
<dt><a name="IllegalHandlerSpec">IllegalHandlerSpec</a></dt>
|
148
|
+
|
149
|
+
<dd class="description"></dd>
|
150
|
+
|
151
|
+
|
152
|
+
<dt><a name="DataError">DataError</a></dt>
|
153
|
+
|
154
|
+
<dd class="description"></dd>
|
155
|
+
|
156
|
+
|
157
|
+
</dl>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
|
161
|
+
<!-- Attributes -->
|
162
|
+
|
163
|
+
|
164
|
+
<!-- Methods -->
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
171
|
+
|
172
|
+
<p>Disabled; run with --debug to generate this.</p>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div id="validator-badges">
|
177
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
178
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
179
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</body>
|
183
|
+
</html>
|
184
|
+
|
@@ -0,0 +1,372 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Lab419::Config::Data</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../../js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="../../js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="../../js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="../../js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="../../index.html">Home</a>
|
29
|
+
<a href="../../index.html#classes">Classes</a>
|
30
|
+
<a href="../../index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="../../lab419/config/data_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lab419/config/data.rb">lab419/config/data.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">Object</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#M000009">::new</a></li>
|
73
|
+
|
74
|
+
<li><a href="#M000007">#[]</a></li>
|
75
|
+
|
76
|
+
<li><a href="#M000008">#[]=</a></li>
|
77
|
+
|
78
|
+
<li><a href="#M000010">#method_missing</a></li>
|
79
|
+
|
80
|
+
<li><a href="#M000011">#store_value</a></li>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- Included Modules -->
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
<div id="project-metadata">
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<div id="classindex-section" class="section project-section">
|
95
|
+
<h3 class="section-header">Class Index
|
96
|
+
<span class="search-toggle"><img src="../../images/find.png"
|
97
|
+
height="16" width="16" alt="[+]"
|
98
|
+
title="show/hide quicksearch" /></span></h3>
|
99
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
100
|
+
<fieldset>
|
101
|
+
<legend>Quicksearch</legend>
|
102
|
+
<input type="text" name="quicksearch" value=""
|
103
|
+
class="quicksearch-field" />
|
104
|
+
</fieldset>
|
105
|
+
</form>
|
106
|
+
|
107
|
+
<ul class="link-list">
|
108
|
+
|
109
|
+
<li><a href="../../Lab419.html">Lab419</a></li>
|
110
|
+
|
111
|
+
<li><a href="../../Lab419/Config.html">Lab419::Config</a></li>
|
112
|
+
|
113
|
+
<li><a href="../../Lab419/Config/Data.html">Lab419::Config::Data</a></li>
|
114
|
+
|
115
|
+
<li><a href="../../Lab419/Config/Parser.html">Lab419::Config::Parser</a></li>
|
116
|
+
|
117
|
+
<li><a href="../../Lab419/Config/Reader.html">Lab419::Config::Reader</a></li>
|
118
|
+
|
119
|
+
<li><a href="../../Lab419/Config/Source.html">Lab419::Config::Source</a></li>
|
120
|
+
|
121
|
+
</ul>
|
122
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div id="documentation">
|
130
|
+
<h1 class="class">Lab419::Config::Data</h1>
|
131
|
+
|
132
|
+
<div id="description">
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<!-- Constants -->
|
137
|
+
|
138
|
+
|
139
|
+
<!-- Attributes -->
|
140
|
+
|
141
|
+
|
142
|
+
<!-- Methods -->
|
143
|
+
|
144
|
+
<div id="public-class-method-details" class="method-section section">
|
145
|
+
<h3 class="section-header">Public Class Methods</h3>
|
146
|
+
|
147
|
+
|
148
|
+
<div id="new-method" class="method-detail ">
|
149
|
+
<a name="M000009"></a>
|
150
|
+
|
151
|
+
<div class="method-heading">
|
152
|
+
|
153
|
+
<span class="method-name">new</span><span
|
154
|
+
class="method-args">()</span>
|
155
|
+
<span class="method-click-advice">click to toggle source</span>
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div class="method-description">
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<div class="method-source-code"
|
166
|
+
id="new-source">
|
167
|
+
<pre>
|
168
|
+
<span class="ruby-comment cmt"># File lab419/config/data.rb, line 18</span>
|
169
|
+
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
170
|
+
19: <span class="ruby-ivar">@store</span> = {}
|
171
|
+
20: <span class="ruby-keyword kw">end</span></pre>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div id="public-instance-method-details" class="method-section section">
|
185
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
186
|
+
|
187
|
+
|
188
|
+
<div id="--method" class="method-detail ">
|
189
|
+
<a name="M000007"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
|
193
|
+
<span class="method-name">[]</span><span
|
194
|
+
class="method-args">(key)</span>
|
195
|
+
<span class="method-click-advice">click to toggle source</span>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<div class="method-source-code"
|
206
|
+
id="--source">
|
207
|
+
<pre>
|
208
|
+
<span class="ruby-comment cmt"># File lab419/config/data.rb, line 6</span>
|
209
|
+
6: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span> <span class="ruby-identifier">key</span>
|
210
|
+
7: <span class="ruby-ivar">@store</span>[ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span> ]
|
211
|
+
8: <span class="ruby-keyword kw">end</span></pre>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="--method" class="method-detail ">
|
223
|
+
<a name="M000008"></a>
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
|
227
|
+
<span class="method-name">[]=</span><span
|
228
|
+
class="method-args">(key, val)</span>
|
229
|
+
<span class="method-click-advice">click to toggle source</span>
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-source-code"
|
240
|
+
id="--source">
|
241
|
+
<pre>
|
242
|
+
<span class="ruby-comment cmt"># File lab419/config/data.rb, line 9</span>
|
243
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>
|
244
|
+
10: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">key</span>
|
245
|
+
11: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
246
|
+
12: <span class="ruby-identifier">store_value</span> <span class="ruby-identifier">val</span>, <span class="ruby-identifier">key</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"."</span>)
|
247
|
+
13: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Symbol</span>
|
248
|
+
14: <span class="ruby-ivar">@store</span>[ <span class="ruby-identifier">key</span> ] = <span class="ruby-identifier">val</span>
|
249
|
+
15: <span class="ruby-keyword kw">end</span>
|
250
|
+
16: <span class="ruby-keyword kw">end</span></pre>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
<div id="private-instance-method-details" class="method-section section">
|
264
|
+
<h3 class="section-header">Private Instance Methods</h3>
|
265
|
+
|
266
|
+
|
267
|
+
<div id="method-missing-method" class="method-detail ">
|
268
|
+
<a name="M000010"></a>
|
269
|
+
|
270
|
+
<div class="method-heading">
|
271
|
+
|
272
|
+
<span class="method-name">method_missing</span><span
|
273
|
+
class="method-args">(name, *args, &blk)</span>
|
274
|
+
<span class="method-click-advice">click to toggle source</span>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div class="method-description">
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<div class="method-source-code"
|
285
|
+
id="method-missing-source">
|
286
|
+
<pre>
|
287
|
+
<span class="ruby-comment cmt"># File lab419/config/data.rb, line 21</span>
|
288
|
+
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span> <span class="ruby-identifier">name</span>, *<span class="ruby-identifier">args</span>, &<span class="ruby-identifier">blk</span>
|
289
|
+
22: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">super</span>( <span class="ruby-identifier">name</span>, *<span class="ruby-identifier">args</span>, &<span class="ruby-identifier">blk</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">nil?</span>
|
290
|
+
23: <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">fetch</span>( <span class="ruby-identifier">name</span> ){ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"No such key #{name}"</span> }
|
291
|
+
24: <span class="ruby-keyword kw">end</span></pre>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
</div>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
|
302
|
+
<div id="store-value-method" class="method-detail ">
|
303
|
+
<a name="M000011"></a>
|
304
|
+
|
305
|
+
<div class="method-heading">
|
306
|
+
|
307
|
+
<span class="method-name">store_value</span><span
|
308
|
+
class="method-args">(val, keys)</span>
|
309
|
+
<span class="method-click-advice">click to toggle source</span>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div class="method-description">
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method-source-code"
|
320
|
+
id="store-value-source">
|
321
|
+
<pre>
|
322
|
+
<span class="ruby-comment cmt"># File lab419/config/data.rb, line 25</span>
|
323
|
+
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_value</span> <span class="ruby-identifier">val</span>, <span class="ruby-identifier">keys</span>
|
324
|
+
26: <span class="ruby-comment cmt"># TODO: This needs HEAVY refactoring</span>
|
325
|
+
27: <span class="ruby-identifier">last_key</span> = <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">pop</span>
|
326
|
+
28: <span class="ruby-identifier">child</span> = <span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@store</span>
|
327
|
+
29: <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">|</span>
|
328
|
+
30: <span class="ruby-identifier">child</span> = <span class="ruby-identifier">parent</span>[ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span> ]
|
329
|
+
31: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">child</span>
|
330
|
+
32: <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>
|
331
|
+
33: <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">child</span>
|
332
|
+
34: <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
|
333
|
+
35: <span class="ruby-identifier">parent</span>[ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span> ] = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>
|
334
|
+
36: <span class="ruby-identifier">child</span> = <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">parent</span>[ <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span> ]
|
335
|
+
37: <span class="ruby-keyword kw">else</span>
|
336
|
+
38: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"cannot reassign to #{child}"</span>
|
337
|
+
39: <span class="ruby-keyword kw">end</span>
|
338
|
+
40: <span class="ruby-keyword kw">end</span>
|
339
|
+
41: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"cannot reassign to #{child[last_key]}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span>[<span class="ruby-identifier">last_key</span>]
|
340
|
+
42: <span class="ruby-identifier">child</span>[ <span class="ruby-identifier">last_key</span>.<span class="ruby-identifier">to_sym</span> ] = <span class="ruby-identifier">val</span>
|
341
|
+
43: <span class="ruby-keyword kw">end</span></pre>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
|
352
|
+
</div>
|
353
|
+
|
354
|
+
|
355
|
+
</div>
|
356
|
+
|
357
|
+
|
358
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
359
|
+
|
360
|
+
<p>Disabled; run with --debug to generate this.</p>
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
<div id="validator-badges">
|
365
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
366
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
367
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
368
|
+
</div>
|
369
|
+
|
370
|
+
</body>
|
371
|
+
</html>
|
372
|
+
|