bivouac 0.1.3 → 0.1.4

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 (70) hide show
  1. data/README +18 -1
  2. data/bin/bivouac +10 -6
  3. data/lib/bivouac/commands/generate.rb +2 -0
  4. data/lib/bivouac/commands/plugin.rb +47 -0
  5. data/lib/bivouac/helpers/view/goh/html.rb +17 -0
  6. data/lib/bivouac/template/application/postamble.rb +26 -4
  7. data/lib/bivouac/template/application_goh.rb +2 -1
  8. data/{examples/blog_erb/script/generate → lib/bivouac/template/plugin.rb} +1 -1
  9. data/lib/bivouac/template/static/index.html +3 -2
  10. metadata +95 -172
  11. data/doc/rdoc/classes/BivouacHelpers/BaseView.html +0 -178
  12. data/doc/rdoc/classes/BivouacHelpers/FormView.html +0 -398
  13. data/doc/rdoc/classes/BivouacHelpers/HtmlView.html +0 -274
  14. data/doc/rdoc/classes/BivouacHelpers/JavaScriptView.html +0 -573
  15. data/doc/rdoc/classes/BivouacHelpers/ScriptAculoUsView.html +0 -258
  16. data/doc/rdoc/classes/BivouacHelpers/TooltipView.html +0 -158
  17. data/doc/rdoc/classes/BivouacHelpers.html +0 -117
  18. data/doc/rdoc/classes/JavaScriptGenerator.html +0 -564
  19. data/doc/rdoc/created.rid +0 -1
  20. data/doc/rdoc/files/AUTHORS.html +0 -109
  21. data/doc/rdoc/files/COPYING.html +0 -533
  22. data/doc/rdoc/files/README.html +0 -379
  23. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/base_rb.html +0 -109
  24. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/form_rb.html +0 -109
  25. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/html_rb.html +0 -109
  26. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +0 -113
  27. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html +0 -113
  28. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/tooltip_rb.html +0 -109
  29. data/doc/rdoc/index.html +0 -10
  30. data/doc/rdoc/permalink.gif +0 -0
  31. data/doc/rdoc/rdoc-style.css +0 -106
  32. data/doc/rdoc/rubyfr.png +0 -0
  33. data/examples/blog_erb/app/blog.rb +0 -84
  34. data/examples/blog_erb/app/controllers/add.rb +0 -19
  35. data/examples/blog_erb/app/controllers/comment.rb +0 -9
  36. data/examples/blog_erb/app/controllers/edit.rb +0 -18
  37. data/examples/blog_erb/app/controllers/index.rb +0 -8
  38. data/examples/blog_erb/app/controllers/info.rb +0 -11
  39. data/examples/blog_erb/app/controllers/login.rb +0 -15
  40. data/examples/blog_erb/app/controllers/logout.rb +0 -8
  41. data/examples/blog_erb/app/controllers/view.rb +0 -9
  42. data/examples/blog_erb/app/models/comment.rb +0 -5
  43. data/examples/blog_erb/app/models/post.rb +0 -5
  44. data/examples/blog_erb/app/models/user.rb +0 -4
  45. data/examples/blog_erb/app/views/add.html +0 -18
  46. data/examples/blog_erb/app/views/edit.html +0 -18
  47. data/examples/blog_erb/app/views/index.html +0 -12
  48. data/examples/blog_erb/app/views/layout.html +0 -12
  49. data/examples/blog_erb/app/views/login.html +0 -2
  50. data/examples/blog_erb/app/views/logout.html +0 -2
  51. data/examples/blog_erb/app/views/view.html +0 -20
  52. data/examples/blog_erb/config/environment.rb +0 -27
  53. data/examples/blog_erb/db/Blog.db +0 -0
  54. data/examples/blog_erb/db/create.rb +0 -8
  55. data/examples/blog_erb/db/migrate/comment.rb +0 -15
  56. data/examples/blog_erb/db/migrate/post.rb +0 -15
  57. data/examples/blog_erb/db/migrate/user.rb +0 -15
  58. data/examples/blog_erb/log/Blog.log +0 -57
  59. data/examples/blog_erb/public/images/camping.png +0 -0
  60. data/examples/blog_erb/public/index.html +0 -242
  61. data/examples/blog_erb/public/stylesheets/style.css +0 -10
  62. data/examples/blog_erb/script/server +0 -5
  63. data/lib/bivouac/commands/server.rb +0 -9
  64. data/lib/bivouac/template/application/helpers_erb.rb +0 -11
  65. data/lib/bivouac/template/application_erb.rb +0 -77
  66. data/lib/bivouac/template/application_jof.rb +0 -42
  67. data/lib/bivouac/template/generate/scaffold_view_create_erb.rb +0 -7
  68. data/lib/bivouac/template/generate/scaffold_view_list_erb.rb +0 -7
  69. data/lib/bivouac/template/generate/scaffold_view_view_erb.rb +0 -10
  70. data/lib/bivouac/template/generate/view_erb.rb +0 -2
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #
4
- # Project <%= @appname %>
5
- #
6
- # Created using bivouac on <%= Time.now %>.
7
- # Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
8
- #
9
-
10
- require 'rubygems'
11
- require 'camping'
12
- require 'camping/session'
13
- require 'mime/types'
14
- require 'bivouac'
15
-
16
- include Bivouac
17
-
18
- # Load libs
19
- LIB = filePath( __FILE__, '..', 'lib' )
20
- $:.unshift( LIB )
21
-
22
- # Load plugins
23
- Dir.glob( filePath( __FILE__, '../plugins/**/init.rb' ) ).each { |p| require p }
24
-
25
- begin
26
- require 'erubis'
27
- ERB = Erubis::Eruby
28
- rescue MissingSourceFile
29
- require 'erb'
30
- end
31
-
32
- Camping.goes :<%= @appname %>
33
-
34
- module <%= @appname %>
35
- def render(m, layout=false)
36
- content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/#{m}.html")).result(binding)
37
- content = ERB.new(IO.read("#{File.dirname(__FILE__)}/views/layout.html")).result(binding) if layout
38
- return content
39
- end
40
- end
41
-
42
- # Load helpers from app/helpers
43
- files( 'helpers' ) { |file| require( file ) }
44
-
45
- # Load models from app/models
46
- files( 'models' ) { |file| require( file ) }
47
-
48
- # Load database schema from db/migrate
49
- files( '../db/migrate' ) { |file| require( file ) }
50
-
51
- # Load controllers from app/controllers
52
- files( 'controllers', :except => [File.basename(__FILE__)] ) { |file| require( file ) }
53
-
54
- module <%= @appname %>::Controllers
55
- class Public < R '/public/(.+)'
56
- PATH = filePath( __FILE__ )
57
-
58
- def get file
59
- if file.include? '..'
60
- @status = '403'
61
- return '403 - Invalid path'
62
- else
63
- type = (MIME::Types.type_for(file)[0] || '/text/plain').to_s
64
- @headers['Content-Type'] = type
65
- @headers['X-Sendfile'] = File.join PATH, '..', 'public', file
66
- end
67
- end
68
- end
69
- end
70
-
71
- # Load create
72
- files( '../db' ) { |file| require( file ) }
73
-
74
- # Load postamble and configuration
75
- if __FILE__ == $0
76
- files( '../config' ) { |file| require( file ) }
77
- end
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #
4
- # Project <%= @appname %>
5
- #
6
- # Created using bivouac on <%= Time.now %>.
7
- # Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
8
- #
9
-
10
- require 'rubygems'
11
- require 'camping'
12
- require 'camping/session'
13
-
14
- Camping.goes :<%= @appname %>
15
-
16
- # module <%= @appname %>
17
- # include Camping::Session
18
- # end
19
-
20
- module <%= @appname %>::Helpers
21
- # Add your helpers here !
22
- end
23
-
24
- module <%= @appname %>::Models
25
- # Add youy models here !
26
- end
27
-
28
- module <%= @appname %>::Controllers
29
- class Index < R '/'
30
- def get; render :index end
31
- end
32
- end
33
-
34
- module <%= @appname %>::Views
35
- def layout
36
- html { body { self << yield } }
37
- end
38
- def index
39
- div.page "Welcome to the bivouac!"
40
- end
41
- end
42
-
@@ -1,7 +0,0 @@
1
- <p>Add a new <%= @generation_class_name %></p>
2
- <div id="<%= @generation_view_name %>_form">
3
- <form method="POST" action="/<%= @generation_view_name %>/add">
4
- ...<br />
5
- <input type="submit" />
6
- </form>
7
- </div>
@@ -1,7 +0,0 @@
1
- <a href="/<%= @generation_view_name %>/add">add a <%= @generation_class_name %></a>
2
- <div id="<%= @generation_view_name.pluralize %>">
3
- <%% @<%= @generation_view_name.pluralize %>.each do |<%= @generation_view_name%>| %>
4
- ...
5
- <a href="/<%= @generation_view_name %>/<%%= <%= @generation_view_name %>.id %>">view</a>
6
- <%% end %>
7
- </div>
@@ -1,10 +0,0 @@
1
- <div id="<%= @generation_view_name %>">
2
- ...<br />
3
- <a href="/<%= @generation_view_name %>">List</a>
4
- </div>
5
- <div id="<%= @generation_view_name %>_form">
6
- <form method="POST" action="/<%= @generation_view_name %>/<%%= @<%= @generation_view_name %>.id %>">
7
- ...<br />
8
- <input type="submit" />
9
- </form>
10
- </div>
@@ -1,2 +0,0 @@
1
- <h1 id="header"><%= @generation_app_name %>::Views#<%= @generation_view_name %></h1>
2
- <p>Find me in <%= @destination_file %></p>