ember 0.0.1 → 0.1.0

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.
Files changed (65) hide show
  1. data/HISTORY +79 -0
  2. data/INSTALL +31 -0
  3. data/MANUAL +25 -0
  4. data/README +54 -0
  5. data/THEORY +151 -0
  6. data/USAGE +250 -0
  7. data/bin/ember +58 -20
  8. data/doc/ann.xml +93 -0
  9. data/doc/api/Ember.html +436 -0
  10. data/doc/api/Ember/Template.html +774 -0
  11. data/doc/api/Ember/Template/Program.html +877 -0
  12. data/doc/api/Ember/Template/Program/Statement.html +181 -0
  13. data/doc/api/_index.html +139 -0
  14. data/doc/api/class_list.html +36 -0
  15. data/doc/api/css/common.css +1 -0
  16. data/doc/api/css/full_list.css +50 -0
  17. data/doc/api/css/style.css +273 -0
  18. data/doc/api/file.LICENSE.html +73 -0
  19. data/doc/api/file_list.html +38 -0
  20. data/doc/api/frames.html +13 -0
  21. data/doc/api/index.html +72 -13
  22. data/doc/api/js/app.js +111 -0
  23. data/doc/api/js/full_list.js +117 -0
  24. data/doc/api/js/{jquery-1.3.2.min.js → jquery.js} +0 -0
  25. data/doc/api/method_list.html +179 -0
  26. data/doc/api/top-level-namespace.html +87 -0
  27. data/doc/index.html +1353 -682
  28. data/inochi.opts +31 -0
  29. data/lib/ember.rb +1 -15
  30. data/lib/ember/inochi.rb +103 -0
  31. data/lib/ember/template.rb +66 -78
  32. data/test/combinatorics.rb +188 -0
  33. data/test/ember/template_test.rb +137 -0
  34. data/test/runner +25 -0
  35. data/test/test_helper.rb +5 -0
  36. metadata +61 -51
  37. data/doc/api/apple-touch-icon.png +0 -0
  38. data/doc/api/classes/Ember.html +0 -61
  39. data/doc/api/classes/Ember/Template.html +0 -413
  40. data/doc/api/classes/Ember/Template/Program.html +0 -60
  41. data/doc/api/created.rid +0 -1
  42. data/doc/api/css/main.css +0 -263
  43. data/doc/api/css/panel.css +0 -383
  44. data/doc/api/css/reset.css +0 -53
  45. data/doc/api/favicon.ico +0 -0
  46. data/doc/api/files/LICENSE.html +0 -76
  47. data/doc/api/files/lib/ember/template_rb.html +0 -66
  48. data/doc/api/files/lib/ember_rb.html +0 -63
  49. data/doc/api/i/arrows.png +0 -0
  50. data/doc/api/i/results_bg.png +0 -0
  51. data/doc/api/i/tree_bg.png +0 -0
  52. data/doc/api/js/jquery-effect.js +0 -593
  53. data/doc/api/js/main.js +0 -22
  54. data/doc/api/js/searchdoc.js +0 -628
  55. data/doc/api/panel/index.html +0 -71
  56. data/doc/api/panel/search_index.js +0 -1
  57. data/doc/api/panel/tree.js +0 -1
  58. data/doc/history.erb +0 -34
  59. data/doc/index.erb +0 -11
  60. data/doc/intro.erb +0 -53
  61. data/doc/setup.erb +0 -78
  62. data/doc/usage.erb +0 -280
  63. data/rakefile +0 -14
  64. data/test/ember.rb +0 -17
  65. data/test/ember/template.rb +0 -141
data/bin/ember CHANGED
@@ -1,38 +1,76 @@
1
- #!/usr/bin/ruby -w
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] [Source]
10
- #
8
+ # ember [Options] [TemplateFile]
11
9
  #
12
- # Source: Path to an eRuby template file. If this parameter is
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
- # Copyright protects this work.
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
- options = Inochi.main :Ember do
30
- opt :shorthand, 'Treat lines beginning with "%" as directives'
31
- opt :infer_end, 'Add "end" statements based on indentation'
32
- opt :unindent, 'Unindent block content hierarchically'
33
- opt :compile, 'Print template program and exit'
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)
@@ -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
+ &lt;center&gt;
16
+ &lt;h1&gt;Ember&lt;/h1&gt;
17
+ &lt;h2&gt;eRuby template processor&lt;/h2&gt;
18
+ &lt;p&gt;http://snk.tuxfamily.org/lib/ember/&lt;/p&gt;
19
+ &lt;/center&gt;
20
+ &lt;p&gt;Ember (&lt;em&gt;EMBE&lt;/em&gt;dded &lt;em&gt;R&lt;/em&gt;uby) is an &lt;a href='http://en.wikipedia.org/wiki/ERuby'&gt;eRuby template&lt;/a&gt; processor that enables debugging, reduces markup, and improves composability of eRuby templates.&lt;/p&gt;
21
+
22
+ &lt;ul&gt;
23
+ &lt;li&gt;It reports correct line numbers in error message stack traces.&lt;/li&gt;
24
+
25
+ &lt;li&gt;It can infer &lt;tt&gt;&amp;lt;% end %&amp;gt;&lt;/tt&gt; based on indentation.&lt;/li&gt;
26
+
27
+ &lt;li&gt;It can unindent block content hierarchically.&lt;/li&gt;
28
+
29
+ &lt;li&gt;It completely silences code-only eRuby directives.&lt;/li&gt;
30
+
31
+ &lt;li&gt;It is implemented in 364 lines of pure Ruby.&lt;/li&gt;
32
+ &lt;/ul&gt;
33
+ &lt;div&gt;
34
+ &lt;div class=&quot;section&quot; id=&quot;Version-0-1-0-2010-04-03&quot;&gt;
35
+ &lt;a name=&quot;Version-0-1-0-2010-04-03&quot;/&gt;
36
+ &lt;h1 class=&quot;title&quot;&gt;
37
+ Version 0.1.0 (2010-04-03)
38
+ &lt;/h1&gt;
39
+ &lt;div class=&quot;content&quot;&gt;&lt;p&gt;This release improves the handling of eRuby comment directives, fixes a bug in the &lt;code class=&quot;line&quot;&gt;&amp;lt;&lt;span style=&quot;background-color:#fff0f0;color:#D20&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;% &lt;/span&gt;&lt;span style=&quot;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt; &lt;/span&gt;&lt;/span&gt;%&amp;gt;&lt;/code&gt; inference logic, and performs some minor housekeeping.&lt;/p&gt;
40
+
41
+
42
+ &lt;div class=&quot;paragraph&quot; id=&quot;New-features&quot;&gt;
43
+ &lt;a name=&quot;New-features&quot;/&gt;
44
+ &lt;p class=&quot;title&quot;&gt;New features&lt;/p&gt;
45
+ &lt;div class=&quot;content&quot;&gt;&lt;ul&gt;
46
+ &lt;li&gt;
47
+ &lt;p&gt;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:&lt;/p&gt;
48
+
49
+ &lt;pre&gt;%|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.&lt;/pre&gt;
62
+ &lt;/li&gt;
63
+ &lt;/ul&gt;&lt;/div&gt;
64
+ &lt;/div&gt;
65
+
66
+
67
+
68
+ &lt;div class=&quot;paragraph&quot; id=&quot;Bug-fixes&quot;&gt;
69
+ &lt;a name=&quot;Bug-fixes&quot;/&gt;
70
+ &lt;p class=&quot;title&quot;&gt;Bug fixes&lt;/p&gt;
71
+ &lt;div class=&quot;content&quot;&gt;&lt;ul&gt;
72
+ &lt;li&gt;&lt;code class=&quot;line&quot;&gt;&amp;lt;&lt;span style=&quot;background-color:#fff0f0;color:#D20&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;% &lt;/span&gt;&lt;span style=&quot;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt; &lt;/span&gt;&lt;/span&gt;%&amp;gt;&lt;/code&gt; inference did not work for blocks beginning with &lt;code class=&quot;line&quot;&gt;&lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;def&lt;/span&gt;&lt;/code&gt;, &lt;code class=&quot;line&quot;&gt;&lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;class&lt;/span&gt;&lt;/code&gt;, and &lt;code class=&quot;line&quot;&gt;&lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;module&lt;/span&gt;&lt;/code&gt; keywords.&lt;/li&gt;
73
+ &lt;/ul&gt;&lt;/div&gt;
74
+ &lt;/div&gt;
75
+
76
+
77
+
78
+ &lt;div class=&quot;paragraph&quot; id=&quot;Housekeeping&quot;&gt;
79
+ &lt;a name=&quot;Housekeeping&quot;/&gt;
80
+ &lt;p class=&quot;title&quot;&gt;Housekeeping&lt;/p&gt;
81
+ &lt;div class=&quot;content&quot;&gt;&lt;ul&gt;
82
+ &lt;li&gt;Upgrade to Inochi 2.0.0-rc3. This project no longer depends on the &amp;#8220;inochi&amp;#8221; or &amp;#8220;trollop&amp;#8221; gems at runtime.&lt;/li&gt;
83
+ &lt;/ul&gt;&lt;/div&gt;
84
+ &lt;/div&gt;
85
+ &lt;/div&gt;
86
+ &lt;/div&gt;
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>
@@ -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> &raquo;
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'>&quot;</span><span class='tstring_content'>Ember</span><span class='tstring_end'>&quot;</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'>&quot;</span><span class='tstring_content'>eRuby template processor</span><span class='tstring_end'>&quot;</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&#8217;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'>&quot;</span><span class='tstring_content'>http://snk.tuxfamily.org/lib/ember/</span><span class='tstring_end'>&quot;</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'>&quot;</span><span class='tstring_content'>0.1.0</span><span class='tstring_end'>&quot;</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'>&quot;</span><span class='tstring_content'>2010-04-03</span><span class='tstring_end'>&quot;</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 &quot;an_example&quot; gem
198
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>&quot;</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 &quot;another_example&quot; gem
202
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;= 1.2</span><span class='tstring_end'>&quot;</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt; 1.2.4</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
203
+
204
+ <span class='comment'># this project needs any version of the &quot;yet_another_example&quot; gem
205
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</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 &quot;an_example&quot; gem
233
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>&quot;</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 &quot;another_example&quot; gem
237
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;= 1.2</span><span class='tstring_end'>&quot;</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt; 1.2.4</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
238
+
239
+ <span class='comment'># this project needs any version of the &quot;yet_another_example&quot; gem
240
+ </span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</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'>&quot;</span><span class='tstring_content'>inochi</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~&gt; 2</span><span class='tstring_end'>&quot;</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'>&quot;</span><span class='tstring_content'>dfect</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~&gt; 2</span><span class='tstring_end'>&quot;</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'>&quot;</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'>&quot;</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'>=&gt;</span> <span class='id error'>error</span>
412
+ <span class='id warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</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>