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.
Files changed (135) hide show
  1. data/README +15 -0
  2. data/bin/bivouac +5 -10
  3. data/doc/rdoc/classes/BivouacHelpers/HtmlView.html +46 -37
  4. data/doc/rdoc/classes/BivouacHelpers/ScriptAculoUsView.html +27 -20
  5. data/doc/rdoc/created.rid +1 -1
  6. data/doc/rdoc/files/README.html +45 -1
  7. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/html_rb.html +1 -1
  8. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +1 -1
  9. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html +1 -1
  10. data/examples/bivouac_sample/Rakefile +0 -0
  11. data/examples/bivouac_sample/app/controllers/toggle_sortable.rb +2 -1
  12. data/examples/bivouac_sample/app/views/_sortable_result.rb +1 -1
  13. data/examples/bivouac_sample/script/console +0 -0
  14. data/examples/bivouac_sample/script/generate +0 -0
  15. data/examples/bivouac_sample/script/plugin +0 -0
  16. data/examples/bivouac_sample/script/server +0 -0
  17. data/examples/blog/Rakefile +56 -0
  18. data/examples/blog/app/blog.rb +107 -0
  19. data/examples/blog/app/controllers/comment.rb +17 -0
  20. data/examples/blog/app/controllers/index.rb +15 -0
  21. data/examples/blog/app/controllers/login.rb +33 -0
  22. data/examples/blog/app/controllers/logout.rb +15 -0
  23. data/examples/blog/app/controllers/not_found.rb +14 -0
  24. data/examples/blog/app/controllers/post.rb +48 -0
  25. data/examples/blog/app/helpers/_helpers.rb +30 -0
  26. data/examples/blog/app/helpers/blog.rb +14 -0
  27. data/examples/blog/app/models/comment.rb +18 -0
  28. data/examples/blog/app/models/post.rb +19 -0
  29. data/examples/blog/app/models/user.rb +12 -0
  30. data/examples/blog/app/views/_partials.rb +81 -0
  31. data/examples/blog/app/views/index/index.rb +23 -0
  32. data/examples/blog/app/views/layouts/default_layout.rb +40 -0
  33. data/examples/blog/app/views/login/login.rb +27 -0
  34. data/examples/blog/app/views/not_found.rb +13 -0
  35. data/examples/blog/app/views/post/add.rb +12 -0
  36. data/examples/blog/app/views/post/edit.rb +12 -0
  37. data/examples/blog/app/views/post/view.rb +14 -0
  38. data/examples/blog/config/console.rc +12 -0
  39. data/examples/blog/config/database.yml +3 -0
  40. data/examples/blog/config/environment.rb +58 -0
  41. data/examples/blog/db/blog.db +0 -0
  42. data/examples/blog/db/create.rb +11 -0
  43. data/examples/blog/db/migrate/001_users.rb +22 -0
  44. data/examples/blog/db/migrate/002_posts.rb +24 -0
  45. data/examples/blog/db/migrate/003_comments.rb +24 -0
  46. data/examples/blog/log/Blog.log +382 -0
  47. data/examples/{blog_goh → blog}/public/images/camping.png +0 -0
  48. data/examples/{blog_goh → blog}/public/index.html +3 -2
  49. data/examples/blog/public/javascripts/builder.js +136 -0
  50. data/examples/blog/public/javascripts/controls.js +965 -0
  51. data/examples/blog/public/javascripts/dragdrop.js +974 -0
  52. data/examples/blog/public/javascripts/effects.js +1122 -0
  53. data/examples/blog/public/javascripts/prototype.js +4320 -0
  54. data/examples/blog/public/javascripts/scriptaculous.js +58 -0
  55. data/examples/blog/public/javascripts/slider.js +275 -0
  56. data/examples/blog/public/javascripts/sound.js +55 -0
  57. data/examples/blog/public/javascripts/unittest.js +568 -0
  58. data/examples/blog/public/stylesheets/autocomplete.css +22 -0
  59. data/examples/blog/public/stylesheets/blog.css +107 -0
  60. data/examples/blog/script/console +12 -0
  61. data/examples/blog/script/generate +17 -0
  62. data/examples/blog/script/plugin +16 -0
  63. data/examples/blog/script/server +135 -0
  64. data/examples/blog/test/test_comment.rb +22 -0
  65. data/examples/blog/test/test_index.rb +22 -0
  66. data/examples/blog/test/test_login.rb +22 -0
  67. data/examples/blog/test/test_logout.rb +18 -0
  68. data/examples/blog/test/test_post.rb +30 -0
  69. data/examples/blog/test/test_post_new.rb +22 -0
  70. data/lib/bivouac.rb +2 -2
  71. data/lib/bivouac/commands/generate.rb +48 -8
  72. data/lib/bivouac/commands/plugin.rb +30 -15
  73. data/lib/bivouac/ext/filtering_camping.rb +46 -0
  74. data/lib/bivouac/helpers/view/goh/html.rb +9 -0
  75. data/lib/bivouac/helpers/view/goh/scriptaculous.rb +12 -8
  76. data/lib/bivouac/tasks/bivouac.rb +1 -0
  77. data/lib/bivouac/tasks/framework.rake +8 -8
  78. data/lib/bivouac/tasks/plugins.rake +17 -1
  79. data/lib/bivouac/template.rb +0 -0
  80. data/lib/bivouac/template/{application_goh.rb → application.rb} +36 -12
  81. data/lib/bivouac/template/application/{helpers_goh.rb → helpers.rb} +1 -1
  82. data/lib/bivouac/template/console.rb +2 -4
  83. data/lib/bivouac/template/environment.rb +1 -1
  84. data/lib/bivouac/template/generate.rb +0 -0
  85. data/lib/bivouac/template/generate/create.rb +0 -0
  86. data/lib/bivouac/template/generate/helper.rb +12 -0
  87. data/lib/bivouac/template/generate/migrate.rb +0 -0
  88. data/lib/bivouac/template/generate/migrate_end.rb +1 -0
  89. data/lib/bivouac/template/plugin.rb +6 -1
  90. data/lib/bivouac/template/server.rb +124 -3
  91. data/lib/bivouac/template/static/builder.js +19 -19
  92. data/lib/bivouac/template/static/controls.js +74 -74
  93. data/lib/bivouac/template/static/dragdrop.js +167 -166
  94. data/lib/bivouac/template/static/effects.js +171 -163
  95. data/lib/bivouac/template/static/not_found_controller.rb +8 -4
  96. data/lib/bivouac/template/static/prototype.js +218 -119
  97. data/lib/bivouac/template/static/scriptaculous.js +22 -20
  98. data/lib/bivouac/template/static/slider.js +39 -39
  99. data/lib/bivouac/template/static/sound.js +11 -11
  100. data/lib/bivouac/template/static/unittest.js +16 -16
  101. metadata +96 -60
  102. data/examples/blog_goh/app/blog.rb +0 -72
  103. data/examples/blog_goh/app/controllers/add.rb +0 -19
  104. data/examples/blog_goh/app/controllers/comment.rb +0 -9
  105. data/examples/blog_goh/app/controllers/edit.rb +0 -18
  106. data/examples/blog_goh/app/controllers/index.rb +0 -8
  107. data/examples/blog_goh/app/controllers/info.rb +0 -11
  108. data/examples/blog_goh/app/controllers/login.rb +0 -15
  109. data/examples/blog_goh/app/controllers/logout.rb +0 -8
  110. data/examples/blog_goh/app/controllers/view.rb +0 -9
  111. data/examples/blog_goh/app/models/comment.rb +0 -5
  112. data/examples/blog_goh/app/models/post.rb +0 -5
  113. data/examples/blog_goh/app/models/user.rb +0 -4
  114. data/examples/blog_goh/app/views/_form.rb +0 -16
  115. data/examples/blog_goh/app/views/_login.rb +0 -13
  116. data/examples/blog_goh/app/views/_post.rb +0 -9
  117. data/examples/blog_goh/app/views/add.rb +0 -9
  118. data/examples/blog_goh/app/views/edit.rb +0 -9
  119. data/examples/blog_goh/app/views/index.rb +0 -12
  120. data/examples/blog_goh/app/views/layout.rb +0 -18
  121. data/examples/blog_goh/app/views/login.rb +0 -6
  122. data/examples/blog_goh/app/views/logout.rb +0 -6
  123. data/examples/blog_goh/app/views/view.rb +0 -20
  124. data/examples/blog_goh/config/environment.rb +0 -27
  125. data/examples/blog_goh/db/Blog.db +0 -0
  126. data/examples/blog_goh/db/create.rb +0 -8
  127. data/examples/blog_goh/db/migrate/comment.rb +0 -15
  128. data/examples/blog_goh/db/migrate/post.rb +0 -15
  129. data/examples/blog_goh/db/migrate/user.rb +0 -15
  130. data/examples/blog_goh/log/Blog.log +0 -75
  131. data/examples/blog_goh/public/stylesheets/style.css +0 -10
  132. data/examples/blog_goh/script/generate +0 -3
  133. data/examples/blog_goh/script/server +0 -5
  134. data/lib/bivouac/template/application/postamble.rb +0 -195
  135. 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
@@ -26,7 +26,7 @@ database_configuration = {
26
26
  :db => { :adapter => 'sqlite3', :database => 'db/bivouac.db' },
27
27
  :orgtype => "GOH",
28
28
  :port => 3301,
29
- :address => "0.0.0.0",
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("-a", "--address ADDR", "Address to bind to (0.0.0.0)") { |address|
73
- @conf.address = address
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( "application_#{@conf.orgtype.downcase}" )
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/helpers_#{@conf.orgtype.downcase}" )
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
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/html.rb, line 89</span>
126
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">image_path</span>( <span class="ruby-identifier">source</span> )
127
- 90: <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
- 91: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">source</span>
129
- 92: <span class="ruby-keyword kw">else</span>
130
- 93: <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;/public/images/#{source}&quot;</span>
131
- 94: <span class="ruby-keyword kw">end</span>
132
- 95: <span class="ruby-keyword kw">end</span>
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">&quot;/public/images/#{source}&quot;</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 73</span>
159
- 73: <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
- 74: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-node">&quot;/public/images/#{source}&quot;</span>
161
- 75: <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
- 76:
163
- 77: <span class="ruby-identifier">img</span>( <span class="ruby-identifier">options</span> )
164
- 78: <span class="ruby-keyword kw">end</span>
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">&quot;/public/images/#{source}&quot;</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">&quot;text/javascript&quot;</span>
195
- 46:
196
- 47: <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>)
197
- 48: <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>
198
- 49: <span class="ruby-ivar">@@javascript_default_sources</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">+</span>
199
- 50: <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>]
200
- 51:
201
- 52: <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:defaults</span>)
202
- 53: <span class="ruby-keyword kw">end</span>
203
- 54: <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>
204
- 55: <span class="ruby-identifier">file</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">to_s</span>
205
- 56: <span class="ruby-identifier">file</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;.js&quot;</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>
206
- 57: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:src</span>] = <span class="ruby-node">&quot;/public/javascripts/#{file}&quot;</span>
207
- 58: <span class="ruby-identifier">script</span>( <span class="ruby-identifier">options</span> ) {}
208
- 59: <span class="ruby-keyword kw">end</span>
209
- 60: <span class="ruby-keyword kw">end</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot;.js&quot;</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">&quot;/public/javascripts/#{file}&quot;</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">&lt;&lt;</span> <span class="ruby-value str">&quot;.js&quot;</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">&quot;/public/javascripts/#{file}&quot;</span>
214
+ 65: <span class="ruby-identifier">text</span> <span class="ruby-value str">&quot;&lt;!--[if IE]&gt;&quot;</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">&quot;&lt;![endif]--&gt;&quot;</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 116</span>
251
- 116: <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> = {})
252
- 117: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">javascript_options</span>( <span class="ruby-identifier">options</span> )
253
- 118: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:href</span>] = <span class="ruby-identifier">address</span>
254
- 119:
255
- 120: <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>
256
- 121: <span class="ruby-keyword kw">end</span>
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
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 94</span>
128
- 94: <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
- 95: <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">&quot;;\n&quot;</span>)
130
- 96: <span class="ruby-keyword kw">end</span>
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">&quot;;\n&quot;</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 115</span>
163
- 115: <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
- 116: <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">&quot;;\n&quot;</span>)
165
- 117: <span class="ruby-keyword kw">end</span>
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">&quot;;\n&quot;</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=&quot;string_identifier&quot;
193
+ </pre>
194
+ <p>
188
195
  Example:
189
196
  </p>
190
197
  <pre>
191
198
  ul( :id =&gt; 'my_list' ) do
192
- li &quot;Google&quot;
193
- li &quot;Yahoo&quot;
194
- li &quot;Accoona&quot;
195
- li &quot;Ask.com&quot;
196
- li &quot;Baidu&quot;
197
- li &quot;Exalead&quot;
198
- li &quot;Voila&quot;
199
- li &quot;Lycos&quot;
199
+ li &quot;Google&quot;, :id =&gt; &quot;crawler_1&quot;
200
+ li &quot;Yahoo&quot;, :id =&gt; &quot;crawler_2&quot;
201
+ li &quot;Accoona&quot;, :id =&gt; &quot;crawler_3&quot;
202
+ li &quot;Ask.com&quot;, :id =&gt; &quot;crawler_4&quot;
203
+ li &quot;Baidu&quot;, :id =&gt; &quot;crawler_5&quot;
204
+ li &quot;Exalead&quot;, :id =&gt; &quot;crawler_6&quot;
205
+ li &quot;Voila&quot;, :id =&gt; &quot;crawler_7&quot;
206
+ li &quot;Lycos&quot;, :id =&gt; &quot;crawler_8&quot;
200
207
  end
201
208
  sortable_element( 'my_list',
202
209
  :onChange =&gt; {
@@ -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 54</span>
214
- 54: <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> = {} )
215
- 55: <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">&quot;;\n&quot;</span> )
216
- 56: <span class="ruby-keyword kw">end</span>
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">&quot;;\n&quot;</span> )
223
+ 60: <span class="ruby-keyword kw">end</span>
217
224
  </pre>
218
225
  </div>
219
226
  </div>
@@ -1 +1 @@
1
- Thu, 17 Jul 2008 14:49:01 +0200
1
+ Mon, 15 Dec 2008 20:12:04 +0100
@@ -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 / Fri Jul 04 15:13:15 +0200 2008</div>
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 &gt;= 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 &quot;Not Found&quot; 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 / Mon Mar 24 04:00:21 +0100 2008</div>
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 / Fri Apr 18 17:33:31 +0200 2008</div>
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 Sep 12 12:20:38 +0200 2007</div>
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
@@ -4,7 +4,8 @@ module BivouacSample::Controllers
4
4
  render :toggle_sortable
5
5
  end
6
6
  def post
7
- @data = input.my_list.join( ', ' )
7
+ @__data__ = input.my_list.join( ', ' )
8
+ puts @__data__
8
9
  render :_sortable_result
9
10
  end
10
11
  end
@@ -1,5 +1,5 @@
1
1
  module BivouacSample::Views
2
2
  def _sortable_result
3
- span "#{Time.now} ordre de la liste: #{@data}"
3
+ span "#{Time.now} ordre de la liste: #{@__data__}"
4
4
  end
5
5
  end
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