squeezer 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. data/VERSION +1 -1
  2. data/{lib/app → app}/controllers/application_controller.rb +0 -0
  3. data/{lib/app → app}/controllers/blogs_controller.rb +0 -0
  4. data/{lib/app → app}/controllers/comments_controller.rb +0 -0
  5. data/{lib/app → app}/controllers/pages_controller.rb +0 -0
  6. data/{lib/app → app}/controllers/posts_controller.rb +0 -0
  7. data/{lib/app → app}/controllers/roles_controller.rb +0 -0
  8. data/{lib/app → app}/controllers/sites_controller.rb +0 -0
  9. data/{lib/app → app}/controllers/users_controller.rb +0 -0
  10. data/{lib/app → app}/helpers/squeezer_helper.rb +0 -0
  11. data/{lib/app → app}/models/ability.rb +0 -0
  12. data/{lib/app → app}/models/blog.rb +0 -0
  13. data/{lib/app → app}/models/comment.rb +0 -0
  14. data/{lib/app → app}/models/page.rb +0 -0
  15. data/{lib/app → app}/models/post.rb +0 -0
  16. data/{lib/app → app}/models/role.rb +0 -0
  17. data/{lib/app → app}/models/site.rb +0 -0
  18. data/{lib/app → app}/models/user.rb +0 -0
  19. data/{lib/app → app}/views/blogs/_entry.haml +0 -0
  20. data/{lib/app → app}/views/blogs/_form.html.haml +0 -0
  21. data/{lib/app → app}/views/blogs/edit.html.haml +0 -0
  22. data/{lib/app → app}/views/blogs/index.html.haml +0 -0
  23. data/{lib/app → app}/views/blogs/new.html.haml +0 -0
  24. data/{lib/app → app}/views/blogs/show.html.haml +0 -0
  25. data/{lib/app → app}/views/comments/_form.html.haml +0 -0
  26. data/{lib/app → app}/views/comments/_index.html.haml +0 -0
  27. data/{lib/app → app}/views/comments/_post.html.haml +0 -0
  28. data/{lib/app → app}/views/comments/show.js.erb +0 -0
  29. data/{lib/app → app}/views/layouts/_footer.html.haml +0 -0
  30. data/{lib/app → app}/views/layouts/_login.haml +0 -0
  31. data/{lib/app → app}/views/layouts/_menu.html.haml +0 -0
  32. data/{lib/app → app}/views/layouts/_msn.haml +0 -0
  33. data/{lib/app → app}/views/layouts/_sidebar.html.haml +0 -0
  34. data/{lib/app → app}/views/layouts/application.html.erb +0 -0
  35. data/{lib/app → app}/views/layouts/ice/squeezer/_ice.haml +0 -0
  36. data/{lib/app → app}/views/layouts/ice/squeezer/ice/_ice.haml +0 -0
  37. data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/_ice.haml +0 -0
  38. data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/ice/_ice.haml +0 -0
  39. data/{lib/app → app}/views/layouts/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +0 -0
  40. data/{lib/app → app}/views/layouts/squeezer/ice/_ice.haml +0 -0
  41. data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/_ice.haml +0 -0
  42. data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/ice/_ice.haml +0 -0
  43. data/{lib/app → app}/views/layouts/squeezer/ice/squeezer/ice/squeezer/_ice.haml +0 -0
  44. data/{lib/app → app}/views/layouts/squeezer/squeezer.css +0 -0
  45. data/{lib/app → app}/views/pages/_form.html.haml +0 -0
  46. data/{lib/app → app}/views/pages/edit.html.haml +0 -0
  47. data/{lib/app → app}/views/pages/index.html.haml +0 -0
  48. data/{lib/app → app}/views/pages/new.html.haml +0 -0
  49. data/{lib/app → app}/views/pages/show.html.haml +0 -0
  50. data/{lib/app → app}/views/roles/_form.html.haml +0 -0
  51. data/{lib/app → app}/views/roles/edit.html.haml +0 -0
  52. data/{lib/app → app}/views/roles/index.html.haml +0 -0
  53. data/{lib/app → app}/views/roles/new.html.haml +0 -0
  54. data/{lib/app → app}/views/roles/show.html.haml +0 -0
  55. data/{lib/app → app}/views/sites/_form.html.haml +0 -0
  56. data/{lib/app → app}/views/sites/edit.html.haml +0 -0
  57. data/{lib/app → app}/views/sites/index.html.haml +0 -0
  58. data/{lib/app → app}/views/sites/new.html.haml +0 -0
  59. data/{lib/app → app}/views/sites/show.html.haml +0 -0
  60. data/{lib/app → app}/views/users/index.haml +0 -0
  61. data/{lib/app → app}/views/users/roles.haml +0 -0
  62. data/{lib/app → app}/views/users/show.haml +0 -0
  63. data/lib/generators/squeezer/Gemfile +37 -0
  64. data/lib/generators/squeezer/README +2 -0
  65. data/lib/generators/squeezer/USAGE +7 -0
  66. data/lib/generators/squeezer/squeezer_generator.rb +114 -0
  67. data/lib/generators/squeezer/templates/Gemfile +37 -0
  68. data/lib/generators/squeezer/templates/app/controllers/application_controller.rb +25 -0
  69. data/lib/{blogs_controller.rb → generators/squeezer/templates/app/controllers/blogs_controller.rb} +0 -0
  70. data/lib/generators/squeezer/templates/app/controllers/comments_controller.rb +37 -0
  71. data/lib/generators/squeezer/templates/app/controllers/forums_controller.rb +42 -0
  72. data/lib/generators/squeezer/templates/app/controllers/pages_controller.rb +3 -0
  73. data/lib/generators/squeezer/templates/app/controllers/posts_controller.rb +23 -0
  74. data/lib/generators/squeezer/templates/app/controllers/roles_controller.rb +3 -0
  75. data/lib/generators/squeezer/templates/app/controllers/sites_controller.rb +70 -0
  76. data/lib/generators/squeezer/templates/app/controllers/topics_controller.rb +46 -0
  77. data/lib/generators/squeezer/templates/app/controllers/users_controller.rb +22 -0
  78. data/lib/generators/squeezer/templates/app/helpers/application_helper.rb +66 -0
  79. data/lib/generators/squeezer/templates/app/helpers/blogs_helper.rb +2 -0
  80. data/lib/generators/squeezer/templates/app/helpers/layout_helper.rb +71 -0
  81. data/lib/generators/squeezer/templates/app/helpers/pages_helper.rb +2 -0
  82. data/lib/generators/squeezer/templates/app/models/ability.rb +17 -0
  83. data/lib/generators/squeezer/templates/app/models/blog.rb +6 -0
  84. data/lib/generators/squeezer/templates/app/models/comment.rb +4 -0
  85. data/lib/generators/squeezer/templates/app/models/forum.rb +5 -0
  86. data/lib/generators/squeezer/templates/app/models/isntall.rb +9 -0
  87. data/lib/generators/squeezer/templates/app/models/page.rb +3 -0
  88. data/lib/generators/squeezer/templates/app/models/post.rb +12 -0
  89. data/lib/generators/squeezer/templates/app/models/role.rb +3 -0
  90. data/lib/generators/squeezer/templates/app/models/site.rb +17 -0
  91. data/lib/generators/squeezer/templates/app/models/topic.rb +6 -0
  92. data/lib/generators/squeezer/templates/app/models/user.rb +35 -0
  93. data/lib/generators/squeezer/templates/app/views/blogs/_entry.haml +26 -0
  94. data/lib/generators/squeezer/templates/app/views/blogs/_form.html.haml +15 -0
  95. data/lib/generators/squeezer/templates/app/views/blogs/edit.html.haml +8 -0
  96. data/lib/generators/squeezer/templates/app/views/blogs/index.html.haml +8 -0
  97. data/lib/generators/squeezer/templates/app/views/blogs/new.html.haml +5 -0
  98. data/lib/generators/squeezer/templates/app/views/blogs/show.html.haml +4 -0
  99. data/lib/generators/squeezer/templates/app/views/comments/_form.html.erb +5 -0
  100. data/lib/generators/squeezer/templates/app/views/comments/_form.html.haml +19 -0
  101. data/lib/generators/squeezer/templates/app/views/comments/_index.html.haml +26 -0
  102. data/lib/generators/squeezer/templates/app/views/comments/_post.html.haml +19 -0
  103. data/lib/generators/squeezer/templates/app/views/comments/_post2.haml +14 -0
  104. data/lib/generators/squeezer/templates/app/views/comments/edit.haml +7 -0
  105. data/lib/generators/squeezer/templates/app/views/comments/show.js.erb +1 -0
  106. data/lib/generators/squeezer/templates/app/views/confirmations/new.html.erb +12 -0
  107. data/lib/generators/squeezer/templates/app/views/devise/confirmations/new.html.erb +12 -0
  108. data/lib/generators/squeezer/templates/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  109. data/lib/generators/squeezer/templates/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  110. data/lib/generators/squeezer/templates/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  111. data/lib/generators/squeezer/templates/app/views/devise/passwords/edit.html.erb +16 -0
  112. data/lib/generators/squeezer/templates/app/views/devise/passwords/new.html.erb +12 -0
  113. data/lib/generators/squeezer/templates/app/views/devise/registrations/edit.html.erb +28 -0
  114. data/lib/generators/squeezer/templates/app/views/devise/registrations/new.html.erb +21 -0
  115. data/lib/generators/squeezer/templates/app/views/devise/sessions/new.html.erb +17 -0
  116. data/lib/generators/squeezer/templates/app/views/devise/shared/_links.erb +19 -0
  117. data/lib/generators/squeezer/templates/app/views/devise/unlocks/new.html.erb +12 -0
  118. data/lib/generators/squeezer/templates/app/views/devise_mailer/confirmation_instructions.html.erb +5 -0
  119. data/lib/generators/squeezer/templates/app/views/devise_mailer/reset_password_instructions.html.erb +8 -0
  120. data/lib/generators/squeezer/templates/app/views/devise_mailer/unlock_instructions.html.erb +7 -0
  121. data/lib/generators/squeezer/templates/app/views/forums/_form.html.haml +14 -0
  122. data/lib/generators/squeezer/templates/app/views/forums/edit.html.haml +8 -0
  123. data/lib/generators/squeezer/templates/app/views/forums/index.html.haml +37 -0
  124. data/lib/generators/squeezer/templates/app/views/forums/new.html.haml +5 -0
  125. data/lib/generators/squeezer/templates/app/views/forums/show.html.haml +43 -0
  126. data/lib/generators/squeezer/templates/app/views/layouts/_footer.html.haml +5 -0
  127. data/lib/generators/squeezer/templates/app/views/layouts/_header.html.haml +10 -0
  128. data/lib/generators/squeezer/templates/app/views/layouts/_ice.haml +27 -0
  129. data/lib/generators/squeezer/templates/app/views/layouts/_latest.haml +15 -0
  130. data/lib/generators/squeezer/templates/app/views/layouts/_login.html.erb +9 -0
  131. data/lib/generators/squeezer/templates/app/views/layouts/_login.html.haml +12 -0
  132. data/lib/generators/squeezer/templates/app/views/layouts/_menu.html.haml +6 -0
  133. data/lib/generators/squeezer/templates/app/views/layouts/_msn.haml +12 -0
  134. data/lib/generators/squeezer/templates/app/views/layouts/_sidebar.html.haml +1 -0
  135. data/lib/generators/squeezer/templates/app/views/layouts/application.html.erb +14 -0
  136. data/lib/generators/squeezer/templates/app/views/layouts/application.html.haml +14 -0
  137. data/lib/generators/squeezer/templates/app/views/layouts/ice/squeezer/_ice.haml +27 -0
  138. data/lib/generators/squeezer/templates/app/views/pages/_form.html.haml +17 -0
  139. data/lib/generators/squeezer/templates/app/views/pages/edit.html.haml +8 -0
  140. data/lib/generators/squeezer/templates/app/views/pages/index.html.haml +22 -0
  141. data/lib/generators/squeezer/templates/app/views/pages/new.html.haml +5 -0
  142. data/lib/generators/squeezer/templates/app/views/pages/show.html.haml +12 -0
  143. data/lib/generators/squeezer/templates/app/views/passwords/edit.html.erb +16 -0
  144. data/lib/generators/squeezer/templates/app/views/passwords/new.html.erb +12 -0
  145. data/lib/generators/squeezer/templates/app/views/registrations/edit.html.erb +25 -0
  146. data/lib/generators/squeezer/templates/app/views/registrations/new.html.erb +17 -0
  147. data/lib/generators/squeezer/templates/app/views/roles/_form.html.haml +9 -0
  148. data/lib/generators/squeezer/templates/app/views/roles/edit.html.haml +7 -0
  149. data/lib/generators/squeezer/templates/app/views/roles/index.html.haml +19 -0
  150. data/lib/generators/squeezer/templates/app/views/roles/new.html.haml +5 -0
  151. data/lib/generators/squeezer/templates/app/views/roles/show.html.haml +13 -0
  152. data/lib/generators/squeezer/templates/app/views/roles/user.html.erb +14 -0
  153. data/lib/generators/squeezer/templates/app/views/sessions/new.html.erb +17 -0
  154. data/lib/generators/squeezer/templates/app/views/shared/_devise_links.erb +19 -0
  155. data/lib/generators/squeezer/templates/app/views/sites/_form.html.haml +42 -0
  156. data/lib/generators/squeezer/templates/app/views/sites/edit.html.haml +1 -0
  157. data/lib/generators/squeezer/templates/app/views/sites/index.html.haml +165 -0
  158. data/lib/generators/squeezer/templates/app/views/sites/new.html.haml +1 -0
  159. data/lib/generators/squeezer/templates/app/views/sites/show.html.haml +18 -0
  160. data/lib/generators/squeezer/templates/app/views/topics/_form.html.haml +16 -0
  161. data/lib/generators/squeezer/templates/app/views/topics/edit.html.erb +8 -0
  162. data/lib/generators/squeezer/templates/app/views/topics/index.html.haml +23 -0
  163. data/lib/generators/squeezer/templates/app/views/topics/new.html.erb +5 -0
  164. data/lib/generators/squeezer/templates/app/views/topics/show.html.haml +16 -0
  165. data/lib/generators/squeezer/templates/app/views/unlocks/new.html.erb +12 -0
  166. data/lib/generators/squeezer/templates/app/views/users/index.haml +5 -0
  167. data/lib/generators/squeezer/templates/app/views/users/roles.haml +14 -0
  168. data/lib/generators/squeezer/templates/config/devise.rb +142 -0
  169. data/lib/generators/squeezer/templates/db/migrate/add_username_user.rb +11 -0
  170. data/lib/generators/squeezer/templates/db/migrate/blogs.rb +15 -0
  171. data/lib/generators/squeezer/templates/db/migrate/comments.rb +15 -0
  172. data/lib/generators/squeezer/templates/db/migrate/create_blogs.rb +15 -0
  173. data/lib/generators/squeezer/templates/db/migrate/create_comments.rb +15 -0
  174. data/lib/generators/squeezer/templates/db/migrate/create_pages.rb +16 -0
  175. data/lib/generators/squeezer/templates/db/migrate/create_posts.rb +16 -0
  176. data/lib/generators/squeezer/templates/db/migrate/create_roles.rb +13 -0
  177. data/lib/generators/squeezer/templates/db/migrate/create_roles_users.rb +15 -0
  178. data/lib/generators/squeezer/templates/db/migrate/create_sites.rb +26 -0
  179. data/lib/generators/squeezer/templates/db/migrate/data.rb +7 -0
  180. data/lib/generators/squeezer/templates/db/migrate/page_data.rb +10 -0
  181. data/lib/generators/squeezer/templates/db/migrate/pages.rb +16 -0
  182. data/lib/generators/squeezer/templates/db/migrate/posts.rb +16 -0
  183. data/lib/generators/squeezer/templates/db/migrate/roles.rb +13 -0
  184. data/lib/generators/squeezer/templates/db/migrate/roles_users.rb +15 -0
  185. data/lib/generators/squeezer/templates/db/migrate/sites.rb +26 -0
  186. data/lib/generators/squeezer/templates/db/migrate/squeez_data.rb +7 -0
  187. data/lib/generators/squeezer/templates/doc/clases.png +0 -0
  188. data/lib/generators/squeezer/templates/ice/squeezer/ice/_ice.haml +6 -0
  189. data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/_ice.haml +28 -0
  190. data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/ice/_ice.haml +6 -0
  191. data/lib/generators/squeezer/templates/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +7 -0
  192. data/lib/generators/squeezer/templates/ice/squeezer/squeezer.css +252 -0
  193. data/lib/generators/squeezer/templates/public/javascripts/application.js +53 -0
  194. data/lib/generators/squeezer/templates/public/javascripts/jquery-ui.js +11437 -0
  195. data/lib/generators/squeezer/templates/public/javascripts/jquery-ui.min.js +401 -0
  196. data/lib/generators/squeezer/templates/public/javascripts/jquery.cleditor.min.js +31 -0
  197. data/lib/generators/squeezer/templates/public/javascripts/jquery.js +6883 -0
  198. data/lib/generators/squeezer/templates/public/javascripts/jquery.layout.min-1.2.0.js +80 -0
  199. data/lib/generators/squeezer/templates/public/javascripts/jquery.min.js +166 -0
  200. data/lib/generators/squeezer/templates/public/javascripts/rails.js +146 -0
  201. data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/images/buttons.gif +0 -0
  202. data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/images/toolbar.gif +0 -0
  203. data/lib/generators/squeezer/templates/public/stylesheets/CLEditor1_3_0/jquery.cleditor.css +24 -0
  204. data/lib/generators/squeezer/templates/public/stylesheets/ice/lagota/ice/_ice.haml +6 -0
  205. data/lib/generators/squeezer/templates/public/stylesheets/ice/lagota/lagota.css +284 -0
  206. data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/_ice.haml +6 -0
  207. data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/_ice.haml +27 -0
  208. data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/ice/_ice.haml +6 -0
  209. data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/ice/squeezer/ice/squeezer/_ice.haml +7 -0
  210. data/lib/generators/squeezer/templates/public/stylesheets/ice/squeezer/squeezer.css +249 -0
  211. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  212. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  213. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  214. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  215. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  216. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  217. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  218. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  219. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  220. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  221. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  222. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  223. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  224. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  225. data/lib/generators/squeezer/templates/public/stylesheets/ui-lightness/jquery-ui-1.8.5.custom.css +572 -0
  226. data/lib/squeezer.rb +1 -1
  227. data/pkg/squeezer-0.1.3.gem +0 -0
  228. data/pkg/squeezer-0.1.4.gem +0 -0
  229. data/squeezer.gemspec +227 -65
  230. metadata +229 -67
  231. data/lib/squeezer/engine.rb +0 -0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,37 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.0.beta4'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ gem 'sqlite3-ruby', :require => 'sqlite3'
9
+
10
+ gem "will_paginate", "~> 3.0.pre2"
11
+ gem 'haml'
12
+ gem 'devise',"~>1.1.rc2"
13
+ gem 'paperclip'
14
+ gem 'cancan'
15
+ gem 'nifty-generators'
16
+
17
+
18
+ # Use unicorn as the web server
19
+ # gem 'unicorn'
20
+
21
+ # Deploy with Capistrano
22
+ # gem 'capistrano'
23
+
24
+ # To use debugger
25
+ # gem 'ruby-debug'
26
+
27
+ # Bundle the extra gems:
28
+ # gem 'bj'
29
+ # gem 'nokogiri', '1.4.1'
30
+ # gem 'sqlite3-ruby', :require => 'sqlite3'
31
+ # gem 'aws-s3', :require => 'aws/s3'
32
+
33
+ # Bundle gems for certain environments:
34
+ # gem 'rspec', :group => :test
35
+ # group :test do
36
+ # gem 'webrat'
37
+ # end
@@ -0,0 +1,2 @@
1
+ Squeezer:
2
+ Este proyecto tiene como objetivo tener en una gema todos los controladores modelos y vistas que por defecto entran en una applicacion base.
@@ -0,0 +1,7 @@
1
+ Description:
2
+ Genera lo básico para la aplicación
3
+
4
+ Example:
5
+ Entidad de Roles
6
+
7
+
@@ -0,0 +1,114 @@
1
+ require 'rails/generators/resource_helpers'
2
+ require 'rails/generators/rails/model/model_generator'
3
+ require 'active_support/core_ext/object/blank'
4
+
5
+ class SqueezerGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ def self.next_migration_number(dirname)
11
+ if ActiveRecord::Base.timestamped_migrations
12
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
13
+ else
14
+ "%.3d" % (current_migration_number(dirname) + 1 )
15
+ end
16
+ end
17
+
18
+ def squeez
19
+ gem "will_paginate", "~> 3.0.pre2"
20
+ puts "paginacion"
21
+ gem 'haml'
22
+ puts "para escribir en haml en lugar de html"
23
+ gem 'devise',"~>1.1.rc2"
24
+ puts "maneja la registracion de usuario, login, emails de confirmacion, etc"
25
+ gem 'paperclip'
26
+ puts "para subir archivos"
27
+ gem 'cancan'
28
+ puts "permisos para roles"
29
+ gem 'nifty-generators'
30
+ puts "un generador de scaffold mas lindo"
31
+ gem 'jquery-rails'
32
+ puts "para usar jquery en lugar de prototype"
33
+ gem 'inherited_resources'
34
+ puts "para no tener que repetir el mismo controlardor todas las veces, util para entidades simples."
35
+ gem 'mysql'
36
+ puts "para usar mysql"
37
+ gem "meta_search"
38
+ puts "hace las busquedas mas faciles"
39
+ gem "rails_helpers_fix"
40
+ puts "hasta que salga laversion 3.1 esto soluciona el error de no inclir los helpers"
41
+
42
+ generate('bundler install')
43
+ generate('jquery:install --ui')
44
+ generate('devise:install')
45
+ generate('devise user')
46
+ #generate('nifty:layout')
47
+ #generate('devise:views')
48
+
49
+ #models
50
+ cf_m "user.rb"
51
+ cf_m "ability.rb"
52
+
53
+ #vistas
54
+ cf_v "layouts/application.html.erb"
55
+ cf_v "layouts/_msn.haml"
56
+ cf_v "layouts/_login.html.erb"
57
+ cf_v "layouts/_sidebar.html.haml"
58
+ cf_v "layouts/_menu.html.haml"
59
+ cf_v "layouts/_msn.haml"
60
+ cf_v "layouts/_footer.html.haml"
61
+ cf_v "layouts/_ice.haml"
62
+ copy_file("public/javascripts/application.js","public/javascripts/application.js")
63
+ copy_file("public/javascripts/jquery.layout.min-1.2.0.js","public/javascripts/jquery.layout.min-1.2.0.js")
64
+
65
+ copy_file("config/devise.rb","config/initializers/devise.rb")
66
+
67
+ FileUtils.cp_r "vendor/plugins/squeezer/lib/generators/squeezer/templates/public/stylesheets" ,"public"
68
+
69
+ migrations
70
+
71
+ end
72
+
73
+ private
74
+
75
+ def migrations
76
+ #migraciones
77
+ cf_mig("create_roles")
78
+ cf_mig("create_pages")
79
+ cf_mig("create_blogs")
80
+ cf_mig("create_comments")
81
+ cf_mig("create_posts")
82
+ cf_mig("create_roles_users")
83
+ cf_mig("create_sites")
84
+ cf_mig("add_username_user")
85
+ cf_mig("squeez_data")
86
+ cf_mig("page_data")
87
+ end
88
+
89
+ def cf_mig(dir)
90
+ migration_template "db/migrate/#{dir}.rb", "db/migrate/#{dir}"
91
+ sleep 1
92
+ end
93
+
94
+ def cf_js(dir)
95
+ copy_file("public/javascripts/#{dir}","public/javascripts/#{dir}")
96
+ end
97
+
98
+ def cf_h(dir)
99
+ copy_file("app/helpers/#{dir}","app/helpers/#{dir}")
100
+ end
101
+
102
+ def cf_v(dir)
103
+ copy_file("app/views/#{dir}","app/views/#{dir}")
104
+ end
105
+
106
+ def cf_m(dir)
107
+ copy_file("app/models/#{dir}","app/models/#{dir}")
108
+ end
109
+
110
+ def cf_c(dir)
111
+ copy_file("app/controllers/#{dir}","app/controllers/#{dir}")
112
+ end
113
+
114
+ end
@@ -0,0 +1,37 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 3.0.0.rc'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ gem 'sqlite3-ruby', :require => 'sqlite3'
9
+
10
+ gem "will_paginate", "~> 3.0.pre2"
11
+ gem 'haml'
12
+ gem 'devise',"~>1.1.rc2"
13
+ gem 'paperclip'
14
+ gem 'cancan'
15
+ gem 'nifty-generators'
16
+
17
+
18
+ # Use unicorn as the web server
19
+ # gem 'unicorn'
20
+
21
+ # Deploy with Capistrano
22
+ # gem 'capistrano'
23
+
24
+ # To use debugger
25
+ # gem 'ruby-debug'
26
+
27
+ # Bundle the extra gems:
28
+ # gem 'bj'
29
+ # gem 'nokogiri', '1.4.1'
30
+ # gem 'sqlite3-ruby', :require => 'sqlite3'
31
+ # gem 'aws-s3', :require => 'aws/s3'
32
+
33
+ # Bundle gems for certain environments:
34
+ # gem 'rspec', :group => :test
35
+ # group :test do
36
+ # gem 'webrat'
37
+ # end
@@ -0,0 +1,25 @@
1
+ # Filters added to this controller apply to all controllers in the application.
2
+ # Likewise, all the methods added will be available for all controllers.
3
+
4
+ class ApplicationController < ActionController::Base
5
+
6
+ protect_from_forgery
7
+ layout 'application'
8
+
9
+ helper_method :site
10
+ helper_method :latests
11
+
12
+ def latests
13
+ Blog.paginate :page =>1,:per_page=>5, :order => 'created_at DESC'
14
+ end
15
+
16
+ def site
17
+ return Site.last
18
+ end
19
+
20
+ rescue_from CanCan::AccessDenied do |exception|
21
+ flash[:error] = "Acceso no permitido!"
22
+ redirect_to root_url
23
+ end
24
+
25
+ end
@@ -0,0 +1,37 @@
1
+ class CommentsController < ApplicationController
2
+ load_and_authorize_resource
3
+
4
+ def show
5
+ time = Time.at(params[:after].to_i + 1)
6
+ @post = Post.where("comment_id = ? and created_at > ?",@comment.id,time)
7
+ end
8
+
9
+ def open
10
+ @comment = Comment.find(params[:id])
11
+ @comment.open=1
12
+ @comment.save
13
+ redirect_to :back
14
+ end
15
+
16
+ def close
17
+ @comment = Comment.find(params[:id])
18
+ @comment.open = false
19
+ @comment.save
20
+ redirect_to :back
21
+ end
22
+
23
+ def new
24
+ @comment = Comment.new
25
+ @comment.commentable_id = params[:id]
26
+ @comment.open = true
27
+ @comment.commentable_type = params[:type]
28
+ @comment.save
29
+ redirect_to :back
30
+ end
31
+
32
+ def remove
33
+ @comment = Comment.find(params[:id])
34
+ @comment.destroy
35
+ redirect_to :back
36
+ end
37
+ end
@@ -0,0 +1,42 @@
1
+ class ForumsController < ApplicationController
2
+ filter_resource_access
3
+ def index
4
+ @forums = Forum.all
5
+ end
6
+
7
+ def show
8
+ search = Topic.search(params[:search]).forum_id_equals(@forum.id)
9
+ @topics = search.all.paginate(:per_page => 20, :page => params[:page])
10
+ end
11
+
12
+ def new
13
+ end
14
+
15
+ def create
16
+ if @forum.save
17
+ flash[:notice] = "Successfully created forum."
18
+ redirect_to @forum
19
+ else
20
+ render :action => 'new'
21
+ end
22
+ end
23
+
24
+ def edit
25
+ end
26
+
27
+ def update
28
+ if @forum.update_attributes(params[:forum])
29
+ flash[:notice] = "Successfully updated forum."
30
+ redirect_to @forum
31
+ else
32
+ render :action => 'edit'
33
+ end
34
+ end
35
+
36
+ def destroy
37
+ @forum = Forum.find(params[:id])
38
+ @forum.destroy
39
+ flash[:notice] = "Successfully destroyed forum."
40
+ redirect_to forums_url
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ class PagesController < InheritedResources::Base
2
+
3
+ end
@@ -0,0 +1,23 @@
1
+ class PostsController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ def edit
5
+ @post = Post.find(params[:id])
6
+ render "comments/edit"
7
+ end
8
+ def create
9
+ @post = Post.new(params[:post])
10
+ @post.user =current_user
11
+ if @post.save
12
+ redirect_to(@post.comment.commentable, :notice => 'Post was successfully created.')
13
+ else
14
+ redirect_to :back
15
+ flash[:error]="Completa todos los datos"
16
+ end
17
+ end
18
+
19
+ def destroy
20
+ @post.destroy
21
+ redirect_to @post.comment.commentable
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ class RolesController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+ end
@@ -0,0 +1,70 @@
1
+ class SitesController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ def new
5
+ @files = Dir.open("public/stylesheets/ice")
6
+ @site=site
7
+ if(!@site)
8
+ @site = Site.new
9
+
10
+ respond_to do |format|
11
+ format.html # new.html.erb
12
+ format.xml { render :xml => @site }
13
+ end
14
+ else
15
+ flash[:notice]="el sitio ya fue creado"
16
+
17
+ end
18
+ end
19
+
20
+ # GET /sites/1/edit
21
+ def edit
22
+ if site
23
+ @site = site
24
+ @files = Dir.open("public/stylesheets/ice")
25
+ else
26
+ redirect_to({:action=>new})
27
+ end
28
+ end
29
+
30
+ # POST /sites
31
+ # POST /sites.xml
32
+ def create
33
+ @site = Site.new(params[:site])
34
+ respond_to do |format|
35
+ if @site.save
36
+ flash[:notice] = 'El sitio fue creado'
37
+ format.html { redirect_to(:controller=>"users",:action=>'sign_up') }
38
+ format.xml { render :xml => @site, :status => :created, :location => @site }
39
+ else
40
+ format.html { render :action => "new" }
41
+ format.xml { render :xml => @site.errors, :status => :unprocessable_entity }
42
+ end
43
+ end
44
+ end
45
+
46
+ # PUT /sites/1
47
+ # PUT /sites/1.xml
48
+ def update
49
+ @site = Site.find(params[:id])
50
+
51
+ respond_to do |format|
52
+ if @site.update_attributes(params[:site])
53
+ files = Dir.open("public/stylesheets/ice/#{@site.style}/ice")
54
+ FileUtils.cp_r files ,"app/views/layouts/ice/#{@site.style}"
55
+ flash[:notice] = 'Site was successfully updated.'
56
+ format.html { redirect_to(@site) }
57
+ format.xml { head :ok }
58
+ else
59
+ format.html { render :action => "edit" }
60
+ format.xml { render :xml => @site.errors, :status => :unprocessable_entity }
61
+ end
62
+ end
63
+ end
64
+
65
+ def destroy
66
+ @site = Site.last
67
+ @site.destroy
68
+ redirect_to(@site)
69
+ end
70
+ end
@@ -0,0 +1,46 @@
1
+ class TopicsController < ApplicationController
2
+ def index
3
+ @topics = Topic.all
4
+ end
5
+
6
+ def show
7
+ @topic = Topic.find(params[:id])
8
+ Comment.posts(@topic)
9
+ end
10
+
11
+ def new
12
+ @topic = Topic.new
13
+ @topic.forum_id=params[:id]
14
+ @post = Post.new
15
+ end
16
+
17
+ def create
18
+ @topic = Topic.new(params[:topic])
19
+ @topic=Comment.add_comment(@topic)
20
+ Comment.add_post(@topic.comment.id,params[:post][:body])
21
+
22
+ flash[:notice]="Listo!"
23
+ redirect_to @topic
24
+ end
25
+
26
+ def edit
27
+ @topic = Topic.find(params[:id])
28
+ end
29
+
30
+ def update
31
+ @topic = Topic.find(params[:id])
32
+ if @topic.update_attributes(params[:topic])
33
+ flash[:notice] = "Successfully updated topic."
34
+ redirect_to @topic
35
+ else
36
+ render :action => 'edit'
37
+ end
38
+ end
39
+
40
+ def destroy
41
+ @topic = Topic.find(params[:id])
42
+ @topic.destroy
43
+ flash[:notice] = "Successfully destroyed topic."
44
+ redirect_to topics_url
45
+ end
46
+ end
@@ -0,0 +1,22 @@
1
+ class UsersController < ApplicationController
2
+ load_and_authorize_resource
3
+
4
+ def index
5
+ @users = User.all
6
+ end
7
+
8
+ def roles
9
+ end
10
+
11
+ def update
12
+ if !params[:user]
13
+ roles = []
14
+ else
15
+ roles = params[:user][:role_ids]
16
+ end
17
+ flash[:notice]=params[:id]
18
+ @user.update_attributes({:role_ids =>roles})
19
+ redirect_to roles_path
20
+ end
21
+
22
+ end