bivouac 0.3.0 → 0.4.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.
- data/README +15 -0
- data/bin/bivouac +5 -10
- data/doc/rdoc/classes/BivouacHelpers/HtmlView.html +46 -37
- data/doc/rdoc/classes/BivouacHelpers/ScriptAculoUsView.html +27 -20
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +45 -1
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/html_rb.html +1 -1
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +1 -1
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html +1 -1
- data/examples/bivouac_sample/Rakefile +0 -0
- data/examples/bivouac_sample/app/controllers/toggle_sortable.rb +2 -1
- data/examples/bivouac_sample/app/views/_sortable_result.rb +1 -1
- data/examples/bivouac_sample/script/console +0 -0
- data/examples/bivouac_sample/script/generate +0 -0
- data/examples/bivouac_sample/script/plugin +0 -0
- data/examples/bivouac_sample/script/server +0 -0
- data/examples/blog/Rakefile +56 -0
- data/examples/blog/app/blog.rb +107 -0
- data/examples/blog/app/controllers/comment.rb +17 -0
- data/examples/blog/app/controllers/index.rb +15 -0
- data/examples/blog/app/controllers/login.rb +33 -0
- data/examples/blog/app/controllers/logout.rb +15 -0
- data/examples/blog/app/controllers/not_found.rb +14 -0
- data/examples/blog/app/controllers/post.rb +48 -0
- data/examples/blog/app/helpers/_helpers.rb +30 -0
- data/examples/blog/app/helpers/blog.rb +14 -0
- data/examples/blog/app/models/comment.rb +18 -0
- data/examples/blog/app/models/post.rb +19 -0
- data/examples/blog/app/models/user.rb +12 -0
- data/examples/blog/app/views/_partials.rb +81 -0
- data/examples/blog/app/views/index/index.rb +23 -0
- data/examples/blog/app/views/layouts/default_layout.rb +40 -0
- data/examples/blog/app/views/login/login.rb +27 -0
- data/examples/blog/app/views/not_found.rb +13 -0
- data/examples/blog/app/views/post/add.rb +12 -0
- data/examples/blog/app/views/post/edit.rb +12 -0
- data/examples/blog/app/views/post/view.rb +14 -0
- data/examples/blog/config/console.rc +12 -0
- data/examples/blog/config/database.yml +3 -0
- data/examples/blog/config/environment.rb +58 -0
- data/examples/blog/db/blog.db +0 -0
- data/examples/blog/db/create.rb +11 -0
- data/examples/blog/db/migrate/001_users.rb +22 -0
- data/examples/blog/db/migrate/002_posts.rb +24 -0
- data/examples/blog/db/migrate/003_comments.rb +24 -0
- data/examples/blog/log/Blog.log +382 -0
- data/examples/{blog_goh → blog}/public/images/camping.png +0 -0
- data/examples/{blog_goh → blog}/public/index.html +3 -2
- data/examples/blog/public/javascripts/builder.js +136 -0
- data/examples/blog/public/javascripts/controls.js +965 -0
- data/examples/blog/public/javascripts/dragdrop.js +974 -0
- data/examples/blog/public/javascripts/effects.js +1122 -0
- data/examples/blog/public/javascripts/prototype.js +4320 -0
- data/examples/blog/public/javascripts/scriptaculous.js +58 -0
- data/examples/blog/public/javascripts/slider.js +275 -0
- data/examples/blog/public/javascripts/sound.js +55 -0
- data/examples/blog/public/javascripts/unittest.js +568 -0
- data/examples/blog/public/stylesheets/autocomplete.css +22 -0
- data/examples/blog/public/stylesheets/blog.css +107 -0
- data/examples/blog/script/console +12 -0
- data/examples/blog/script/generate +17 -0
- data/examples/blog/script/plugin +16 -0
- data/examples/blog/script/server +135 -0
- data/examples/blog/test/test_comment.rb +22 -0
- data/examples/blog/test/test_index.rb +22 -0
- data/examples/blog/test/test_login.rb +22 -0
- data/examples/blog/test/test_logout.rb +18 -0
- data/examples/blog/test/test_post.rb +30 -0
- data/examples/blog/test/test_post_new.rb +22 -0
- data/lib/bivouac.rb +2 -2
- data/lib/bivouac/commands/generate.rb +48 -8
- data/lib/bivouac/commands/plugin.rb +30 -15
- data/lib/bivouac/ext/filtering_camping.rb +46 -0
- data/lib/bivouac/helpers/view/goh/html.rb +9 -0
- data/lib/bivouac/helpers/view/goh/scriptaculous.rb +12 -8
- data/lib/bivouac/tasks/bivouac.rb +1 -0
- data/lib/bivouac/tasks/framework.rake +8 -8
- data/lib/bivouac/tasks/plugins.rake +17 -1
- data/lib/bivouac/template.rb +0 -0
- data/lib/bivouac/template/{application_goh.rb → application.rb} +36 -12
- data/lib/bivouac/template/application/{helpers_goh.rb → helpers.rb} +1 -1
- data/lib/bivouac/template/console.rb +2 -4
- data/lib/bivouac/template/environment.rb +1 -1
- data/lib/bivouac/template/generate.rb +0 -0
- data/lib/bivouac/template/generate/create.rb +0 -0
- data/lib/bivouac/template/generate/helper.rb +12 -0
- data/lib/bivouac/template/generate/migrate.rb +0 -0
- data/lib/bivouac/template/generate/migrate_end.rb +1 -0
- data/lib/bivouac/template/plugin.rb +6 -1
- data/lib/bivouac/template/server.rb +124 -3
- data/lib/bivouac/template/static/builder.js +19 -19
- data/lib/bivouac/template/static/controls.js +74 -74
- data/lib/bivouac/template/static/dragdrop.js +167 -166
- data/lib/bivouac/template/static/effects.js +171 -163
- data/lib/bivouac/template/static/not_found_controller.rb +8 -4
- data/lib/bivouac/template/static/prototype.js +218 -119
- data/lib/bivouac/template/static/scriptaculous.js +22 -20
- data/lib/bivouac/template/static/slider.js +39 -39
- data/lib/bivouac/template/static/sound.js +11 -11
- data/lib/bivouac/template/static/unittest.js +16 -16
- metadata +96 -60
- data/examples/blog_goh/app/blog.rb +0 -72
- data/examples/blog_goh/app/controllers/add.rb +0 -19
- data/examples/blog_goh/app/controllers/comment.rb +0 -9
- data/examples/blog_goh/app/controllers/edit.rb +0 -18
- data/examples/blog_goh/app/controllers/index.rb +0 -8
- data/examples/blog_goh/app/controllers/info.rb +0 -11
- data/examples/blog_goh/app/controllers/login.rb +0 -15
- data/examples/blog_goh/app/controllers/logout.rb +0 -8
- data/examples/blog_goh/app/controllers/view.rb +0 -9
- data/examples/blog_goh/app/models/comment.rb +0 -5
- data/examples/blog_goh/app/models/post.rb +0 -5
- data/examples/blog_goh/app/models/user.rb +0 -4
- data/examples/blog_goh/app/views/_form.rb +0 -16
- data/examples/blog_goh/app/views/_login.rb +0 -13
- data/examples/blog_goh/app/views/_post.rb +0 -9
- data/examples/blog_goh/app/views/add.rb +0 -9
- data/examples/blog_goh/app/views/edit.rb +0 -9
- data/examples/blog_goh/app/views/index.rb +0 -12
- data/examples/blog_goh/app/views/layout.rb +0 -18
- data/examples/blog_goh/app/views/login.rb +0 -6
- data/examples/blog_goh/app/views/logout.rb +0 -6
- data/examples/blog_goh/app/views/view.rb +0 -20
- data/examples/blog_goh/config/environment.rb +0 -27
- data/examples/blog_goh/db/Blog.db +0 -0
- data/examples/blog_goh/db/create.rb +0 -8
- data/examples/blog_goh/db/migrate/comment.rb +0 -15
- data/examples/blog_goh/db/migrate/post.rb +0 -15
- data/examples/blog_goh/db/migrate/user.rb +0 -15
- data/examples/blog_goh/log/Blog.log +0 -75
- data/examples/blog_goh/public/stylesheets/style.css +0 -10
- data/examples/blog_goh/script/generate +0 -3
- data/examples/blog_goh/script/server +0 -5
- data/lib/bivouac/template/application/postamble.rb +0 -195
- data/lib/camping/cookies_sessions.rb +0 -39
data/README
CHANGED
|
@@ -20,6 +20,21 @@ Bivouac is a simple generator for camping[http://code.whytheluckystiff.net/campi
|
|
|
20
20
|
|
|
21
21
|
== FEATURES/PROBLEMS:
|
|
22
22
|
|
|
23
|
+
=== 0.4.0:
|
|
24
|
+
* Work with Camping >= 1.9 ! This is the most important !
|
|
25
|
+
* options_for_javascript bug correction
|
|
26
|
+
* in environment.rb, address has been renamed host
|
|
27
|
+
* markaby dependency added
|
|
28
|
+
* Add :ieOnly option to javascript_include_tag
|
|
29
|
+
* postamble.rb is deprecated
|
|
30
|
+
* script/plugin and Bivouac::Plugin class have been modified to support a new Rakefile task : plugin:update
|
|
31
|
+
* Update "Not Found" controller
|
|
32
|
+
* Replace before_filter with the better Magnus Holm solution (http://github.com/judofyr/filtering_camping/tree/master)
|
|
33
|
+
* script/generate view is no longer deprecated.
|
|
34
|
+
* Add helper generator.
|
|
35
|
+
* not_found controller changed
|
|
36
|
+
* Upgrade Script.aculo.us (1.8.2)
|
|
37
|
+
|
|
23
38
|
=== 0.3.0:
|
|
24
39
|
|
|
25
40
|
* script/plugin improvements
|
data/bin/bivouac
CHANGED
|
@@ -26,7 +26,7 @@ database_configuration = {
|
|
|
26
26
|
:db => { :adapter => 'sqlite3', :database => 'db/bivouac.db' },
|
|
27
27
|
:orgtype => "GOH",
|
|
28
28
|
:port => 3301,
|
|
29
|
-
:
|
|
29
|
+
:host => "0.0.0.0",
|
|
30
30
|
:session => :cookie,
|
|
31
31
|
:versions => "{ :scripts => '#{@BIVOUAC_VERSION}', :public => '#{@BIVOUAC_VERSION}', :configs => '#{@BIVOUAC_VERSION}', :app => '#{@BIVOUAC_VERSION}' }"
|
|
32
32
|
)
|
|
@@ -69,8 +69,8 @@ opts = OptionParser.new do |opts|
|
|
|
69
69
|
@conf.port = port
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
opts.on("-
|
|
73
|
-
@conf.
|
|
72
|
+
opts.on("-H", "--host ADDR", "Address to bind to (0.0.0.0)") { |host|
|
|
73
|
+
@conf.host = host
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
opts.on("-S", "--session TYPE", "Session type (db|cookie). Default : cookie") { |session|
|
|
@@ -156,19 +156,14 @@ createFile( "#{@conf.appdir}/config/database.yml" ) { |io|
|
|
|
156
156
|
io.puts YAML.dump( @conf.db )
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
# Create Application Postamble file
|
|
160
|
-
createFile( "#{@conf.appdir}/config/postamble.rb" ) { |io|
|
|
161
|
-
io.puts template( "application/postamble" )
|
|
162
|
-
}
|
|
163
|
-
|
|
164
159
|
# Create Application file
|
|
165
160
|
createFile( "#{@conf.appdir}/app/#{@conf.appfile}.rb" ) { |io|
|
|
166
|
-
io.puts template( "
|
|
161
|
+
io.puts template( "application" )
|
|
167
162
|
}
|
|
168
163
|
|
|
169
164
|
# Create Application Helpers Loader file
|
|
170
165
|
createFile( "#{@conf.appdir}/app/helpers/_helpers.rb" ) { |io|
|
|
171
|
-
io.puts template( "application/
|
|
166
|
+
io.puts template( "application/helpers" )
|
|
172
167
|
}
|
|
173
168
|
|
|
174
169
|
# Create generate script
|
|
@@ -122,14 +122,14 @@ href="HtmlView.html#M000042">image_tag</a> to build the image path.
|
|
|
122
122
|
<p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>
|
|
123
123
|
<div id="M000043_source" class="dyn-source">
|
|
124
124
|
<pre>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line 98</span>
|
|
126
|
+
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">image_path</span>( <span class="ruby-identifier">source</span> )
|
|
127
|
+
99: <span class="ruby-keyword kw">if</span> <span class="ruby-regexp re">/^http:\/\//</span>.<span class="ruby-identifier">match</span>( <span class="ruby-identifier">source</span> ) <span class="ruby-operator">||</span> <span class="ruby-regexp re">/^\//</span>.<span class="ruby-identifier">match</span>( <span class="ruby-identifier">source</span> )
|
|
128
|
+
100: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">source</span>
|
|
129
|
+
101: <span class="ruby-keyword kw">else</span>
|
|
130
|
+
102: <span class="ruby-keyword kw">return</span> <span class="ruby-node">"/public/images/#{source}"</span>
|
|
131
|
+
103: <span class="ruby-keyword kw">end</span>
|
|
132
|
+
104: <span class="ruby-keyword kw">end</span>
|
|
133
133
|
</pre>
|
|
134
134
|
</div>
|
|
135
135
|
</div>
|
|
@@ -155,13 +155,13 @@ without the extension)
|
|
|
155
155
|
<p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
|
|
156
156
|
<div id="M000042_source" class="dyn-source">
|
|
157
157
|
<pre>
|
|
158
|
-
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line 82</span>
|
|
159
|
+
82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">image_tag</span>( <span class="ruby-identifier">source</span>, <span class="ruby-identifier">options</span> = {} )
|
|
160
|
+
83: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-node">"/public/images/#{source}"</span>
|
|
161
|
+
84: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:alt</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>], <span class="ruby-value str">'.*'</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">capitalize</span>
|
|
162
|
+
85:
|
|
163
|
+
86: <span class="ruby-identifier">img</span>( <span class="ruby-identifier">options</span> )
|
|
164
|
+
87: <span class="ruby-keyword kw">end</span>
|
|
165
165
|
</pre>
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
|
@@ -192,21 +192,30 @@ libraries in your application, pass :defaults as the source.
|
|
|
192
192
|
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">javascript_include_tag</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">sources</span> )
|
|
193
193
|
44: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> { }
|
|
194
194
|
45: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>] = <span class="ruby-value str">"text/javascript"</span>
|
|
195
|
-
46:
|
|
196
|
-
47:
|
|
197
|
-
48:
|
|
198
|
-
49:
|
|
199
|
-
50: <span class="ruby-
|
|
200
|
-
51:
|
|
201
|
-
52:
|
|
202
|
-
53:
|
|
203
|
-
54: <span class="ruby-
|
|
204
|
-
55:
|
|
205
|
-
56: <span class="ruby-identifier">file</span>
|
|
206
|
-
57: <span class="ruby-identifier">
|
|
207
|
-
58: <span class="ruby-identifier">
|
|
208
|
-
59:
|
|
209
|
-
60:
|
|
195
|
+
46: <span class="ruby-identifier">ie_only</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">:ieOnly</span> ) <span class="ruby-operator">||</span> []
|
|
196
|
+
47:
|
|
197
|
+
48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:defaults</span>)
|
|
198
|
+
49: <span class="ruby-identifier">sources</span> = <span class="ruby-identifier">sources</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">sources</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">:defaults</span>))] <span class="ruby-operator">+</span>
|
|
199
|
+
50: <span class="ruby-ivar">@@javascript_default_sources</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">+</span>
|
|
200
|
+
51: <span class="ruby-identifier">sources</span>[(<span class="ruby-identifier">sources</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">:defaults</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-identifier">sources</span>.<span class="ruby-identifier">length</span>]
|
|
201
|
+
52:
|
|
202
|
+
53: <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:defaults</span>)
|
|
203
|
+
54: <span class="ruby-keyword kw">end</span>
|
|
204
|
+
55: <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
|
205
|
+
56: <span class="ruby-identifier">file</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">to_s</span>
|
|
206
|
+
57: <span class="ruby-identifier">file</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">".js"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">blank?</span>
|
|
207
|
+
58: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-node">"/public/javascripts/#{file}"</span>
|
|
208
|
+
59: <span class="ruby-identifier">script</span>( <span class="ruby-identifier">options</span> ) {}
|
|
209
|
+
60: <span class="ruby-keyword kw">end</span>
|
|
210
|
+
61: <span class="ruby-identifier">ie_only</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
|
211
|
+
62: <span class="ruby-identifier">file</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">to_s</span>
|
|
212
|
+
63: <span class="ruby-identifier">file</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">".js"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">blank?</span>
|
|
213
|
+
64: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-node">"/public/javascripts/#{file}"</span>
|
|
214
|
+
65: <span class="ruby-identifier">text</span> <span class="ruby-value str">"<!--[if IE]>"</span>
|
|
215
|
+
66: <span class="ruby-identifier">script</span>( <span class="ruby-identifier">options</span> ) {}
|
|
216
|
+
67: <span class="ruby-identifier">text</span> <span class="ruby-value str">"<![endif]-->"</span>
|
|
217
|
+
68: <span class="ruby-keyword kw">end</span>
|
|
218
|
+
69: <span class="ruby-keyword kw">end</span>
|
|
210
219
|
</pre>
|
|
211
220
|
</div>
|
|
212
221
|
</div>
|
|
@@ -247,13 +256,13 @@ You can mix and match the <tt>options</tt>.
|
|
|
247
256
|
<p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p>
|
|
248
257
|
<div id="M000044_source" class="dyn-source">
|
|
249
258
|
<pre>
|
|
250
|
-
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line 125</span>
|
|
260
|
+
125: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">link_to</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">address</span>, <span class="ruby-identifier">options</span> = {})
|
|
261
|
+
126: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">javascript_options</span>( <span class="ruby-identifier">options</span> )
|
|
262
|
+
127: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:href</span>] = <span class="ruby-identifier">address</span>
|
|
263
|
+
128:
|
|
264
|
+
129: <span class="ruby-identifier">a</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>; <span class="ruby-identifier">name</span>; <span class="ruby-keyword kw">end</span>
|
|
265
|
+
130: <span class="ruby-keyword kw">end</span>
|
|
257
266
|
</pre>
|
|
258
267
|
</div>
|
|
259
268
|
</div>
|
|
@@ -124,10 +124,10 @@ href="http://script.aculo.us">script.aculo.us</a> for more documentation.
|
|
|
124
124
|
<p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>
|
|
125
125
|
<div id="M000026_source" class="dyn-source">
|
|
126
126
|
<pre>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 98</span>
|
|
128
|
+
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draggable_element</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {})
|
|
129
|
+
99: <span class="ruby-identifier">javascript_tag</span>(<span class="ruby-identifier">draggable_element_js</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">";\n"</span>)
|
|
130
|
+
100: <span class="ruby-keyword kw">end</span>
|
|
131
131
|
</pre>
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
@@ -159,10 +159,10 @@ href="http://script.aculo.us">script.aculo.us</a> for more documentation.
|
|
|
159
159
|
<p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">show source</a> ]</p>
|
|
160
160
|
<div id="M000027_source" class="dyn-source">
|
|
161
161
|
<pre>
|
|
162
|
-
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 119</span>
|
|
163
|
+
119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_receiving_element</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {})
|
|
164
|
+
120: <span class="ruby-identifier">javascript_tag</span>(<span class="ruby-identifier">drop_receiving_element_js</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">";\n"</span>)
|
|
165
|
+
121: <span class="ruby-keyword kw">end</span>
|
|
166
166
|
</pre>
|
|
167
167
|
</div>
|
|
168
168
|
</div>
|
|
@@ -185,18 +185,25 @@ can pass a javascript string or a Hash, if you want to call a remote
|
|
|
185
185
|
function.
|
|
186
186
|
</p>
|
|
187
187
|
<p>
|
|
188
|
+
Important: For this to work, the elements contained in your Sortable must
|
|
189
|
+
have id attributes in the following form:
|
|
190
|
+
</p>
|
|
191
|
+
<pre>
|
|
192
|
+
id="string_identifier"
|
|
193
|
+
</pre>
|
|
194
|
+
<p>
|
|
188
195
|
Example:
|
|
189
196
|
</p>
|
|
190
197
|
<pre>
|
|
191
198
|
ul( :id => 'my_list' ) do
|
|
192
|
-
li "Google"
|
|
193
|
-
li "Yahoo"
|
|
194
|
-
li "Accoona"
|
|
195
|
-
li "Ask.com"
|
|
196
|
-
li "Baidu"
|
|
197
|
-
li "Exalead"
|
|
198
|
-
li "Voila"
|
|
199
|
-
li "Lycos"
|
|
199
|
+
li "Google", :id => "crawler_1"
|
|
200
|
+
li "Yahoo", :id => "crawler_2"
|
|
201
|
+
li "Accoona", :id => "crawler_3"
|
|
202
|
+
li "Ask.com", :id => "crawler_4"
|
|
203
|
+
li "Baidu", :id => "crawler_5"
|
|
204
|
+
li "Exalead", :id => "crawler_6"
|
|
205
|
+
li "Voila", :id => "crawler_7"
|
|
206
|
+
li "Lycos", :id => "crawler_8"
|
|
200
207
|
end
|
|
201
208
|
sortable_element( 'my_list',
|
|
202
209
|
:onChange => {
|
|
@@ -210,10 +217,10 @@ Example:
|
|
|
210
217
|
<p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
|
|
211
218
|
<div id="M000025_source" class="dyn-source">
|
|
212
219
|
<pre>
|
|
213
|
-
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
<span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 58</span>
|
|
221
|
+
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortable_element</span>( <span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {} )
|
|
222
|
+
59: <span class="ruby-identifier">javascript_tag</span>( <span class="ruby-identifier">sortable_element_js</span>( <span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">";\n"</span> )
|
|
223
|
+
60: <span class="ruby-keyword kw">end</span>
|
|
217
224
|
</pre>
|
|
218
225
|
</div>
|
|
219
226
|
</div>
|
data/doc/rdoc/created.rid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Mon, 15 Dec 2008 20:12:04 +0100
|
data/doc/rdoc/files/README.html
CHANGED
|
@@ -87,7 +87,7 @@ end</strong>
|
|
|
87
87
|
<div id="README" class="page_shade">
|
|
88
88
|
<div class="page">
|
|
89
89
|
<div class="header">
|
|
90
|
-
<div class="path">README /
|
|
90
|
+
<div class="path">README / Wed Nov 19 11:13:43 +0100 2008</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<h1>Bivouac</h1>
|
|
@@ -130,6 +130,50 @@ href="http://code.whytheluckystiff.net/camping">camping</a>.
|
|
|
130
130
|
</li>
|
|
131
131
|
</ul>
|
|
132
132
|
<h2>FEATURES/PROBLEMS:</h2>
|
|
133
|
+
<h3>0.4.0:</h3>
|
|
134
|
+
<ul>
|
|
135
|
+
<li>Work with Camping >= 1.9 ! This is the most important !
|
|
136
|
+
|
|
137
|
+
</li>
|
|
138
|
+
<li>options_for_javascript bug correction
|
|
139
|
+
|
|
140
|
+
</li>
|
|
141
|
+
<li>in environment.rb, address has been renamed host
|
|
142
|
+
|
|
143
|
+
</li>
|
|
144
|
+
<li>markaby dependency added
|
|
145
|
+
|
|
146
|
+
</li>
|
|
147
|
+
<li>Add :ieOnly option to javascript_include_tag
|
|
148
|
+
|
|
149
|
+
</li>
|
|
150
|
+
<li>postamble.rb is deprecated
|
|
151
|
+
|
|
152
|
+
</li>
|
|
153
|
+
<li>script/plugin and Bivouac::Plugin class have been modified to support a new
|
|
154
|
+
Rakefile task : plugin:update
|
|
155
|
+
|
|
156
|
+
</li>
|
|
157
|
+
<li>Update "Not Found" controller
|
|
158
|
+
|
|
159
|
+
</li>
|
|
160
|
+
<li>Replace before_filter with the better Magnus Holm solution (<a
|
|
161
|
+
href="http://github.com/judofyr/filtering_camping/tree/master">github.com/judofyr/filtering_camping/tree/master</a>)
|
|
162
|
+
|
|
163
|
+
</li>
|
|
164
|
+
<li>script/generate view is no longer deprecated.
|
|
165
|
+
|
|
166
|
+
</li>
|
|
167
|
+
<li>Add helper generator.
|
|
168
|
+
|
|
169
|
+
</li>
|
|
170
|
+
<li>not_found controller changed
|
|
171
|
+
|
|
172
|
+
</li>
|
|
173
|
+
<li>Upgrade Script.aculo.us (1.8.2)
|
|
174
|
+
|
|
175
|
+
</li>
|
|
176
|
+
</ul>
|
|
133
177
|
<h3>0.3.0:</h3>
|
|
134
178
|
<ul>
|
|
135
179
|
<li>script/plugin improvements
|
|
@@ -87,7 +87,7 @@ end</strong>
|
|
|
87
87
|
<div id="lib/bivouac/helpers/view/goh/html.rb" class="page_shade">
|
|
88
88
|
<div class="page">
|
|
89
89
|
<div class="header">
|
|
90
|
-
<div class="path">lib/bivouac/helpers/view/goh/html.rb /
|
|
90
|
+
<div class="path">lib/bivouac/helpers/view/goh/html.rb / Thu Jul 31 11:29:42 +0200 2008</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<p>
|
|
@@ -87,7 +87,7 @@ end</strong>
|
|
|
87
87
|
<div id="lib/bivouac/helpers/view/goh/javascript.rb" class="page_shade">
|
|
88
88
|
<div class="page">
|
|
89
89
|
<div class="header">
|
|
90
|
-
<div class="path">lib/bivouac/helpers/view/goh/javascript.rb /
|
|
90
|
+
<div class="path">lib/bivouac/helpers/view/goh/javascript.rb / Wed Jul 30 17:01:11 +0200 2008</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<p>
|
|
@@ -87,7 +87,7 @@ end</strong>
|
|
|
87
87
|
<div id="lib/bivouac/helpers/view/goh/scriptaculous.rb" class="page_shade">
|
|
88
88
|
<div class="page">
|
|
89
89
|
<div class="header">
|
|
90
|
-
<div class="path">lib/bivouac/helpers/view/goh/scriptaculous.rb / Wed
|
|
90
|
+
<div class="path">lib/bivouac/helpers/view/goh/scriptaculous.rb / Wed Jul 30 17:41:52 +0200 2008</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
93
|
<p>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Project Blog
|
|
3
|
+
#
|
|
4
|
+
# Created using bivouac on Thu Nov 13 11:58:26 +0100 2008.
|
|
5
|
+
# Copyright (c) 2008 __My__. All rights reserved.
|
|
6
|
+
#
|
|
7
|
+
# DO NOT EDIT THIS FILE OR YOU REALLY KNOW WHAT YOU ARE DOING
|
|
8
|
+
# Add your tasks in lib/tasks
|
|
9
|
+
#
|
|
10
|
+
require 'rubygems'
|
|
11
|
+
require 'rake/rdoctask'
|
|
12
|
+
require 'camping'
|
|
13
|
+
require 'camping/session'
|
|
14
|
+
require 'bivouac'
|
|
15
|
+
require 'bivouac/template'
|
|
16
|
+
|
|
17
|
+
BIVOUAC_ROOT = File.expand_path( File.dirname(__FILE__) )
|
|
18
|
+
ENV['BIVOUAC_ROOT'] = BIVOUAC_ROOT
|
|
19
|
+
|
|
20
|
+
require 'bivouac/tasks/bivouac'
|
|
21
|
+
|
|
22
|
+
task :environment do
|
|
23
|
+
Camping.goes :Blog
|
|
24
|
+
|
|
25
|
+
# Load models from app/models
|
|
26
|
+
files( 'models' ) { |file| require( file ) }
|
|
27
|
+
|
|
28
|
+
# Load create and database schema
|
|
29
|
+
files( '../db' ) { |file| require( file ) }
|
|
30
|
+
|
|
31
|
+
database_connection = @conf.db
|
|
32
|
+
if database_connection[:adapter] =~ /sqlite/
|
|
33
|
+
database_connection[:database] = BIVOUAC_ROOT + "/" + database_connection[:database]
|
|
34
|
+
end
|
|
35
|
+
Blog::Models::Base.establish_connection database_connection
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
namespace :db do
|
|
39
|
+
desc "Migrate the database through scripts in db/migrate."
|
|
40
|
+
task :migrate => :environment do
|
|
41
|
+
if Blog.respond_to? :create
|
|
42
|
+
Blog.create
|
|
43
|
+
else
|
|
44
|
+
puts "* Nothing to do!"
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
desc "Clear the sessions table"
|
|
49
|
+
namespace :sessions do
|
|
50
|
+
task :clear => :environment do
|
|
51
|
+
session_table = 'session'
|
|
52
|
+
session_table = Inflector.pluralize(session_table) if ActiveRecord::Base.pluralize_table_names
|
|
53
|
+
ActiveRecord::Base.connection.execute "DELETE FROM #{session_table}"
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Project Blog
|
|
5
|
+
#
|
|
6
|
+
# Created using bivouac on Thu Nov 13 11:58:26 +0100 2008.
|
|
7
|
+
# Copyright (c) 2008 __My__. All rights reserved.
|
|
8
|
+
#
|
|
9
|
+
# DO NOT EDIT THIS FILE OR YOU REALLY KNOW WHAT YOU ARE DOING
|
|
10
|
+
# USE script/generate helper my_helper
|
|
11
|
+
#
|
|
12
|
+
require 'rubygems'
|
|
13
|
+
|
|
14
|
+
require 'camping'
|
|
15
|
+
require 'camping/ar'
|
|
16
|
+
require 'markaby'
|
|
17
|
+
|
|
18
|
+
require 'mime/types'
|
|
19
|
+
|
|
20
|
+
require 'bivouac'
|
|
21
|
+
require 'bivouac/ext/filtering_camping'
|
|
22
|
+
# require 'bivouac/filter'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
require 'camping/session'
|
|
26
|
+
module Blog
|
|
27
|
+
# include Bivouac::Filters
|
|
28
|
+
include CampingFilters
|
|
29
|
+
include Camping::Session
|
|
30
|
+
@@state_secret = "You want a really really long string of rubbish nobody could ever ever guess! Don't tell anyone! Not even your girlfriend or dog!"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
include Bivouac
|
|
35
|
+
|
|
36
|
+
# Load libs
|
|
37
|
+
LIB = filePath( __FILE__, '..', 'lib' )
|
|
38
|
+
$:.unshift( LIB )
|
|
39
|
+
|
|
40
|
+
# Load plugins
|
|
41
|
+
Dir.glob( filePath( __FILE__, '../plugins/**/init.rb' ) ).each { |p| require p }
|
|
42
|
+
|
|
43
|
+
# Indent the code -- See http://code.whytheluckystiff.net/markaby/wiki/TipsAndTrickery
|
|
44
|
+
Markaby::Builder.set(:indent, 2)
|
|
45
|
+
|
|
46
|
+
Camping.goes :Blog
|
|
47
|
+
|
|
48
|
+
# Load helpers from app/helpers
|
|
49
|
+
files( 'helpers' ) { |file| require( file ) }
|
|
50
|
+
|
|
51
|
+
# Load models from app/models
|
|
52
|
+
files( 'models' ) { |file| require( file ) }
|
|
53
|
+
|
|
54
|
+
# Load create and database schema from db/migrate
|
|
55
|
+
files( '../db' ) { |file| require( file ) }
|
|
56
|
+
|
|
57
|
+
# Load views from app/views
|
|
58
|
+
files( 'views' ) { |file| require( file ) }
|
|
59
|
+
|
|
60
|
+
# Load controllers from app/controllers
|
|
61
|
+
files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
|
|
62
|
+
|
|
63
|
+
module Blog::Controllers
|
|
64
|
+
class Public < R '/public/(.+)'
|
|
65
|
+
PATH = filePath( __FILE__ )
|
|
66
|
+
|
|
67
|
+
def get file
|
|
68
|
+
if file.include? '..'
|
|
69
|
+
@status = '403'
|
|
70
|
+
return '403 - Invalid path'
|
|
71
|
+
else
|
|
72
|
+
type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
|
|
73
|
+
@headers['Content-Type'] = type
|
|
74
|
+
begin
|
|
75
|
+
@body = open( File.join( PATH, '..', 'public', file ) ).read
|
|
76
|
+
rescue Errno::ENOENT => e
|
|
77
|
+
@path = File.join '/public', file
|
|
78
|
+
@status = '404'
|
|
79
|
+
@headers['Content-Type'] = "text/html"
|
|
80
|
+
render :not_found
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Multiple Layout support. Add
|
|
88
|
+
# layout :my_layout
|
|
89
|
+
# in your controller else, default_layout will be used
|
|
90
|
+
# If you don't want to use layout add
|
|
91
|
+
# layout :none
|
|
92
|
+
# in your controller
|
|
93
|
+
module Blog::Helpers
|
|
94
|
+
def layout( l )
|
|
95
|
+
@layout = l
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
module Blog::Views
|
|
99
|
+
def layout
|
|
100
|
+
@layout ||= :default
|
|
101
|
+
unless @layout == :none
|
|
102
|
+
send("#{@layout.to_s}_layout") { yield }
|
|
103
|
+
else
|
|
104
|
+
yield
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|