rpub 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -1
  3. data/.rspec +0 -1
  4. data/.travis.yml +3 -4
  5. data/.yardopts +1 -0
  6. data/Gemfile +1 -1
  7. data/Gemfile.lock +70 -46
  8. data/Guardfile +6 -0
  9. data/HISTORY.md +10 -0
  10. data/README.md +1 -1
  11. data/Rakefile +7 -2
  12. data/bin/rpub +64 -1
  13. data/doc/.gitignore +8 -0
  14. data/doc/api/Rpub.html +339 -0
  15. data/doc/api/Rpub/Book.html +983 -0
  16. data/doc/api/Rpub/Chapter.html +737 -0
  17. data/doc/api/Rpub/Command.html +356 -0
  18. data/doc/api/Rpub/Commands.html +117 -0
  19. data/doc/api/Rpub/Commands/Clean.html +216 -0
  20. data/doc/api/Rpub/Commands/Compile.html +218 -0
  21. data/doc/api/Rpub/Commands/Generate.html +242 -0
  22. data/doc/api/Rpub/Commands/Package.html +230 -0
  23. data/doc/api/Rpub/Commands/Preview.html +216 -0
  24. data/doc/api/Rpub/Commands/Stats.html +226 -0
  25. data/doc/api/Rpub/Compressor.html +687 -0
  26. data/doc/api/Rpub/Context.html +553 -0
  27. data/doc/api/Rpub/Document.html +647 -0
  28. data/doc/api/Rpub/Document/OutlineElement.html +388 -0
  29. data/doc/api/Rpub/Epub.html +465 -0
  30. data/doc/api/Rpub/Epub/Container.html +224 -0
  31. data/doc/api/Rpub/Epub/Content.html +344 -0
  32. data/doc/api/Rpub/Epub/Cover.html +236 -0
  33. data/doc/api/Rpub/Epub/HtmlToc.html +240 -0
  34. data/doc/api/Rpub/Epub/Toc.html +244 -0
  35. data/doc/api/Rpub/FilesystemSource.html +544 -0
  36. data/doc/api/Rpub/HashDelegation.html +281 -0
  37. data/doc/api/Rpub/HashDelegation/ClassMethods.html +175 -0
  38. data/doc/api/Rpub/MediaType.html +192 -0
  39. data/doc/api/Rpub/Preview.html +464 -0
  40. data/doc/api/Rpub/XmlFile.html +457 -0
  41. data/doc/api/_index.html +405 -0
  42. data/doc/api/class_list.html +54 -0
  43. data/doc/api/css/common.css +1 -0
  44. data/doc/api/css/full_list.css +57 -0
  45. data/doc/api/css/style.css +339 -0
  46. data/doc/api/file.HISTORY.html +131 -0
  47. data/doc/api/file.LICENSE.html +92 -0
  48. data/doc/api/file.README.html +337 -0
  49. data/doc/api/file_list.html +62 -0
  50. data/doc/api/frames.html +26 -0
  51. data/doc/api/index.html +337 -0
  52. data/doc/api/js/app.js +219 -0
  53. data/doc/api/js/full_list.js +178 -0
  54. data/doc/api/js/jquery.js +4 -0
  55. data/doc/api/method_list.html +533 -0
  56. data/doc/api/top-level-namespace.html +112 -0
  57. data/doc/index.html +312 -0
  58. data/doc/javascripts/scale.fix.js +17 -0
  59. data/doc/params.json +1 -0
  60. data/doc/stylesheets/pygment_trac.css +69 -0
  61. data/doc/stylesheets/styles.css +255 -0
  62. data/features/clean.feature +31 -0
  63. data/features/compile.feature +49 -0
  64. data/features/embedded_assets.feature +51 -0
  65. data/features/generate.feature +63 -0
  66. data/features/layout.feature +41 -0
  67. data/features/package.feature +30 -0
  68. data/features/previews.feature +66 -0
  69. data/features/stats.feature +18 -0
  70. data/features/step_definitions/general_steps.rb +60 -0
  71. data/features/styles.feature +33 -0
  72. data/features/support/env.rb +7 -0
  73. data/features/table_of_contents.feature +35 -0
  74. data/lib/rpub.rb +28 -31
  75. data/lib/rpub/book.rb +9 -16
  76. data/lib/rpub/chapter.rb +4 -54
  77. data/lib/rpub/command.rb +32 -0
  78. data/lib/rpub/commands/clean.rb +4 -49
  79. data/lib/rpub/commands/compile.rb +4 -49
  80. data/lib/rpub/commands/generate.rb +10 -67
  81. data/lib/rpub/commands/package.rb +9 -37
  82. data/lib/rpub/commands/preview.rb +4 -54
  83. data/lib/rpub/commands/stats.rb +6 -10
  84. data/lib/rpub/compressor.rb +3 -3
  85. data/lib/rpub/context.rb +48 -0
  86. data/lib/rpub/document.rb +68 -0
  87. data/lib/rpub/epub.rb +8 -7
  88. data/lib/rpub/epub/content.rb +9 -30
  89. data/lib/rpub/epub/cover.rb +1 -8
  90. data/lib/rpub/epub/html_toc.rb +4 -9
  91. data/lib/rpub/epub/toc.rb +16 -13
  92. data/lib/rpub/filesystem_source.rb +47 -0
  93. data/lib/rpub/media_type.rb +16 -0
  94. data/lib/rpub/preview.rb +29 -0
  95. data/lib/rpub/version.rb +1 -1
  96. data/lib/rpub/xml_file.rb +4 -1
  97. data/rpub.gemspec +6 -7
  98. data/spec/rpub/book_spec.rb +45 -45
  99. data/spec/rpub/chapter_spec.rb +87 -22
  100. data/spec/rpub/epub/container_spec.rb +3 -5
  101. data/spec/rpub/epub/content_spec.rb +62 -41
  102. data/spec/rpub/epub/cover_spec.rb +3 -5
  103. data/spec/rpub/epub/html_toc_spec.rb +8 -8
  104. data/spec/rpub/epub/toc_spec.rb +20 -22
  105. data/spec/rpub_spec.rb +1 -3
  106. data/spec/spec_helper.rb +28 -0
  107. data/support/config.yml +1 -0
  108. data/support/styles.css +3 -3
  109. metadata +131 -120
  110. data/lib/rpub/commander.rb +0 -23
  111. data/lib/rpub/commands/base.rb +0 -33
  112. data/lib/rpub/commands/help.rb +0 -37
  113. data/lib/rpub/commands/main.rb +0 -45
  114. data/lib/rpub/compilation_helpers.rb +0 -73
  115. data/lib/rpub/subclass_tracker.rb +0 -53
  116. data/spec/rpub/commands/clean_spec.rb +0 -46
  117. data/spec/rpub/commands/generate_spec.rb +0 -52
  118. data/spec/rpub/commands/main_spec.rb +0 -26
  119. data/spec/rpub/commands/package_spec.rb +0 -33
  120. data/spec/rpub/commands/preview_spec.rb +0 -43
@@ -0,0 +1,244 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Rpub::Epub::Toc
8
+
9
+ &mdash; Rpub, a simple ePub generator library in Ruby
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Rpub/Epub/Toc.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (T)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Rpub.html" title="Rpub (module)">Rpub</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Epub.html" title="Rpub::Epub (class)">Epub</a></span></span>
36
+ &raquo;
37
+ <span class="title">Toc</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Rpub::Epub::Toc
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="../XmlFile.html" title="Rpub::XmlFile (class)">XmlFile</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="../XmlFile.html" title="Rpub::XmlFile (class)">XmlFile</a></span></li>
82
+
83
+ <li class="next">Rpub::Epub::Toc</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/rpub/epub/toc.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary</h2>
111
+
112
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../XmlFile.html" title="Rpub::XmlFile (class)">XmlFile</a></span></h3>
113
+ <p class="inherited"><span class='object_link'><a href="../XmlFile.html#book-instance_method" title="Rpub::XmlFile#book (method)">#book</a></span>, <span class='object_link'><a href="../XmlFile.html#xml-instance_method" title="Rpub::XmlFile#xml (method)">#xml</a></span></p>
114
+
115
+
116
+
117
+ <h2>
118
+ Instance Method Summary
119
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
120
+ </h2>
121
+
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#render-instance_method" title="#render (instance method)">- (Object) <strong>render</strong> </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ </ul>
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../XmlFile.html" title="Rpub::XmlFile (class)">XmlFile</a></span></h3>
160
+ <p class="inherited"><span class='object_link'><a href="../XmlFile.html#initialize-instance_method" title="Rpub::XmlFile#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../XmlFile.html#to_s-instance_method" title="Rpub::XmlFile#to_s (method)">#to_s</a></span></p>
161
+ <div id="constructor_details" class="method_details_list">
162
+ <h2>Constructor Details</h2>
163
+
164
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="../XmlFile.html#initialize-instance_method" title="Rpub::XmlFile#initialize (method)">Rpub::XmlFile</a></span></p>
165
+
166
+ </div>
167
+
168
+
169
+ <div id="instance_method_details" class="method_details_list">
170
+ <h2>Instance Method Details</h2>
171
+
172
+
173
+ <div class="method_details first">
174
+ <h3 class="signature first" id="render-instance_method">
175
+
176
+ - (<tt>Object</tt>) <strong>render</strong>
177
+
178
+
179
+
180
+
181
+
182
+ </h3><table class="source_code">
183
+ <tr>
184
+ <td>
185
+ <pre class="lines">
186
+
187
+
188
+ 4
189
+ 5
190
+ 6
191
+ 7
192
+ 8
193
+ 9
194
+ 10
195
+ 11
196
+ 12
197
+ 13
198
+ 14
199
+ 15
200
+ 16
201
+ 17
202
+ 18
203
+ 19
204
+ 20
205
+ 21</pre>
206
+ </td>
207
+ <td>
208
+ <pre class="code"><span class="info file"># File 'lib/rpub/epub/toc.rb', line 4</span>
209
+
210
+ <span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span>
211
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_instruct!'>instruct!</span>
212
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_declare!'>declare!</span> <span class='symbol'>:DOCTYPE</span><span class='comma'>,</span> <span class='symbol'>:ncx</span><span class='comma'>,</span> <span class='symbol'>:PUBLIC</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-//W3C//DTD XHTML 1.1//EN</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</span><span class='tstring_end'>&#39;</span></span>
213
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_ncx'>ncx</span> <span class='symbol'>:xmlns</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>http://www.daisy.org/z3986/2005/ncx/</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:version</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>2005-1</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
214
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_head'>head</span> <span class='kw'>do</span>
215
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_meta'>meta</span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>dtb:uid</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:content</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_book'>book</span><span class='period'>.</span><span class='id identifier rubyid_uid'>uid</span>
216
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_meta'>meta</span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>dtb:depth</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:content</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_max_level'>max_level</span>
217
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_meta'>meta</span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>dtb:totalPageCount</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:content</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0</span><span class='tstring_end'>&#39;</span></span>
218
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_meta'>meta</span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>dtb:maxPageNumber</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:content</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0</span><span class='tstring_end'>&#39;</span></span>
219
+ <span class='kw'>end</span>
220
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_docTitle'>docTitle</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='id identifier rubyid_book'>book</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='rbrace'>}</span>
221
+ <span class='id identifier rubyid_xml'>xml</span><span class='period'>.</span><span class='id identifier rubyid_navMap'>navMap</span> <span class='kw'>do</span>
222
+ <span class='id identifier rubyid_book'>book</span><span class='period'>.</span><span class='id identifier rubyid_chapters'>chapters</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_chapter'>chapter</span><span class='op'>|</span>
223
+ <span class='id identifier rubyid_nav_points_nested_by_level'>nav_points_nested_by_level</span> <span class='id identifier rubyid_chapter'>chapter</span><span class='period'>.</span><span class='id identifier rubyid_toc'>toc</span><span class='comma'>,</span> <span class='id identifier rubyid_chapter'>chapter</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span>
224
+ <span class='kw'>end</span>
225
+ <span class='kw'>end</span>
226
+ <span class='kw'>end</span>
227
+ <span class='kw'>end</span></pre>
228
+ </td>
229
+ </tr>
230
+ </table>
231
+ </div>
232
+
233
+ </div>
234
+
235
+ </div>
236
+
237
+ <div id="footer">
238
+ Generated on Thu Aug 14 19:54:32 2014 by
239
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
240
+ 0.8.7.4 (ruby-2.1.2).
241
+ </div>
242
+
243
+ </body>
244
+ </html>
@@ -0,0 +1,544 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Rpub::FilesystemSource
8
+
9
+ &mdash; Rpub, a simple ePub generator library in Ruby
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!Rpub/FilesystemSource.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (F)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Rpub.html" title="Rpub (module)">Rpub</a></span></span>
36
+ &raquo;
37
+ <span class="title">FilesystemSource</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Rpub::FilesystemSource
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/rpub/filesystem_source.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <h2>
96
+ Class Method Summary
97
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
98
+ </h2>
99
+
100
+ <ul class="summary">
101
+
102
+ <li class="public ">
103
+ <span class="summary_signature">
104
+
105
+ <a href="#exists%3F-class_method" title="exists? (class method)">+ (Boolean) <strong>exists?</strong>(filename) </a>
106
+
107
+
108
+
109
+ </span>
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <span class="summary_desc"><div class='inline'>
120
+ </div></span>
121
+
122
+ </li>
123
+
124
+
125
+ <li class="public ">
126
+ <span class="summary_signature">
127
+
128
+ <a href="#force_write-class_method" title="force_write (class method)">+ (Object) <strong>force_write</strong>(filename, content) </a>
129
+
130
+
131
+
132
+ </span>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ </div></span>
144
+
145
+ </li>
146
+
147
+
148
+ <li class="public ">
149
+ <span class="summary_signature">
150
+
151
+ <a href="#own_or_support_file-class_method" title="own_or_support_file (class method)">+ (Object) <strong>own_or_support_file</strong>(filename) </a>
152
+
153
+
154
+
155
+ </span>
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <span class="summary_desc"><div class='inline'>
166
+ </div></span>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#read-class_method" title="read (class method)">+ (Object) <strong>read</strong>(filename) </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ </div></span>
190
+
191
+ </li>
192
+
193
+
194
+ <li class="public ">
195
+ <span class="summary_signature">
196
+
197
+ <a href="#remove-class_method" title="remove (class method)">+ (Object) <strong>remove</strong>(filename, dry_run = false) </a>
198
+
199
+
200
+
201
+ </span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ <span class="summary_desc"><div class='inline'>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#source_files-class_method" title="source_files (class method)">+ (Object) <strong>source_files</strong> </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ </div></span>
236
+
237
+ </li>
238
+
239
+
240
+ <li class="public ">
241
+ <span class="summary_signature">
242
+
243
+ <a href="#write-class_method" title="write (class method)">+ (Object) <strong>write</strong>(filename, content, force = false) </a>
244
+
245
+
246
+
247
+ </span>
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+ <span class="summary_desc"><div class='inline'>
258
+ </div></span>
259
+
260
+ </li>
261
+
262
+
263
+ </ul>
264
+
265
+
266
+
267
+
268
+ <div id="class_method_details" class="method_details_list">
269
+ <h2>Class Method Details</h2>
270
+
271
+
272
+ <div class="method_details first">
273
+ <h3 class="signature first" id="exists?-class_method">
274
+
275
+ + (<tt>Boolean</tt>) <strong>exists?</strong>(filename)
276
+
277
+
278
+
279
+
280
+
281
+ </h3><div class="docstring">
282
+ <div class="discussion">
283
+
284
+
285
+
286
+ </div>
287
+ </div>
288
+ <div class="tags">
289
+
290
+ <p class="tag_title">Returns:</p>
291
+ <ul class="return">
292
+
293
+ <li>
294
+
295
+
296
+ <span class='type'>(<tt>Boolean</tt>)</span>
297
+
298
+
299
+
300
+ </li>
301
+
302
+ </ul>
303
+
304
+ </div><table class="source_code">
305
+ <tr>
306
+ <td>
307
+ <pre class="lines">
308
+
309
+
310
+ 9
311
+ 10
312
+ 11</pre>
313
+ </td>
314
+ <td>
315
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 9</span>
316
+
317
+ <span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
318
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
319
+ <span class='kw'>end</span></pre>
320
+ </td>
321
+ </tr>
322
+ </table>
323
+ </div>
324
+
325
+ <div class="method_details ">
326
+ <h3 class="signature " id="force_write-class_method">
327
+
328
+ + (<tt>Object</tt>) <strong>force_write</strong>(filename, content)
329
+
330
+
331
+
332
+
333
+
334
+ </h3><table class="source_code">
335
+ <tr>
336
+ <td>
337
+ <pre class="lines">
338
+
339
+
340
+ 28
341
+ 29
342
+ 30</pre>
343
+ </td>
344
+ <td>
345
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 28</span>
346
+
347
+ <span class='kw'>def</span> <span class='id identifier rubyid_force_write'>force_write</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
348
+ <span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='kw'>true</span>
349
+ <span class='kw'>end</span></pre>
350
+ </td>
351
+ </tr>
352
+ </table>
353
+ </div>
354
+
355
+ <div class="method_details ">
356
+ <h3 class="signature " id="own_or_support_file-class_method">
357
+
358
+ + (<tt>Object</tt>) <strong>own_or_support_file</strong>(filename)
359
+
360
+
361
+
362
+
363
+
364
+ </h3><table class="source_code">
365
+ <tr>
366
+ <td>
367
+ <pre class="lines">
368
+
369
+
370
+ 42
371
+ 43
372
+ 44
373
+ 45</pre>
374
+ </td>
375
+ <td>
376
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 42</span>
377
+
378
+ <span class='kw'>def</span> <span class='id identifier rubyid_own_or_support_file'>own_or_support_file</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
379
+ <span class='kw'>return</span> <span class='id identifier rubyid_filename'>filename</span> <span class='kw'>if</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
380
+ <span class='const'>Rpub</span><span class='period'>.</span><span class='id identifier rubyid_support_file'>support_file</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
381
+ <span class='kw'>end</span></pre>
382
+ </td>
383
+ </tr>
384
+ </table>
385
+ </div>
386
+
387
+ <div class="method_details ">
388
+ <h3 class="signature " id="read-class_method">
389
+
390
+ + (<tt>Object</tt>) <strong>read</strong>(filename)
391
+
392
+
393
+
394
+
395
+
396
+ </h3><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 5
403
+ 6
404
+ 7</pre>
405
+ </td>
406
+ <td>
407
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 5</span>
408
+
409
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
410
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
411
+ <span class='kw'>end</span></pre>
412
+ </td>
413
+ </tr>
414
+ </table>
415
+ </div>
416
+
417
+ <div class="method_details ">
418
+ <h3 class="signature " id="remove-class_method">
419
+
420
+ + (<tt>Object</tt>) <strong>remove</strong>(filename, dry_run = false)
421
+
422
+
423
+
424
+
425
+
426
+ </h3><table class="source_code">
427
+ <tr>
428
+ <td>
429
+ <pre class="lines">
430
+
431
+
432
+ 32
433
+ 33
434
+ 34
435
+ 35
436
+ 36
437
+ 37
438
+ 38
439
+ 39
440
+ 40</pre>
441
+ </td>
442
+ <td>
443
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 32</span>
444
+
445
+ <span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_dry_run'>dry_run</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
446
+ <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
447
+ <span class='kw'>if</span> <span class='id identifier rubyid_dry_run'>dry_run</span>
448
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_filename'>filename</span>
449
+ <span class='kw'>else</span>
450
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_unlink'>unlink</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
451
+ <span class='kw'>end</span>
452
+ <span class='kw'>end</span>
453
+ <span class='kw'>end</span></pre>
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </div>
458
+
459
+ <div class="method_details ">
460
+ <h3 class="signature " id="source_files-class_method">
461
+
462
+ + (<tt>Object</tt>) <strong>source_files</strong>
463
+
464
+
465
+
466
+
467
+
468
+ </h3><table class="source_code">
469
+ <tr>
470
+ <td>
471
+ <pre class="lines">
472
+
473
+
474
+ 13
475
+ 14
476
+ 15</pre>
477
+ </td>
478
+ <td>
479
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 13</span>
480
+
481
+ <span class='kw'>def</span> <span class='id identifier rubyid_source_files'>source_files</span>
482
+ <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*{.md,.markdown,.mdown,.markd}</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
483
+ <span class='kw'>end</span></pre>
484
+ </td>
485
+ </tr>
486
+ </table>
487
+ </div>
488
+
489
+ <div class="method_details ">
490
+ <h3 class="signature " id="write-class_method">
491
+
492
+ + (<tt>Object</tt>) <strong>write</strong>(filename, content, force = false)
493
+
494
+
495
+
496
+
497
+
498
+ </h3><table class="source_code">
499
+ <tr>
500
+ <td>
501
+ <pre class="lines">
502
+
503
+
504
+ 17
505
+ 18
506
+ 19
507
+ 20
508
+ 21
509
+ 22
510
+ 23
511
+ 24
512
+ 25
513
+ 26</pre>
514
+ </td>
515
+ <td>
516
+ <pre class="code"><span class="info file"># File 'lib/rpub/filesystem_source.rb', line 17</span>
517
+
518
+ <span class='kw'>def</span> <span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_force'>force</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
519
+ <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
520
+ <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_force'>force</span> <span class='op'>&amp;&amp;</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
521
+ <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Not overriding </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filename'>filename</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
522
+ <span class='kw'>return</span>
523
+ <span class='kw'>end</span>
524
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
525
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_content'>content</span>
526
+ <span class='kw'>end</span>
527
+ <span class='kw'>end</span></pre>
528
+ </td>
529
+ </tr>
530
+ </table>
531
+ </div>
532
+
533
+ </div>
534
+
535
+ </div>
536
+
537
+ <div id="footer">
538
+ Generated on Thu Aug 14 19:54:32 2014 by
539
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
540
+ 0.8.7.4 (ruby-2.1.2).
541
+ </div>
542
+
543
+ </body>
544
+ </html>