ymdp 0.9.2 → 0.10.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 (70) hide show
  1. data/Gemfile +2 -1
  2. data/VERSION +1 -1
  3. data/doc/ActionView.html +175 -0
  4. data/doc/ActionView/Helpers.html +175 -0
  5. data/doc/ActionView/Helpers/TagHelper.html +439 -0
  6. data/doc/Application.html +295 -0
  7. data/doc/LICENSE.html +158 -0
  8. data/doc/Object.html +218 -0
  9. data/doc/README_rdoc.html +147 -0
  10. data/doc/YMDP.html +232 -0
  11. data/doc/YMDP/ApplicationView.html +563 -0
  12. data/doc/YMDP/AssetTagHelper.html +235 -0
  13. data/doc/YMDP/Base.html +560 -0
  14. data/doc/YMDP/Compiler.html +178 -0
  15. data/doc/YMDP/Compiler/Base.html +1181 -0
  16. data/doc/YMDP/Compiler/Domains.html +493 -0
  17. data/doc/YMDP/Compiler/Options.html +265 -0
  18. data/doc/YMDP/Compiler/Template.html +175 -0
  19. data/doc/YMDP/Compiler/Template/Base.html +911 -0
  20. data/doc/YMDP/Compiler/Template/CoffeeScript.html +236 -0
  21. data/doc/YMDP/Compiler/Template/JavaScript.html +237 -0
  22. data/doc/YMDP/Compiler/Template/View.html +495 -0
  23. data/doc/YMDP/Compiler/Template/YRB.html +469 -0
  24. data/doc/YMDP/Configuration.html +175 -0
  25. data/doc/YMDP/Configuration/Base.html +426 -0
  26. data/doc/YMDP/Configuration/Config.html +553 -0
  27. data/doc/YMDP/Configuration/Servers.html +265 -0
  28. data/doc/YMDP/Configuration/Setter.html +580 -0
  29. data/doc/YMDP/FormTagHelper.html +298 -0
  30. data/doc/YMDP/GitHelper.html +298 -0
  31. data/doc/YMDP/LinkTagHelper.html +299 -0
  32. data/doc/YMDP/View.html +239 -0
  33. data/doc/created.rid +18 -0
  34. data/doc/images/add.png +0 -0
  35. data/doc/images/brick.png +0 -0
  36. data/doc/images/brick_link.png +0 -0
  37. data/doc/images/bug.png +0 -0
  38. data/doc/images/bullet_black.png +0 -0
  39. data/doc/images/bullet_toggle_minus.png +0 -0
  40. data/doc/images/bullet_toggle_plus.png +0 -0
  41. data/doc/images/date.png +0 -0
  42. data/doc/images/delete.png +0 -0
  43. data/doc/images/find.png +0 -0
  44. data/doc/images/loadingAnimation.gif +0 -0
  45. data/doc/images/macFFBgHack.png +0 -0
  46. data/doc/images/package.png +0 -0
  47. data/doc/images/page_green.png +0 -0
  48. data/doc/images/page_white_text.png +0 -0
  49. data/doc/images/page_white_width.png +0 -0
  50. data/doc/images/plugin.png +0 -0
  51. data/doc/images/ruby.png +0 -0
  52. data/doc/images/tag_blue.png +0 -0
  53. data/doc/images/tag_green.png +0 -0
  54. data/doc/images/transparent.png +0 -0
  55. data/doc/images/wrench.png +0 -0
  56. data/doc/images/wrench_orange.png +0 -0
  57. data/doc/images/zoom.png +0 -0
  58. data/doc/index.html +134 -0
  59. data/doc/js/darkfish.js +153 -0
  60. data/doc/js/jquery.js +18 -0
  61. data/doc/js/navigation.js +142 -0
  62. data/doc/js/search.js +94 -0
  63. data/doc/js/search_index.js +1 -0
  64. data/doc/js/searcher.js +228 -0
  65. data/doc/rdoc.css +543 -0
  66. data/doc/table_of_contents.html +401 -0
  67. data/lib/ymdp/compiler/template.rb +5 -1
  68. data/lib/ymdp/view/application_view.rb +10 -5
  69. data/ymdp.gemspec +69 -2
  70. metadata +120 -42
@@ -0,0 +1,469 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class YMDP::Compiler::Template::YRB - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../../index.html">Home</a>
28
+ <a href="../../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/ymdp/compiler/template.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="Base.html">YMDP::Compiler::Template::Base</a>
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-i-destination_path">#destination_path</a>
74
+
75
+ <li><a href="#method-i-directory">#directory</a>
76
+
77
+ <li><a href="#method-i-processed_template">#processed_template</a>
78
+
79
+ <li><a href="#method-i-to_hash">#to_hash</a>
80
+
81
+ <li><a href="#method-i-to_json">#to_json</a>
82
+
83
+ <li><a href="#method-i-to_yaml">#to_yaml</a>
84
+
85
+ <li><a href="#method-i-validate">#validate</a>
86
+
87
+ <li><a href="#method-i-yrb">#yrb</a>
88
+
89
+ </ul>
90
+ </nav>
91
+
92
+ </div>
93
+
94
+ <div id="project-metadata">
95
+ <nav id="fileindex-section" class="section project-section">
96
+ <h3 class="section-header">Pages</h3>
97
+
98
+ <ul>
99
+
100
+ <li class="file"><a href="../../../LICENSE.html">LICENSE</a>
101
+
102
+ <li class="file"><a href="../../../README_rdoc.html">README</a>
103
+
104
+ </ul>
105
+ </nav>
106
+
107
+ <nav id="classindex-section" class="section project-section">
108
+ <h3 class="section-header">Class and Module Index</h3>
109
+
110
+ <ul class="link-list">
111
+
112
+ <li><a href="../../../YMDP.html">YMDP</a>
113
+
114
+ <li><a href="../../../YMDP/ApplicationView.html">YMDP::ApplicationView</a>
115
+
116
+ <li><a href="../../../YMDP/AssetTagHelper.html">YMDP::AssetTagHelper</a>
117
+
118
+ <li><a href="../../../YMDP/Base.html">YMDP::Base</a>
119
+
120
+ <li><a href="../../../YMDP/Compiler.html">YMDP::Compiler</a>
121
+
122
+ <li><a href="../../../YMDP/Compiler/Base.html">YMDP::Compiler::Base</a>
123
+
124
+ <li><a href="../../../YMDP/Compiler/Domains.html">YMDP::Compiler::Domains</a>
125
+
126
+ <li><a href="../../../YMDP/Compiler/Options.html">YMDP::Compiler::Options</a>
127
+
128
+ <li><a href="../../../YMDP/Compiler/Template.html">YMDP::Compiler::Template</a>
129
+
130
+ <li><a href="../../../YMDP/Compiler/Template/Base.html">YMDP::Compiler::Template::Base</a>
131
+
132
+ <li><a href="../../../YMDP/Compiler/Template/CoffeeScript.html">YMDP::Compiler::Template::CoffeeScript</a>
133
+
134
+ <li><a href="../../../YMDP/Compiler/Template/JavaScript.html">YMDP::Compiler::Template::JavaScript</a>
135
+
136
+ <li><a href="../../../YMDP/Compiler/Template/View.html">YMDP::Compiler::Template::View</a>
137
+
138
+ <li><a href="../../../YMDP/Compiler/Template/YRB.html">YMDP::Compiler::Template::YRB</a>
139
+
140
+ <li><a href="../../../YMDP/Configuration.html">YMDP::Configuration</a>
141
+
142
+ <li><a href="../../../YMDP/Configuration/Base.html">YMDP::Configuration::Base</a>
143
+
144
+ <li><a href="../../../YMDP/Configuration/Config.html">YMDP::Configuration::Config</a>
145
+
146
+ <li><a href="../../../YMDP/Configuration/Servers.html">YMDP::Configuration::Servers</a>
147
+
148
+ <li><a href="../../../YMDP/Configuration/Setter.html">YMDP::Configuration::Setter</a>
149
+
150
+ <li><a href="../../../YMDP/FormTagHelper.html">YMDP::FormTagHelper</a>
151
+
152
+ <li><a href="../../../YMDP/GitHelper.html">YMDP::GitHelper</a>
153
+
154
+ <li><a href="../../../YMDP/LinkTagHelper.html">YMDP::LinkTagHelper</a>
155
+
156
+ <li><a href="../../../YMDP/View.html">YMDP::View</a>
157
+
158
+ <li><a href="../../../ActionView.html">ActionView</a>
159
+
160
+ <li><a href="../../../ActionView/Helpers.html">ActionView::Helpers</a>
161
+
162
+ <li><a href="../../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
163
+
164
+ <li><a href="../../../Application.html">Application</a>
165
+
166
+ <li><a href="../../../Object.html">Object</a>
167
+
168
+ </ul>
169
+ </nav>
170
+
171
+ </div>
172
+ </nav>
173
+
174
+ <div id="documentation">
175
+ <h1 class="class">class YMDP::Compiler::Template::YRB</h1>
176
+
177
+ <div id="description" class="description">
178
+
179
+ <p>Process Yahoo! Resource Bundle format translation files.</p>
180
+
181
+ <p>Convert them to a hash and write the hash to a JSON file.</p>
182
+
183
+ <p>Each language can have as many <a href="YRB.html">YRB</a> translation files
184
+ (with an extension of “.pres”) as necessary. The files are
185
+ concatenated together and converted into a single JSON file for each
186
+ language.</p>
187
+
188
+ </div><!-- description -->
189
+
190
+
191
+
192
+
193
+ <section id="5Buntitled-5D" class="documentation-section">
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+ <!-- Methods -->
203
+
204
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
205
+ <h3 class="section-header">Public Instance Methods</h3>
206
+
207
+
208
+ <div id="method-i-destination_path" class="method-detail ">
209
+
210
+ <div class="method-heading">
211
+ <span class="method-name">destination_path</span><span
212
+ class="method-args">()</span>
213
+ <span class="method-click-advice">click to toggle source</span>
214
+ </div>
215
+
216
+
217
+ <div class="method-description">
218
+
219
+ <p>The destination of the compiled JSON file.</p>
220
+
221
+
222
+
223
+ <div class="method-source-code" id="destination_path-source">
224
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 357</span>
225
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">destination_path</span>
226
+ <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">convert_filename</span>(<span class="ruby-ivar">@file</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;/&quot;</span>).<span class="ruby-identifier">last</span>)
227
+ <span class="ruby-node">&quot;#{directory}/#{filename}&quot;</span>
228
+ <span class="ruby-keyword">end</span></pre>
229
+ </div><!-- destination_path-source -->
230
+
231
+ </div>
232
+
233
+
234
+
235
+
236
+ </div><!-- destination_path-method -->
237
+
238
+
239
+ <div id="method-i-directory" class="method-detail ">
240
+
241
+ <div class="method-heading">
242
+ <span class="method-name">directory</span><span
243
+ class="method-args">()</span>
244
+ <span class="method-click-advice">click to toggle source</span>
245
+ </div>
246
+
247
+
248
+ <div class="method-description">
249
+
250
+ <p><a href="Base.html">Base</a> directory for translations for this domain.</p>
251
+
252
+
253
+
254
+ <div class="method-source-code" id="directory-source">
255
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 349</span>
256
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">directory</span>
257
+ <span class="ruby-identifier">directory</span> = <span class="ruby-node">&quot;#{paths[:base_path]}/servers/#{@domain}/assets/yrb&quot;</span>
258
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>)
259
+ <span class="ruby-identifier">directory</span>
260
+ <span class="ruby-keyword">end</span></pre>
261
+ </div><!-- directory-source -->
262
+
263
+ </div>
264
+
265
+
266
+
267
+
268
+ </div><!-- directory-method -->
269
+
270
+
271
+ <div id="method-i-processed_template" class="method-detail ">
272
+
273
+ <div class="method-heading">
274
+ <span class="method-name">processed_template</span><span
275
+ class="method-args">()</span>
276
+ <span class="method-click-advice">click to toggle source</span>
277
+ </div>
278
+
279
+
280
+ <div class="method-description">
281
+
282
+ <p>This function is the file which is written to the destination–in this
283
+ case, the JSON file.</p>
284
+
285
+
286
+
287
+ <div class="method-source-code" id="processed_template-source">
288
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 394</span>
289
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">processed_template</span>
290
+ <span class="ruby-identifier">yrb</span>.<span class="ruby-identifier">to_json</span>
291
+ <span class="ruby-keyword">end</span></pre>
292
+ </div><!-- processed_template-source -->
293
+
294
+ </div>
295
+
296
+
297
+
298
+
299
+ </div><!-- processed_template-method -->
300
+
301
+
302
+ <div id="method-i-to_hash" class="method-detail ">
303
+
304
+ <div class="method-heading">
305
+ <span class="method-name">to_hash</span><span
306
+ class="method-args">()</span>
307
+ <span class="method-click-advice">click to toggle source</span>
308
+ </div>
309
+
310
+
311
+ <div class="method-description">
312
+
313
+ <p>Turn it back into a hash.</p>
314
+
315
+
316
+
317
+ <div class="method-source-code" id="to_hash-source">
318
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 370</span>
319
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_hash</span>
320
+ <span class="ruby-identifier">yrb</span>
321
+ <span class="ruby-keyword">end</span></pre>
322
+ </div><!-- to_hash-source -->
323
+
324
+ </div>
325
+
326
+
327
+
328
+
329
+ </div><!-- to_hash-method -->
330
+
331
+
332
+ <div id="method-i-to_json" class="method-detail ">
333
+
334
+ <div class="method-heading">
335
+ <span class="method-name">to_json</span><span
336
+ class="method-args">()</span>
337
+ <span class="method-click-advice">click to toggle source</span>
338
+ </div>
339
+
340
+
341
+ <div class="method-description">
342
+
343
+ <p>JSON values of the compiled translations.</p>
344
+
345
+
346
+
347
+ <div class="method-source-code" id="to_json-source">
348
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 364</span>
349
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_json</span>
350
+ <span class="ruby-identifier">processed_template</span>
351
+ <span class="ruby-keyword">end</span></pre>
352
+ </div><!-- to_json-source -->
353
+
354
+ </div>
355
+
356
+
357
+
358
+
359
+ </div><!-- to_json-method -->
360
+
361
+
362
+ <div id="method-i-to_yaml" class="method-detail ">
363
+
364
+ <div class="method-heading">
365
+ <span class="method-name">to_yaml</span><span
366
+ class="method-args">()</span>
367
+ <span class="method-click-advice">click to toggle source</span>
368
+ </div>
369
+
370
+
371
+ <div class="method-description">
372
+
373
+ <p>Convert the hash to Yaml if you should want to do that.</p>
374
+
375
+
376
+
377
+ <div class="method-source-code" id="to_yaml-source">
378
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 382</span>
379
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_yaml</span>
380
+ <span class="ruby-identifier">h</span> = {}
381
+ <span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
382
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span>
383
+ <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-node">&quot;#{v}&quot;</span>
384
+ <span class="ruby-keyword">end</span>
385
+ <span class="ruby-identifier">h</span>.<span class="ruby-identifier">to_yaml</span>
386
+ <span class="ruby-keyword">end</span></pre>
387
+ </div><!-- to_yaml-source -->
388
+
389
+ </div>
390
+
391
+
392
+
393
+
394
+ </div><!-- to_yaml-method -->
395
+
396
+
397
+ <div id="method-i-validate" class="method-detail ">
398
+
399
+ <div class="method-heading">
400
+ <span class="method-name">validate</span><span
401
+ class="method-args">()</span>
402
+ <span class="method-click-advice">click to toggle source</span>
403
+ </div>
404
+
405
+
406
+ <div class="method-description">
407
+
408
+ <p>Validate the JSON file.</p>
409
+
410
+
411
+
412
+ <div class="method-source-code" id="validate-source">
413
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 400</span>
414
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">validate</span>
415
+ <span class="ruby-constant">Epic</span><span class="ruby-operator">::</span><span class="ruby-constant">Validator</span><span class="ruby-operator">::</span><span class="ruby-constant">JSON</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">destination_path</span>)
416
+ <span class="ruby-keyword">end</span></pre>
417
+ </div><!-- validate-source -->
418
+
419
+ </div>
420
+
421
+
422
+
423
+
424
+ </div><!-- validate-method -->
425
+
426
+
427
+ <div id="method-i-yrb" class="method-detail ">
428
+
429
+ <div class="method-heading">
430
+ <span class="method-name">yrb</span><span
431
+ class="method-args">()</span>
432
+ <span class="method-click-advice">click to toggle source</span>
433
+ </div>
434
+
435
+
436
+ <div class="method-description">
437
+
438
+ <p>Parse <a href="YRB.html">YRB</a> file</p>
439
+
440
+
441
+
442
+ <div class="method-source-code" id="yrb-source">
443
+ <pre><span class="ruby-comment"># File lib/ymdp/compiler/template.rb, line 376</span>
444
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">yrb</span>
445
+ <span class="ruby-operator">::</span><span class="ruby-constant">YRB</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-ivar">@file</span>)
446
+ <span class="ruby-keyword">end</span></pre>
447
+ </div><!-- yrb-source -->
448
+
449
+ </div>
450
+
451
+
452
+
453
+
454
+ </div><!-- yrb-method -->
455
+
456
+
457
+ </section><!-- public-instance-method-details -->
458
+
459
+ </section><!-- 5Buntitled-5D -->
460
+
461
+ </div><!-- documentation -->
462
+
463
+
464
+ <footer id="validator-badges">
465
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
466
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
467
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
468
+ </footer>
469
+