thesilverspoon 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -0
- data/doc/<.html +145 -0
- data/doc/ApplicationHelper.html +255 -0
- data/doc/Create.html +151 -0
- data/doc/Everything.html +147 -0
- data/doc/Everything/Scaffold.html +502 -0
- data/doc/FileUploader.html +243 -0
- data/doc/Gemfile.html +112 -0
- data/doc/Gemfile~.html +112 -0
- data/doc/Object.html +528 -0
- data/doc/README.rdoc +12 -0
- data/doc/README.rdoc~ +12 -0
- data/doc/README_rdoc.html +107 -0
- data/doc/Rakefile.html +109 -0
- data/doc/The_silver_spoon.html +145 -0
- data/doc/The_silver_spoon/Install.html +602 -0
- data/doc/Thesilverspoon.html +158 -0
- data/doc/created.rid +23 -0
- data/doc/doc/README_rdoc.html +107 -0
- data/doc/images/add.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 +104 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +160 -0
- data/lib/integratedscaffold.rb +36 -12
- data/lib/thesilverspoon.rb +15 -7
- data/lib/thesilverspoon.rb~ +14 -6
- data/lib/thesilverspoon/version.rb +1 -1
- data/lib/thesilverspoon/version.rb~ +1 -1
- data/thesilverspoon.gemspec +2 -0
- data/thesilverspoon.gemspec~ +2 -0
- metadata +70 -18
data/doc/Everything.html
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module Everything - 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="module">
|
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/thesilverspoon.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div id="project-metadata">
|
65
|
+
<nav id="fileindex-section" class="section project-section">
|
66
|
+
<h3 class="section-header">Pages</h3>
|
67
|
+
|
68
|
+
<ul>
|
69
|
+
|
70
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
71
|
+
|
72
|
+
<li class="file"><a href="./Gemfile~.html">Gemfile~</a>
|
73
|
+
|
74
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
75
|
+
|
76
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
77
|
+
|
78
|
+
<li class="file"><a href="./doc/README_rdoc.html">README</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<nav id="classindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Class and Module Index</h3>
|
85
|
+
|
86
|
+
<ul class="link-list">
|
87
|
+
|
88
|
+
<li><a href="./Everything.html">Everything</a>
|
89
|
+
|
90
|
+
<li><a href="./Everything/Scaffold.html">Everything::Scaffold</a>
|
91
|
+
|
92
|
+
<li><a href="./The_silver_spoon.html">The_silver_spoon</a>
|
93
|
+
|
94
|
+
<li><a href="./The_silver_spoon/Install.html">The_silver_spoon::Install</a>
|
95
|
+
|
96
|
+
<li><a href="./<.html"><</a>
|
97
|
+
|
98
|
+
<li><a href="./ApplicationHelper.html">ApplicationHelper</a>
|
99
|
+
|
100
|
+
<li><a href="./Create.html">Create</a>
|
101
|
+
|
102
|
+
<li><a href="./FileUploader.html">FileUploader</a>
|
103
|
+
|
104
|
+
<li><a href="./Object.html">Object</a>
|
105
|
+
|
106
|
+
<li><a href="./Thesilverspoon.html">Thesilverspoon</a>
|
107
|
+
|
108
|
+
</ul>
|
109
|
+
</nav>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</nav>
|
113
|
+
|
114
|
+
<div id="documentation">
|
115
|
+
<h1 class="module">module Everything</h1>
|
116
|
+
|
117
|
+
<div id="description" class="description">
|
118
|
+
|
119
|
+
<p>sample module</p>
|
120
|
+
|
121
|
+
</div><!-- description -->
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<!-- Methods -->
|
136
|
+
|
137
|
+
</section><!-- 5Buntitled-5D -->
|
138
|
+
|
139
|
+
</div><!-- documentation -->
|
140
|
+
|
141
|
+
|
142
|
+
<footer id="validator-badges">
|
143
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
144
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
145
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
146
|
+
</footer>
|
147
|
+
|
@@ -0,0 +1,502 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Everything::Scaffold - 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/thesilverspoon.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">Rails::Generators::NamedBase
|
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-c-new">::new</a>
|
74
|
+
|
75
|
+
<li><a href="#method-c-source_root">::source_root</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-create_controller">#create_controller</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-create_helper">#create_helper</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-create_migration">#create_migration</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-create_model">#create_model</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-create_routes">#create_routes</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-create_views">#create_views</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="../Gemfile.html">Gemfile</a>
|
101
|
+
|
102
|
+
<li class="file"><a href="../Gemfile~.html">Gemfile~</a>
|
103
|
+
|
104
|
+
<li class="file"><a href="../README_rdoc.html">README</a>
|
105
|
+
|
106
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a>
|
107
|
+
|
108
|
+
<li class="file"><a href="../doc/README_rdoc.html">README</a>
|
109
|
+
|
110
|
+
</ul>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<nav id="classindex-section" class="section project-section">
|
114
|
+
<h3 class="section-header">Class and Module Index</h3>
|
115
|
+
|
116
|
+
<ul class="link-list">
|
117
|
+
|
118
|
+
<li><a href="../Everything.html">Everything</a>
|
119
|
+
|
120
|
+
<li><a href="../Everything/Scaffold.html">Everything::Scaffold</a>
|
121
|
+
|
122
|
+
<li><a href="../The_silver_spoon.html">The_silver_spoon</a>
|
123
|
+
|
124
|
+
<li><a href="../The_silver_spoon/Install.html">The_silver_spoon::Install</a>
|
125
|
+
|
126
|
+
<li><a href="../<.html"><</a>
|
127
|
+
|
128
|
+
<li><a href="../ApplicationHelper.html">ApplicationHelper</a>
|
129
|
+
|
130
|
+
<li><a href="../Create.html">Create</a>
|
131
|
+
|
132
|
+
<li><a href="../FileUploader.html">FileUploader</a>
|
133
|
+
|
134
|
+
<li><a href="../Object.html">Object</a>
|
135
|
+
|
136
|
+
<li><a href="../Thesilverspoon.html">Thesilverspoon</a>
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
</nav>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</nav>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="class">class Everything::Scaffold</h1>
|
146
|
+
|
147
|
+
<div id="description" class="description">
|
148
|
+
|
149
|
+
<p>If you use the NamedBase inheritance, a ‘name’ parameter has to follow the
|
150
|
+
‘rails g integratedscaffold’. Won’t work otherwise. If you don’t want this,
|
151
|
+
use ::Base</p>
|
152
|
+
|
153
|
+
</div><!-- description -->
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<!-- Attributes -->
|
167
|
+
<section id="attribute-method-details" class="method-section section">
|
168
|
+
<h3 class="section-header">Attributes</h3>
|
169
|
+
|
170
|
+
|
171
|
+
<div id="attribute-i-controller_actions" class="method-detail">
|
172
|
+
<div class="method-heading attribute-method-heading">
|
173
|
+
<span class="method-name">controller_actions</span><span
|
174
|
+
class="attribute-access-type">[RW]</span>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div id="attribute-i-model_attributes" class="method-detail">
|
185
|
+
<div class="method-heading attribute-method-heading">
|
186
|
+
<span class="method-name">model_attributes</span><span
|
187
|
+
class="attribute-access-type">[RW]</span>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</section><!-- attribute-method-details -->
|
198
|
+
|
199
|
+
|
200
|
+
<!-- Methods -->
|
201
|
+
|
202
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
203
|
+
<h3 class="section-header">Public Class Methods</h3>
|
204
|
+
|
205
|
+
|
206
|
+
<div id="method-c-new" class="method-detail ">
|
207
|
+
|
208
|
+
<div class="method-heading">
|
209
|
+
<span class="method-name">new</span><span
|
210
|
+
class="method-args">(*args, &block)</span>
|
211
|
+
<span class="method-click-advice">click to toggle source</span>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
|
215
|
+
<div class="method-description">
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<div class="method-source-code" id="new-source">
|
222
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 20</span>
|
223
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(*<span class="ruby-identifier">args</span>, &<span class="ruby-identifier">block</span>)
|
224
|
+
|
225
|
+
<span class="ruby-comment"># This is a standard initializer</span>
|
226
|
+
|
227
|
+
<span class="ruby-keyword">super</span> <span class="ruby-comment"># Call parent class</span>
|
228
|
+
<span class="ruby-ivar">@model_attributes</span> = [] <span class="ruby-comment"># Initialize empty array for 'thor' attributes</span>
|
229
|
+
|
230
|
+
<span class="ruby-comment"># This method splits the name:type arguments in the parameters list</span>
|
231
|
+
<span class="ruby-identifier">g_parameters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
|
232
|
+
<span class="ruby-ivar">@model_attributes</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">Generators</span><span class="ruby-operator">::</span><span class="ruby-constant">GeneratedAttribute</span>.<span class="ruby-identifier">new</span>(*<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">':'</span>))
|
233
|
+
<span class="ruby-keyword">end</span>
|
234
|
+
|
235
|
+
<span class="ruby-comment"># Creates a list of all the standard actions in the controller</span>
|
236
|
+
<span class="ruby-ivar">@controller_actions</span>=<span class="ruby-identifier">all_actions</span>
|
237
|
+
|
238
|
+
<span class="ruby-keyword">end</span></pre>
|
239
|
+
</div><!-- new-source -->
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</div><!-- new-method -->
|
247
|
+
|
248
|
+
|
249
|
+
<div id="method-c-source_root" class="method-detail ">
|
250
|
+
|
251
|
+
<div class="method-heading">
|
252
|
+
<span class="method-name">source_root</span><span
|
253
|
+
class="method-args">()</span>
|
254
|
+
<span class="method-click-advice">click to toggle source</span>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
|
258
|
+
<div class="method-description">
|
259
|
+
|
260
|
+
<p>this sets the path where the code looks for templates within the gem</p>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<div class="method-source-code" id="source_root-source">
|
265
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 16</span>
|
266
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">source_root</span>
|
267
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">"../templates"</span>, <span class="ruby-keyword">__FILE__</span>)
|
268
|
+
<span class="ruby-keyword">end</span></pre>
|
269
|
+
</div><!-- source_root-source -->
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
</div><!-- source_root-method -->
|
277
|
+
|
278
|
+
|
279
|
+
</section><!-- public-class-method-details -->
|
280
|
+
|
281
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
282
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
283
|
+
|
284
|
+
|
285
|
+
<div id="method-i-create_controller" class="method-detail ">
|
286
|
+
|
287
|
+
<div class="method-heading">
|
288
|
+
<span class="method-name">create_controller</span><span
|
289
|
+
class="method-args">()</span>
|
290
|
+
<span class="method-click-advice">click to toggle source</span>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
|
294
|
+
<div class="method-description">
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
<div class="method-source-code" id="create_controller-source">
|
301
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 45</span>
|
302
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_controller</span>
|
303
|
+
|
304
|
+
<span class="ruby-comment"># creates the controller using the 'controller.rb' template and puts it into the rails app</span>
|
305
|
+
<span class="ruby-identifier">template</span> <span class="ruby-string">'controller.rb'</span>, <span class="ruby-node">"app/controllers/#{plural_name}_controller.rb"</span>
|
306
|
+
<span class="ruby-keyword">end</span></pre>
|
307
|
+
</div><!-- create_controller-source -->
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</div><!-- create_controller-method -->
|
315
|
+
|
316
|
+
|
317
|
+
<div id="method-i-create_helper" class="method-detail ">
|
318
|
+
|
319
|
+
<div class="method-heading">
|
320
|
+
<span class="method-name">create_helper</span><span
|
321
|
+
class="method-args">()</span>
|
322
|
+
<span class="method-click-advice">click to toggle source</span>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
|
326
|
+
<div class="method-description">
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<div class="method-source-code" id="create_helper-source">
|
333
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 58</span>
|
334
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_helper</span>
|
335
|
+
|
336
|
+
<span class="ruby-comment"># creates the helper using the 'helper.rb' template and puts it into the rails app</span>
|
337
|
+
<span class="ruby-identifier">template</span> <span class="ruby-string">'helper.rb'</span>, <span class="ruby-node">"app/helpers/#{plural_name}_helper.rb"</span>
|
338
|
+
<span class="ruby-keyword">end</span></pre>
|
339
|
+
</div><!-- create_helper-source -->
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</div><!-- create_helper-method -->
|
347
|
+
|
348
|
+
|
349
|
+
<div id="method-i-create_migration" class="method-detail ">
|
350
|
+
|
351
|
+
<div class="method-heading">
|
352
|
+
<span class="method-name">create_migration</span><span
|
353
|
+
class="method-args">()</span>
|
354
|
+
<span class="method-click-advice">click to toggle source</span>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
|
358
|
+
<div class="method-description">
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
<div class="method-source-code" id="create_migration-source">
|
365
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 51</span>
|
366
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_migration</span>
|
367
|
+
|
368
|
+
<span class="ruby-comment"># creates the migration file using the 'migration.rb' template and puts it into the rails app with a time stamp</span>
|
369
|
+
<span class="ruby-identifier">template</span> <span class="ruby-string">'migration.rb'</span>, <span class="ruby-node">"db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_create_#{model_path.pluralize.gsub('/', '_')}.rb"</span>
|
370
|
+
|
371
|
+
<span class="ruby-keyword">end</span></pre>
|
372
|
+
</div><!-- create_migration-source -->
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div><!-- create_migration-method -->
|
380
|
+
|
381
|
+
|
382
|
+
<div id="method-i-create_model" class="method-detail ">
|
383
|
+
|
384
|
+
<div class="method-heading">
|
385
|
+
<span class="method-name">create_model</span><span
|
386
|
+
class="method-args">()</span>
|
387
|
+
<span class="method-click-advice">click to toggle source</span>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
|
391
|
+
<div class="method-description">
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
<div class="method-source-code" id="create_model-source">
|
398
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 38</span>
|
399
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_model</span>
|
400
|
+
|
401
|
+
<span class="ruby-comment"># creates the model using the 'model.rb' template and puts it into the rails app</span>
|
402
|
+
<span class="ruby-identifier">template</span> <span class="ruby-string">'model.rb'</span>, <span class="ruby-node">"app/models/#{model_path}.rb"</span>
|
403
|
+
|
404
|
+
<span class="ruby-keyword">end</span></pre>
|
405
|
+
</div><!-- create_model-source -->
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
</div><!-- create_model-method -->
|
413
|
+
|
414
|
+
|
415
|
+
<div id="method-i-create_routes" class="method-detail ">
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<span class="method-name">create_routes</span><span
|
419
|
+
class="method-args">()</span>
|
420
|
+
<span class="method-click-advice">click to toggle source</span>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
|
424
|
+
<div class="method-description">
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
<div class="method-source-code" id="create_routes-source">
|
431
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 64</span>
|
432
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_routes</span>
|
433
|
+
|
434
|
+
<span class="ruby-comment"># adds the routes for the gem into the routes file</span>
|
435
|
+
<span class="ruby-identifier">namespaces</span> = <span class="ruby-identifier">plural_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'/'</span>)
|
436
|
+
<span class="ruby-identifier">resource</span> = <span class="ruby-identifier">namespaces</span>.<span class="ruby-identifier">pop</span>
|
437
|
+
<span class="ruby-identifier">route</span> <span class="ruby-identifier">namespaces</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-node">"resources :#{resource}"</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">acc</span>, <span class="ruby-identifier">namespace</span><span class="ruby-operator">|</span>
|
438
|
+
<span class="ruby-node">"namespace(:#{namespace}){ #{acc} }"</span>
|
439
|
+
}
|
440
|
+
<span class="ruby-keyword">end</span></pre>
|
441
|
+
</div><!-- create_routes-source -->
|
442
|
+
|
443
|
+
</div>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
</div><!-- create_routes-method -->
|
449
|
+
|
450
|
+
|
451
|
+
<div id="method-i-create_views" class="method-detail ">
|
452
|
+
|
453
|
+
<div class="method-heading">
|
454
|
+
<span class="method-name">create_views</span><span
|
455
|
+
class="method-args">()</span>
|
456
|
+
<span class="method-click-advice">click to toggle source</span>
|
457
|
+
</div>
|
458
|
+
|
459
|
+
|
460
|
+
<div class="method-description">
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
<div class="method-source-code" id="create_views-source">
|
467
|
+
<pre><span class="ruby-comment"># File lib/thesilverspoon.rb, line 75</span>
|
468
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_views</span>
|
469
|
+
|
470
|
+
<span class="ruby-comment"># creates the standard views using the '[action].html.erb' templates and puts it into the rails app</span>
|
471
|
+
<span class="ruby-identifier">controller_actions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span><span class="ruby-operator">|</span>
|
472
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">action!</span>=<span class="ruby-string">"create"</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">action!</span>=<span class="ruby-string">"update"</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">action!</span>=<span class="ruby-string">"destroy"</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">action!</span>=<span class="ruby-string">"parse_save_from_excel"</span>
|
473
|
+
<span class="ruby-identifier">template</span> <span class="ruby-node">"views/erb/#{action}.html.erb"</span>, <span class="ruby-node">"app/views/#{plural_name}/#{action}.html.erb"</span>
|
474
|
+
<span class="ruby-keyword">end</span>
|
475
|
+
<span class="ruby-keyword">end</span>
|
476
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">form_partial?</span>
|
477
|
+
<span class="ruby-identifier">template</span> <span class="ruby-string">"views/erb/_form.html.erb"</span>, <span class="ruby-node">"app/views/#{plural_name}/_form.html.erb"</span>
|
478
|
+
<span class="ruby-keyword">end</span>
|
479
|
+
<span class="ruby-keyword">end</span></pre>
|
480
|
+
</div><!-- create_views-source -->
|
481
|
+
|
482
|
+
</div>
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
</div><!-- create_views-method -->
|
488
|
+
|
489
|
+
|
490
|
+
</section><!-- public-instance-method-details -->
|
491
|
+
|
492
|
+
</section><!-- 5Buntitled-5D -->
|
493
|
+
|
494
|
+
</div><!-- documentation -->
|
495
|
+
|
496
|
+
|
497
|
+
<footer id="validator-badges">
|
498
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
499
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
500
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
501
|
+
</footer>
|
502
|
+
|