ember 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +79 -0
- data/INSTALL +31 -0
- data/MANUAL +25 -0
- data/README +54 -0
- data/THEORY +151 -0
- data/USAGE +250 -0
- data/bin/ember +58 -20
- data/doc/ann.xml +93 -0
- data/doc/api/Ember.html +436 -0
- data/doc/api/Ember/Template.html +774 -0
- data/doc/api/Ember/Template/Program.html +877 -0
- data/doc/api/Ember/Template/Program/Statement.html +181 -0
- data/doc/api/_index.html +139 -0
- data/doc/api/class_list.html +36 -0
- data/doc/api/css/common.css +1 -0
- data/doc/api/css/full_list.css +50 -0
- data/doc/api/css/style.css +273 -0
- data/doc/api/file.LICENSE.html +73 -0
- data/doc/api/file_list.html +38 -0
- data/doc/api/frames.html +13 -0
- data/doc/api/index.html +72 -13
- data/doc/api/js/app.js +111 -0
- data/doc/api/js/full_list.js +117 -0
- data/doc/api/js/{jquery-1.3.2.min.js → jquery.js} +0 -0
- data/doc/api/method_list.html +179 -0
- data/doc/api/top-level-namespace.html +87 -0
- data/doc/index.html +1353 -682
- data/inochi.opts +31 -0
- data/lib/ember.rb +1 -15
- data/lib/ember/inochi.rb +103 -0
- data/lib/ember/template.rb +66 -78
- data/test/combinatorics.rb +188 -0
- data/test/ember/template_test.rb +137 -0
- data/test/runner +25 -0
- data/test/test_helper.rb +5 -0
- metadata +61 -51
- data/doc/api/apple-touch-icon.png +0 -0
- data/doc/api/classes/Ember.html +0 -61
- data/doc/api/classes/Ember/Template.html +0 -413
- data/doc/api/classes/Ember/Template/Program.html +0 -60
- data/doc/api/created.rid +0 -1
- data/doc/api/css/main.css +0 -263
- data/doc/api/css/panel.css +0 -383
- data/doc/api/css/reset.css +0 -53
- data/doc/api/favicon.ico +0 -0
- data/doc/api/files/LICENSE.html +0 -76
- data/doc/api/files/lib/ember/template_rb.html +0 -66
- data/doc/api/files/lib/ember_rb.html +0 -63
- data/doc/api/i/arrows.png +0 -0
- data/doc/api/i/results_bg.png +0 -0
- data/doc/api/i/tree_bg.png +0 -0
- data/doc/api/js/jquery-effect.js +0 -593
- data/doc/api/js/main.js +0 -22
- data/doc/api/js/searchdoc.js +0 -628
- data/doc/api/panel/index.html +0 -71
- data/doc/api/panel/search_index.js +0 -1
- data/doc/api/panel/tree.js +0 -1
- data/doc/history.erb +0 -34
- data/doc/index.erb +0 -11
- data/doc/intro.erb +0 -53
- data/doc/setup.erb +0 -78
- data/doc/usage.erb +0 -280
- data/rakefile +0 -14
- data/test/ember.rb +0 -17
- data/test/ember/template.rb +0 -141
data/bin/ember
CHANGED
@@ -1,38 +1,76 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
#
|
3
3
|
# Evaluates eRuby directives in the given eRuby template and
|
4
4
|
# writes the result to the standard output stream (STDOUT).
|
5
5
|
#
|
6
|
-
#
|
7
6
|
# Usage:
|
8
7
|
#
|
9
|
-
# ember [Options] [
|
10
|
-
#
|
8
|
+
# ember [Options] [TemplateFile]
|
11
9
|
#
|
12
|
-
#
|
13
|
-
# not specified, then the result of reading the standard
|
14
|
-
# input stream (STDIN) will be used as the eRuby template.
|
10
|
+
# TemplateFile:
|
15
11
|
#
|
12
|
+
# Path to the eRuby template file that you want to evaluate. If
|
13
|
+
# this parameter is not specified, then the result of reading the
|
14
|
+
# standard input stream (STDIN) will be used as the eRuby template.
|
16
15
|
#
|
17
16
|
# Options:
|
18
17
|
#
|
18
|
+
# -s, --shorthand:
|
19
|
+
#
|
20
|
+
# Treat lines beginning with zero or more whitespace
|
21
|
+
# followed by the "%" character as eRuby directives.
|
22
|
+
#
|
23
|
+
# -i, --infer_end:
|
24
|
+
#
|
25
|
+
# Add missing <% end %> directives based on indentation.
|
26
|
+
#
|
27
|
+
# -u, --unindent:
|
28
|
+
#
|
29
|
+
# Unindent the bodies of eRuby blocks.
|
30
|
+
#
|
31
|
+
# -c, --compile:
|
32
|
+
#
|
33
|
+
# Print underlying Ruby program compiled
|
34
|
+
# from the input eRuby template and exit.
|
35
|
+
#
|
36
|
+
# -h, --help:
|
37
|
+
#
|
38
|
+
# Print this message and exit.
|
39
|
+
#
|
40
|
+
# -v, --version:
|
41
|
+
#
|
42
|
+
# Print version number and exit.
|
43
|
+
#
|
19
44
|
|
20
|
-
|
21
|
-
|
22
|
-
# See LICENSE file for details.
|
23
|
-
#++
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
gem 'inochi', '~> 1'
|
27
|
-
require 'inochi'
|
45
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
46
|
+
require 'ember'
|
28
47
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
48
|
+
# parse command line
|
49
|
+
if ARGV.delete('-h') or ARGV.delete('--help')
|
50
|
+
puts
|
51
|
+
puts [Ember::PROJECT, Ember::TAGLINE].join(' - ')
|
52
|
+
puts
|
53
|
+
puts File.read(__FILE__)[/^#(\r?\n)(.*?)\1\1/m, 2].gsub(/^# ?/, '')
|
54
|
+
puts
|
55
|
+
puts 'See the user manual for more information:'
|
56
|
+
puts
|
57
|
+
puts ' ' + File.join(Ember::INSTDIR, 'doc', 'index.html')
|
58
|
+
puts
|
59
|
+
puts ' ' + Ember::WEBSITE
|
60
|
+
puts
|
61
|
+
exit
|
62
|
+
elsif ARGV.delete('-v') or ARGV.delete('--version')
|
63
|
+
puts Ember::VERSION
|
64
|
+
exit
|
34
65
|
end
|
35
66
|
|
67
|
+
options = {
|
68
|
+
:shorthand => ARGV.delete('-s') || ARGV.delete('--shorthand'),
|
69
|
+
:infer_end => ARGV.delete('-i') || ARGV.delete('--infer_end'),
|
70
|
+
:unindent => ARGV.delete('-u') || ARGV.delete('--unindent'),
|
71
|
+
:compile => ARGV.delete('-c') || ARGV.delete('--compile'),
|
72
|
+
}
|
73
|
+
|
36
74
|
template =
|
37
75
|
if source = ARGV.shift
|
38
76
|
Ember::Template.load_file(source, options)
|
data/doc/ann.xml
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<rss version="2.0"
|
3
|
+
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
4
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
5
|
+
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
|
6
|
+
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
|
7
|
+
<channel>
|
8
|
+
<title>[ANN] Ember</title>
|
9
|
+
<link>http://snk.tuxfamily.org/lib/ember/</link>
|
10
|
+
<description>eRuby template processor</description>
|
11
|
+
<item>
|
12
|
+
<title>Version 0.1.0 (2010-04-03)</title>
|
13
|
+
<link>http://snk.tuxfamily.org/lib/ember/</link>
|
14
|
+
<description>
|
15
|
+
<center>
|
16
|
+
<h1>Ember</h1>
|
17
|
+
<h2>eRuby template processor</h2>
|
18
|
+
<p>http://snk.tuxfamily.org/lib/ember/</p>
|
19
|
+
</center>
|
20
|
+
<p>Ember (<em>EMBE</em>dded <em>R</em>uby) is an <a href='http://en.wikipedia.org/wiki/ERuby'>eRuby template</a> processor that enables debugging, reduces markup, and improves composability of eRuby templates.</p>
|
21
|
+
|
22
|
+
<ul>
|
23
|
+
<li>It reports correct line numbers in error message stack traces.</li>
|
24
|
+
|
25
|
+
<li>It can infer <tt>&lt;% end %&gt;</tt> based on indentation.</li>
|
26
|
+
|
27
|
+
<li>It can unindent block content hierarchically.</li>
|
28
|
+
|
29
|
+
<li>It completely silences code-only eRuby directives.</li>
|
30
|
+
|
31
|
+
<li>It is implemented in 364 lines of pure Ruby.</li>
|
32
|
+
</ul>
|
33
|
+
<div>
|
34
|
+
<div class="section" id="Version-0-1-0-2010-04-03">
|
35
|
+
<a name="Version-0-1-0-2010-04-03"/>
|
36
|
+
<h1 class="title">
|
37
|
+
Version 0.1.0 (2010-04-03)
|
38
|
+
</h1>
|
39
|
+
<div class="content"><p>This release improves the handling of eRuby comment directives, fixes a bug in the <code class="line">&lt;<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">% </span><span style="">end</span><span style="color:#710"> </span></span>%&gt;</code> inference logic, and performs some minor housekeeping.</p>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="paragraph" id="New-features">
|
43
|
+
<a name="New-features"/>
|
44
|
+
<p class="title">New features</p>
|
45
|
+
<div class="content"><ul>
|
46
|
+
<li>
|
47
|
+
<p>Single-line comment directives are now ignored (treated like no-ops) in input templates. This allows us to surround eRuby block directives with section separators made from single-line comment directives:</p>
|
48
|
+
|
49
|
+
<pre>%|some_block_directive
|
50
|
+
|
51
|
+
Inside some_block_directive.
|
52
|
+
|
53
|
+
%#-----------------------------------------------------------------
|
54
|
+
|
55
|
+
Still inside some_block_directive!
|
56
|
+
|
57
|
+
%#---------------------------------------------------------------
|
58
|
+
%| nested_block_directive
|
59
|
+
%#---------------------------------------------------------------
|
60
|
+
|
61
|
+
Inside nested_block_directive.</pre>
|
62
|
+
</li>
|
63
|
+
</ul></div>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<div class="paragraph" id="Bug-fixes">
|
69
|
+
<a name="Bug-fixes"/>
|
70
|
+
<p class="title">Bug fixes</p>
|
71
|
+
<div class="content"><ul>
|
72
|
+
<li><code class="line">&lt;<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">% </span><span style="">end</span><span style="color:#710"> </span></span>%&gt;</code> inference did not work for blocks beginning with <code class="line"><span style="color:#080;font-weight:bold">def</span></code>, <code class="line"><span style="color:#080;font-weight:bold">class</span></code>, and <code class="line"><span style="color:#080;font-weight:bold">module</span></code> keywords.</li>
|
73
|
+
</ul></div>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<div class="paragraph" id="Housekeeping">
|
79
|
+
<a name="Housekeeping"/>
|
80
|
+
<p class="title">Housekeeping</p>
|
81
|
+
<div class="content"><ul>
|
82
|
+
<li>Upgrade to Inochi 2.0.0-rc3. This project no longer depends on the &#8220;inochi&#8221; or &#8220;trollop&#8221; gems at runtime.</li>
|
83
|
+
</ul></div>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</description>
|
89
|
+
<pubDate>Sat, 03 Apr 2010 00:00:00 -0700</pubDate>
|
90
|
+
<dc:date>2010-04-03T00:00:00-07:00</dc:date>
|
91
|
+
</item>
|
92
|
+
</channel>
|
93
|
+
</rss>
|
data/doc/api/Ember.html
ADDED
@@ -0,0 +1,436 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Module: Ember</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="_index.html">Index (E)</a> »
|
27
|
+
|
28
|
+
|
29
|
+
<span class="title">Ember</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Module: Ember
|
47
|
+
|
48
|
+
|
49
|
+
</h1>
|
50
|
+
|
51
|
+
<dl class="box">
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<dt class="r1 last">Defined in:</dt>
|
61
|
+
<dd class="r1 last">lib/ember/inochi.rb<span class="defines">,<br />
|
62
|
+
lib/ember/template.rb</span>
|
63
|
+
</dd>
|
64
|
+
|
65
|
+
</dl>
|
66
|
+
<div class="clear"></div>
|
67
|
+
|
68
|
+
<h2>Defined Under Namespace</h2>
|
69
|
+
<p class="children">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<strong class="classes">Classes:</strong> <a href="Ember/Template.html" title="Ember::Template (class)">Template</a>
|
75
|
+
|
76
|
+
|
77
|
+
</p>
|
78
|
+
|
79
|
+
<h2>Constant Summary</h2>
|
80
|
+
|
81
|
+
<dl class="constants">
|
82
|
+
|
83
|
+
<dt id="PROJECT-constant" class="">PROJECT =
|
84
|
+
<div class="docstring">
|
85
|
+
<div class="discussion">
|
86
|
+
<p>
|
87
|
+
Official name of this project.
|
88
|
+
</p>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<div class="tags">
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</dt>
|
97
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Ember</span><span class='tstring_end'>"</span></span></pre></dd>
|
98
|
+
|
99
|
+
<dt id="TAGLINE-constant" class="">TAGLINE =
|
100
|
+
<div class="docstring">
|
101
|
+
<div class="discussion">
|
102
|
+
<p>
|
103
|
+
Short single-line description of this project.
|
104
|
+
</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</dt>
|
113
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>eRuby template processor</span><span class='tstring_end'>"</span></span></pre></dd>
|
114
|
+
|
115
|
+
<dt id="WEBSITE-constant" class="">WEBSITE =
|
116
|
+
<div class="docstring">
|
117
|
+
<div class="discussion">
|
118
|
+
<p>
|
119
|
+
Address of this project’s official home page.
|
120
|
+
</p>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
<div class="tags">
|
126
|
+
|
127
|
+
</div>
|
128
|
+
</dt>
|
129
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://snk.tuxfamily.org/lib/ember/</span><span class='tstring_end'>"</span></span></pre></dd>
|
130
|
+
|
131
|
+
<dt id="VERSION-constant" class="">VERSION =
|
132
|
+
<div class="docstring">
|
133
|
+
<div class="discussion">
|
134
|
+
<p>
|
135
|
+
Number of this release of this project.
|
136
|
+
</p>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
<div class="tags">
|
142
|
+
|
143
|
+
</div>
|
144
|
+
</dt>
|
145
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>"</span></span></pre></dd>
|
146
|
+
|
147
|
+
<dt id="RELDATE-constant" class="">RELDATE =
|
148
|
+
<div class="docstring">
|
149
|
+
<div class="discussion">
|
150
|
+
<p>
|
151
|
+
Date of this release of this project.
|
152
|
+
</p>
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
<div class="tags">
|
158
|
+
|
159
|
+
</div>
|
160
|
+
</dt>
|
161
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2010-04-03</span><span class='tstring_end'>"</span></span></pre></dd>
|
162
|
+
|
163
|
+
<dt id="INSTDIR-constant" class="">INSTDIR =
|
164
|
+
<div class="docstring">
|
165
|
+
<div class="discussion">
|
166
|
+
<p>
|
167
|
+
Location of this release of this project.
|
168
|
+
</p>
|
169
|
+
|
170
|
+
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
<div class="tags">
|
174
|
+
|
175
|
+
</div>
|
176
|
+
</dt>
|
177
|
+
<dd><pre class="code"><span class='const'>File</span><span class='period'>.</span><span class='id expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../../..</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>__FILE__</span><span class='rparen'>)</span></pre></dd>
|
178
|
+
|
179
|
+
<dt id="RUNTIME-constant" class="">RUNTIME =
|
180
|
+
<div class="docstring">
|
181
|
+
<div class="discussion">
|
182
|
+
<p>
|
183
|
+
RubyGems required by this project during runtime.
|
184
|
+
</p>
|
185
|
+
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
<div class="tags">
|
190
|
+
|
191
|
+
<div class="examples">
|
192
|
+
<h3>Examples:</h3>
|
193
|
+
|
194
|
+
<h4><div class='inline'></div></h4>
|
195
|
+
<pre class="example code">
|
196
|
+
<span class='const'>RUNTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
197
|
+
<span class='comment'># this project needs exactly version 1.2.3 of the "an_example" gem
|
198
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
199
|
+
|
200
|
+
<span class='comment'># this project needs at least version 1.2 (but not
|
201
|
+
</span> <span class='comment'># version 1.2.4 or newer) of the "another_example" gem
|
202
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>>= 1.2</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>< 1.2.4</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
203
|
+
|
204
|
+
<span class='comment'># this project needs any version of the "yet_another_example" gem
|
205
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
206
|
+
<span class='rbrace'>}</span></pre>
|
207
|
+
|
208
|
+
</div>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</dt>
|
212
|
+
<dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd>
|
213
|
+
|
214
|
+
<dt id="DEVTIME-constant" class="">DEVTIME =
|
215
|
+
<div class="docstring">
|
216
|
+
<div class="discussion">
|
217
|
+
<p>
|
218
|
+
RubyGems required by this project during development.
|
219
|
+
</p>
|
220
|
+
|
221
|
+
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
<div class="tags">
|
225
|
+
|
226
|
+
<div class="examples">
|
227
|
+
<h3>Examples:</h3>
|
228
|
+
|
229
|
+
<h4><div class='inline'></div></h4>
|
230
|
+
<pre class="example code">
|
231
|
+
<span class='const'>DEVTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
232
|
+
<span class='comment'># this project needs exactly version 1.2.3 of the "an_example" gem
|
233
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
234
|
+
|
235
|
+
<span class='comment'># this project needs at least version 1.2 (but not
|
236
|
+
</span> <span class='comment'># version 1.2.4 or newer) of the "another_example" gem
|
237
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>>= 1.2</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>< 1.2.4</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
238
|
+
|
239
|
+
<span class='comment'># this project needs any version of the "yet_another_example" gem
|
240
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
241
|
+
<span class='rbrace'>}</span></pre>
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
</div>
|
246
|
+
</dt>
|
247
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
248
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>inochi</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~> 2</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> <span class='comment'># for managing this project
|
249
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dfect</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~> 2</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> <span class='comment'># for unit testing
|
250
|
+
</span><span class='rbrace'>}</span></pre></dd>
|
251
|
+
|
252
|
+
</dl>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
<h2>Class Method Summary</h2>
|
259
|
+
|
260
|
+
<ul class="summary">
|
261
|
+
|
262
|
+
<li class="public ">
|
263
|
+
<span class="summary_signature">
|
264
|
+
|
265
|
+
<a href="#inspect-class_method" title="inspect (class method)">+ (Object) <strong>inspect</strong> </a>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
</span>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<span class="summary_desc"><div class='inline'><p>
|
278
|
+
Description of this release of this project.
|
279
|
+
</p>
|
280
|
+
</div></span>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
|
285
|
+
<li class="public ">
|
286
|
+
<span class="summary_signature">
|
287
|
+
|
288
|
+
<a href="#require-class_method" title="require (class method)">+ (Object) <strong>require</strong>(gem_name_or_library) </a>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</span>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
<span class="summary_desc"><div class='inline'><p>
|
301
|
+
Loads the correct version (as defined by the <tt><a href="#RUNTIME-constant" title="Ember::RUNTIME (constant)">RUNTIME</a></tt> or <tt><a href="#DEVTIME-constant" title="Ember::DEVTIME (constant)">DEVTIME</a></tt>
|
302
|
+
constant in this module) of the given gem or the gem that contains the
|
303
|
+
given library.
|
304
|
+
</p>
|
305
|
+
</div></span>
|
306
|
+
|
307
|
+
</li>
|
308
|
+
|
309
|
+
|
310
|
+
</ul>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<div id="class_method_details" class="method_details_list">
|
316
|
+
<h2>Class Method Details</h2>
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method_details first">
|
320
|
+
<p class="signature first" id="inspect-class_method">
|
321
|
+
|
322
|
+
+ (<tt>Object</tt>) <strong>inspect</strong>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
</p><div class="docstring">
|
327
|
+
<div class="discussion">
|
328
|
+
<p>
|
329
|
+
Description of this release of this project.
|
330
|
+
</p>
|
331
|
+
|
332
|
+
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
<div class="tags">
|
336
|
+
|
337
|
+
</div><table class="source_code">
|
338
|
+
<tr>
|
339
|
+
<td>
|
340
|
+
<pre class="lines">
|
341
|
+
|
342
|
+
|
343
|
+
31
|
344
|
+
32
|
345
|
+
33</pre>
|
346
|
+
</td>
|
347
|
+
<td>
|
348
|
+
<pre class="code"><span class="info file"># File 'lib/ember/inochi.rb', line 31</span>
|
349
|
+
|
350
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id inspect'>inspect</span>
|
351
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>PROJECT</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='const'>VERSION</span><span class='rbrace'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='const'>RELDATE</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
352
|
+
<span class='kw'>end</span></pre>
|
353
|
+
</td>
|
354
|
+
</tr>
|
355
|
+
</table>
|
356
|
+
</div>
|
357
|
+
|
358
|
+
<div class="method_details ">
|
359
|
+
<p class="signature " id="require-class_method">
|
360
|
+
|
361
|
+
+ (<tt>Object</tt>) <strong>require</strong>(gem_name_or_library)
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</p><div class="docstring">
|
366
|
+
<div class="discussion">
|
367
|
+
<p>
|
368
|
+
Loads the correct version (as defined by the <tt><a href="#RUNTIME-constant" title="Ember::RUNTIME (constant)">RUNTIME</a></tt> or <tt><a href="#DEVTIME-constant" title="Ember::DEVTIME (constant)">DEVTIME</a></tt>
|
369
|
+
constant in this module) of the given gem or the gem that contains the
|
370
|
+
given library.
|
371
|
+
</p>
|
372
|
+
|
373
|
+
|
374
|
+
</div>
|
375
|
+
</div>
|
376
|
+
<div class="tags">
|
377
|
+
|
378
|
+
</div><table class="source_code">
|
379
|
+
<tr>
|
380
|
+
<td>
|
381
|
+
<pre class="lines">
|
382
|
+
|
383
|
+
|
384
|
+
86
|
385
|
+
87
|
386
|
+
88
|
387
|
+
89
|
388
|
+
90
|
389
|
+
91
|
390
|
+
92
|
391
|
+
93
|
392
|
+
94
|
393
|
+
95
|
394
|
+
96
|
395
|
+
97
|
396
|
+
98
|
397
|
+
99
|
398
|
+
100
|
399
|
+
101</pre>
|
400
|
+
</td>
|
401
|
+
<td>
|
402
|
+
<pre class="code"><span class="info file"># File 'lib/ember/inochi.rb', line 86</span>
|
403
|
+
|
404
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id require'>require</span> <span class='id gem_name_or_library'>gem_name_or_library</span>
|
405
|
+
<span class='comment'># prepare the correct version of the gem for loading
|
406
|
+
</span> <span class='kw'>if</span> <span class='id respond_to?'>respond_to?</span> <span class='symbol'>:gem</span>
|
407
|
+
<span class='id gem_name'>gem_name</span> <span class='op'>=</span> <span class='id gem_name_or_library'>gem_name_or_library</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>/.*$</span><span class='regexp_end'>}</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
408
|
+
<span class='kw'>if</span> <span class='id gem_version'>gem_version</span> <span class='op'>=</span> <span class='const'>RUNTIME</span><span class='lbracket'>[</span><span class='id gem_name'>gem_name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEVTIME</span><span class='lbracket'>[</span><span class='id gem_name'>gem_name</span><span class='rbracket'>]</span>
|
409
|
+
<span class='kw'>begin</span>
|
410
|
+
<span class='id gem'>gem</span> <span class='id gem_name'>gem_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id gem_version'>gem_version</span>
|
411
|
+
<span class='kw'>rescue</span> <span class='const'>LoadError</span> <span class='op'>=></span> <span class='id error'>error</span>
|
412
|
+
<span class='id warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id error'>error</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
413
|
+
<span class='kw'>end</span>
|
414
|
+
<span class='kw'>end</span>
|
415
|
+
<span class='kw'>end</span>
|
416
|
+
|
417
|
+
<span class='comment'># do the loading
|
418
|
+
</span> <span class='kw'>super</span>
|
419
|
+
<span class='kw'>end</span></pre>
|
420
|
+
</td>
|
421
|
+
</tr>
|
422
|
+
</table>
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div id="footer">
|
430
|
+
Generated on Sat Apr 3 14:23:17 2010 by
|
431
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
432
|
+
0.5.4 (ruby-1.9.1).
|
433
|
+
</div>
|
434
|
+
|
435
|
+
</body>
|
436
|
+
</html>
|