syclink 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rspec +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +33 -0
- data/LICENSE +21 -0
- data/README.md +191 -0
- data/README.rdoc +9 -0
- data/Rakefile +5 -0
- data/bin/syclink +290 -0
- data/doc/Gemfile.html +109 -0
- data/doc/Gemfile_lock.html +147 -0
- data/doc/LICENSE.html +129 -0
- data/doc/Object.html +188 -0
- data/doc/README_md.html +322 -0
- data/doc/README_rdoc.html +171 -0
- data/doc/SycLink/Designer.html +560 -0
- data/doc/SycLink/Exporter.html +149 -0
- data/doc/SycLink/Formatter.html +416 -0
- data/doc/SycLink/Infrastructure.html +297 -0
- data/doc/SycLink/Link.html +296 -0
- data/doc/SycLink/Website.html +428 -0
- data/doc/SycLink.html +127 -0
- data/doc/created.rid +31 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +131 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/links_csv.html +113 -0
- data/doc/setup_md.html +192 -0
- data/doc/syclink_gemspec.html +133 -0
- data/doc/syclink_rdoc.html +154 -0
- data/doc/table_of_contents.html +336 -0
- data/doc/templates/example_html.html +399 -0
- data/doc/templates/links.html +116 -0
- data/doc/templates/stylesheets/style_css.html +170 -0
- data/doc/templates/stylesheets/style_css_map.html +111 -0
- data/doc/templates/stylesheets/style_css_scss.html +198 -0
- data/doc/templates/syc-link_html.html +235 -0
- data/lib/syclink/designer.rb +97 -0
- data/lib/syclink/designer_example.rb +9 -0
- data/lib/syclink/exporter.rb +17 -0
- data/lib/syclink/formatter.rb +70 -0
- data/lib/syclink/infrastructure.rb +44 -0
- data/lib/syclink/link.rb +62 -0
- data/lib/syclink/version.rb +7 -0
- data/lib/syclink/website.rb +62 -0
- data/lib/syclink/website_example.rb +68 -0
- data/lib/syclink.rb +7 -0
- data/setup.md +92 -0
- data/spec/syclink/designer_spec.rb +100 -0
- data/spec/syclink/link_spec.rb +47 -0
- data/spec/syclink/website_spec.rb +75 -0
- data/syclink.gemspec +23 -0
- data/syclink.rdoc +39 -0
- data/templates/links +4 -0
- data/templates/stylesheets/style.css +55 -0
- data/templates/stylesheets/style.css.map +7 -0
- data/templates/stylesheets/style.css.scss +76 -0
- data/templates/syc-link.html +123 -0
- data/templates/syclink.html.erb +63 -0
- metadata +193 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class SycLink::Designer - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script src="../js/jquery.js"></script>
|
|
14
|
+
<script src="../js/darkfish.js"></script>
|
|
15
|
+
|
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<body id="top" role="document" class="class">
|
|
22
|
+
<nav role="navigation">
|
|
23
|
+
<div id="project-navigation">
|
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
+
<h2>
|
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
|
27
|
+
</h2>
|
|
28
|
+
|
|
29
|
+
<div id="table-of-contents-navigation">
|
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
+
<div id="search-field-wrapper">
|
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
|
46
|
+
aria-busy="false" aria-expanded="false"
|
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
+
</form>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<div id="class-metadata">
|
|
56
|
+
|
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
|
58
|
+
<h3>Parent</h3>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<p class="link"><a href="../Object.html">Object</a>
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div id="includes-section" class="nav-section">
|
|
66
|
+
<h3>Included Modules</h3>
|
|
67
|
+
|
|
68
|
+
<ul class="link-list">
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
<li><a class="include" href="Infrastructure.html">SycLink::Infrastructure</a>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<!-- Method Quickref -->
|
|
79
|
+
<div id="method-list-section" class="nav-section">
|
|
80
|
+
<h3>Methods</h3>
|
|
81
|
+
|
|
82
|
+
<ul class="link-list" role="directory">
|
|
83
|
+
|
|
84
|
+
<li ><a href="#method-i-add_link">#add_link</a>
|
|
85
|
+
|
|
86
|
+
<li ><a href="#method-i-add_links_from_file">#add_links_from_file</a>
|
|
87
|
+
|
|
88
|
+
<li ><a href="#method-i-create_website">#create_website</a>
|
|
89
|
+
|
|
90
|
+
<li ><a href="#method-i-delete_website">#delete_website</a>
|
|
91
|
+
|
|
92
|
+
<li ><a href="#method-i-find_links">#find_links</a>
|
|
93
|
+
|
|
94
|
+
<li ><a href="#method-i-list_links">#list_links</a>
|
|
95
|
+
|
|
96
|
+
<li ><a href="#method-i-load_website">#load_website</a>
|
|
97
|
+
|
|
98
|
+
<li ><a href="#method-i-new_website">#new_website</a>
|
|
99
|
+
|
|
100
|
+
<li ><a href="#method-i-remove_links">#remove_links</a>
|
|
101
|
+
|
|
102
|
+
<li ><a href="#method-i-save_website">#save_website</a>
|
|
103
|
+
|
|
104
|
+
<li ><a href="#method-i-update_link">#update_link</a>
|
|
105
|
+
|
|
106
|
+
</ul>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
</nav>
|
|
111
|
+
|
|
112
|
+
<main role="main" aria-labelledby="class-SycLink::Designer">
|
|
113
|
+
<h1 id="class-SycLink::Designer" class="class">
|
|
114
|
+
class SycLink::Designer
|
|
115
|
+
</h1>
|
|
116
|
+
|
|
117
|
+
<section class="description">
|
|
118
|
+
|
|
119
|
+
<p>Creates a designer that acts as a proxy between the user and the website.
|
|
120
|
+
The designer will create a website with the provided title.</p>
|
|
121
|
+
|
|
122
|
+
</section>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<section class="attribute-method-details" class="method-section">
|
|
136
|
+
<header>
|
|
137
|
+
<h3>Attributes</h3>
|
|
138
|
+
</header>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<div id="attribute-i-website" class="method-detail">
|
|
142
|
+
<div class="method-heading attribute-method-heading">
|
|
143
|
+
<span class="method-name">website</span><span
|
|
144
|
+
class="attribute-access-type">[RW]</span>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div class="method-description">
|
|
148
|
+
|
|
149
|
+
<p>The website the designer is working on</p>
|
|
150
|
+
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
</section>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
159
|
+
<header>
|
|
160
|
+
<h3>Public Instance Methods</h3>
|
|
161
|
+
</header>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<div id="method-i-add_link" class="method-detail ">
|
|
165
|
+
|
|
166
|
+
<div class="method-heading">
|
|
167
|
+
<span class="method-name">add_link</span><span
|
|
168
|
+
class="method-args">(url, args = {})</span>
|
|
169
|
+
|
|
170
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
171
|
+
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<div class="method-description">
|
|
176
|
+
|
|
177
|
+
<p>Adds a link based on the provided arguments to the website</p>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
<div class="method-source-code" id="add_link-source">
|
|
183
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 24</span>
|
|
184
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_link</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">args</span> = {})
|
|
185
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">add_link</span>(<span class="ruby-constant">Link</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">args</span>))
|
|
186
|
+
<span class="ruby-keyword">end</span></pre>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
<div id="method-i-add_links_from_file" class="method-detail ">
|
|
198
|
+
|
|
199
|
+
<div class="method-heading">
|
|
200
|
+
<span class="method-name">add_links_from_file</span><span
|
|
201
|
+
class="method-args">(file)</span>
|
|
202
|
+
|
|
203
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
204
|
+
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<div class="method-description">
|
|
209
|
+
|
|
210
|
+
<p>Reads arguments from a CSV file and creates links accordingly. The links
|
|
211
|
+
are added to the websie</p>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
<div class="method-source-code" id="add_links_from_file-source">
|
|
217
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 30</span>
|
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_links_from_file</span>(<span class="ruby-identifier">file</span>)
|
|
219
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
|
220
|
+
<span class="ruby-identifier">url</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">description</span>, <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">';'</span>)
|
|
221
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">add_link</span>(<span class="ruby-constant">Link</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>, { <span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-identifier">name</span>,
|
|
222
|
+
<span class="ruby-identifier">description</span><span class="ruby-operator">:</span> <span class="ruby-identifier">description</span>,
|
|
223
|
+
<span class="ruby-identifier">tag</span><span class="ruby-operator">:</span> <span class="ruby-identifier">tag</span> }))
|
|
224
|
+
<span class="ruby-keyword">end</span>
|
|
225
|
+
<span class="ruby-keyword">end</span></pre>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
<div id="method-i-create_website" class="method-detail ">
|
|
237
|
+
|
|
238
|
+
<div class="method-heading">
|
|
239
|
+
<span class="method-name">create_website</span><span
|
|
240
|
+
class="method-args">(directory, template_filename)</span>
|
|
241
|
+
|
|
242
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
243
|
+
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<div class="method-description">
|
|
248
|
+
|
|
249
|
+
<p>Creates the html representation of the website. The website is saved to the
|
|
250
|
+
directory with websites title and needs an erb-template where the links are
|
|
251
|
+
integrated to. An example template can be found at
|
|
252
|
+
templates/syclink.html.erb</p>
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<div class="method-source-code" id="create_website-source">
|
|
258
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 88</span>
|
|
259
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_website</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">template_filename</span>)
|
|
260
|
+
<span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">template_filename</span>)
|
|
261
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">html_file</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">website</span>.<span class="ruby-identifier">title</span>), <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
262
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">website</span>.<span class="ruby-identifier">to_html</span>(<span class="ruby-identifier">template</span>)
|
|
263
|
+
<span class="ruby-keyword">end</span>
|
|
264
|
+
<span class="ruby-keyword">end</span></pre>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<div id="method-i-delete_website" class="method-detail ">
|
|
276
|
+
|
|
277
|
+
<div class="method-heading">
|
|
278
|
+
<span class="method-name">delete_website</span><span
|
|
279
|
+
class="method-args">(directory)</span>
|
|
280
|
+
|
|
281
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
282
|
+
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
<div class="method-description">
|
|
287
|
+
|
|
288
|
+
<p>Deletes the website if it already exists</p>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<div class="method-source-code" id="delete_website-source">
|
|
294
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 78</span>
|
|
295
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_website</span>(<span class="ruby-identifier">directory</span>)
|
|
296
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-identifier">yaml_file</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">website</span>.<span class="ruby-identifier">title</span>)
|
|
297
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>(<span class="ruby-identifier">yaml_file</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">website</span>.<span class="ruby-identifier">title</span>))
|
|
298
|
+
<span class="ruby-keyword">end</span>
|
|
299
|
+
<span class="ruby-keyword">end</span></pre>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
<div id="method-i-find_links" class="method-detail ">
|
|
311
|
+
|
|
312
|
+
<div class="method-heading">
|
|
313
|
+
<span class="method-name">find_links</span><span
|
|
314
|
+
class="method-args">(search)</span>
|
|
315
|
+
|
|
316
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
317
|
+
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
<div class="method-description">
|
|
322
|
+
|
|
323
|
+
<p>Finds links based on a search string</p>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
<div class="method-source-code" id="find_links-source">
|
|
329
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 45</span>
|
|
330
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find_links</span>(<span class="ruby-identifier">search</span>)
|
|
331
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">find_links</span>(<span class="ruby-identifier">search</span>)
|
|
332
|
+
<span class="ruby-keyword">end</span></pre>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
<div id="method-i-list_links" class="method-detail ">
|
|
344
|
+
|
|
345
|
+
<div class="method-heading">
|
|
346
|
+
<span class="method-name">list_links</span><span
|
|
347
|
+
class="method-args">(args = {})</span>
|
|
348
|
+
|
|
349
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
350
|
+
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<div class="method-description">
|
|
355
|
+
|
|
356
|
+
<p>List links contained in the website and optionally filter on attributes</p>
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
<div class="method-source-code" id="list_links-source">
|
|
362
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 40</span>
|
|
363
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">list_links</span>(<span class="ruby-identifier">args</span> = {})
|
|
364
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">list_links</span>(<span class="ruby-identifier">args</span>)
|
|
365
|
+
<span class="ruby-keyword">end</span></pre>
|
|
366
|
+
</div>
|
|
367
|
+
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<div id="method-i-load_website" class="method-detail ">
|
|
377
|
+
|
|
378
|
+
<div class="method-heading">
|
|
379
|
+
<span class="method-name">load_website</span><span
|
|
380
|
+
class="method-args">(website)</span>
|
|
381
|
+
|
|
382
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
383
|
+
|
|
384
|
+
</div>
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
<div class="method-description">
|
|
388
|
+
|
|
389
|
+
<p>Loads a website based on the provided YAML-file and asigns it to the
|
|
390
|
+
designer to operate on</p>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
<div class="method-source-code" id="load_website-source">
|
|
396
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 73</span>
|
|
397
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">load_website</span>(<span class="ruby-identifier">website</span>)
|
|
398
|
+
<span class="ruby-ivar">@website</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">website</span>)
|
|
399
|
+
<span class="ruby-keyword">end</span></pre>
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
<div id="method-i-new_website" class="method-detail ">
|
|
411
|
+
|
|
412
|
+
<div class="method-heading">
|
|
413
|
+
<span class="method-name">new_website</span><span
|
|
414
|
+
class="method-args">(title = "SYC LINK")</span>
|
|
415
|
+
|
|
416
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
417
|
+
|
|
418
|
+
</div>
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
<div class="method-description">
|
|
422
|
+
|
|
423
|
+
<p>Creates a new website where designer can operate on</p>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<div class="method-source-code" id="new_website-source">
|
|
429
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 19</span>
|
|
430
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">new_website</span>(<span class="ruby-identifier">title</span> = <span class="ruby-string">"SYC LINK"</span>)
|
|
431
|
+
<span class="ruby-ivar">@website</span> = <span class="ruby-constant">Website</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">title</span>)
|
|
432
|
+
<span class="ruby-keyword">end</span></pre>
|
|
433
|
+
</div>
|
|
434
|
+
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
</div>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
<div id="method-i-remove_links" class="method-detail ">
|
|
444
|
+
|
|
445
|
+
<div class="method-heading">
|
|
446
|
+
<span class="method-name">remove_links</span><span
|
|
447
|
+
class="method-args">(urls)</span>
|
|
448
|
+
|
|
449
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
450
|
+
|
|
451
|
+
</div>
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
<div class="method-description">
|
|
455
|
+
|
|
456
|
+
<p>Deletes one or more links from the website. Returns the deleted links.
|
|
457
|
+
Expects the links provided in an array</p>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
<div class="method-source-code" id="remove_links-source">
|
|
463
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 57</span>
|
|
464
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">remove_links</span>(<span class="ruby-identifier">urls</span>)
|
|
465
|
+
<span class="ruby-identifier">urls</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span> <span class="ruby-identifier">list_links</span>({ <span class="ruby-identifier">url</span><span class="ruby-operator">:</span> <span class="ruby-identifier">url</span> }) }.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">link</span><span class="ruby-operator">|</span>
|
|
466
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">remove_link</span>(<span class="ruby-identifier">link</span>)
|
|
467
|
+
<span class="ruby-keyword">end</span>
|
|
468
|
+
<span class="ruby-keyword">end</span></pre>
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
<div id="method-i-save_website" class="method-detail ">
|
|
480
|
+
|
|
481
|
+
<div class="method-heading">
|
|
482
|
+
<span class="method-name">save_website</span><span
|
|
483
|
+
class="method-args">(directory)</span>
|
|
484
|
+
|
|
485
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
486
|
+
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
<div class="method-description">
|
|
491
|
+
|
|
492
|
+
<p>Saves the website to the specified directory with the downcased name of the
|
|
493
|
+
website and the extension 'website'. The website is save as YAML</p>
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
<div class="method-source-code" id="save_website-source">
|
|
499
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 65</span>
|
|
500
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save_website</span>(<span class="ruby-identifier">directory</span>)
|
|
501
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">yaml_file</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">website</span>.<span class="ruby-identifier">title</span>), <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
502
|
+
<span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">website</span>, <span class="ruby-identifier">f</span>)
|
|
503
|
+
<span class="ruby-keyword">end</span>
|
|
504
|
+
<span class="ruby-keyword">end</span></pre>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
</div>
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
</div>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<div id="method-i-update_link" class="method-detail ">
|
|
516
|
+
|
|
517
|
+
<div class="method-heading">
|
|
518
|
+
<span class="method-name">update_link</span><span
|
|
519
|
+
class="method-args">(url, args)</span>
|
|
520
|
+
|
|
521
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
522
|
+
|
|
523
|
+
</div>
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<div class="method-description">
|
|
527
|
+
|
|
528
|
+
<p>Updates a link. The link is identified by the URL. If there is more than
|
|
529
|
+
one link with the same URL, only the first link is updated</p>
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
<div class="method-source-code" id="update_link-source">
|
|
535
|
+
<pre><span class="ruby-comment"># File lib/syclink/designer.rb, line 51</span>
|
|
536
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update_link</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">args</span>)
|
|
537
|
+
<span class="ruby-identifier">website</span>.<span class="ruby-identifier">find_links</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">args</span>)
|
|
538
|
+
<span class="ruby-keyword">end</span></pre>
|
|
539
|
+
</div>
|
|
540
|
+
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
</div>
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
</section>
|
|
550
|
+
|
|
551
|
+
</section>
|
|
552
|
+
</main>
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
<footer id="validator-badges" role="contentinfo">
|
|
556
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
557
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
|
558
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
559
|
+
</footer>
|
|
560
|
+
|