wheels 0.0.3

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 (140) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +17 -0
  5. data/Rakefile +53 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/application_controller.rb +17 -0
  8. data/app/controllers/blogs_controller.rb +17 -0
  9. data/app/controllers/galleries_controller.rb +60 -0
  10. data/app/controllers/images_controller.rb +30 -0
  11. data/app/controllers/profiles_controller.rb +16 -0
  12. data/app/controllers/users_controller.rb +4 -0
  13. data/app/models/ability.rb +23 -0
  14. data/app/models/blog.rb +8 -0
  15. data/app/models/gallery.rb +5 -0
  16. data/app/models/image.rb +8 -0
  17. data/app/models/profile.rb +11 -0
  18. data/app/models/role.rb +8 -0
  19. data/app/models/user.rb +43 -0
  20. data/app/views/blogs/_form.html.haml +28 -0
  21. data/app/views/blogs/edit.html.haml +8 -0
  22. data/app/views/blogs/index.html.haml +19 -0
  23. data/app/views/blogs/index.xml.builder +27 -0
  24. data/app/views/blogs/new.html.haml +6 -0
  25. data/app/views/blogs/show.html.haml +10 -0
  26. data/app/views/galleries/_form.html.haml +29 -0
  27. data/app/views/galleries/_show.html.haml +21 -0
  28. data/app/views/galleries/edit.html.haml +7 -0
  29. data/app/views/galleries/index.html.haml +15 -0
  30. data/app/views/galleries/new.html.haml +5 -0
  31. data/app/views/galleries/show.html.haml +4 -0
  32. data/app/views/images/_form.html.haml +10 -0
  33. data/app/views/images/create.js.haml +3 -0
  34. data/app/views/images/destroy.js.haml +3 -0
  35. data/app/views/images/edit.html.haml +7 -0
  36. data/app/views/images/edit.js.haml +3 -0
  37. data/app/views/images/index.html.haml +17 -0
  38. data/app/views/images/index.js.haml +3 -0
  39. data/app/views/images/new.html.haml +5 -0
  40. data/app/views/images/new.js.haml +3 -0
  41. data/app/views/images/show.html.haml +5 -0
  42. data/app/views/images/show.js.haml +3 -0
  43. data/app/views/images/update.js.haml +3 -0
  44. data/app/views/layouts/image_dialog.html.haml +18 -0
  45. data/app/views/profiles/_form.html.haml +26 -0
  46. data/app/views/profiles/edit.html.haml +7 -0
  47. data/app/views/profiles/index.html.haml +25 -0
  48. data/app/views/profiles/new.html.haml +5 -0
  49. data/app/views/profiles/show.html.haml +21 -0
  50. data/app/views/users/index.html.haml +19 -0
  51. data/config/amazon_s3.yml +15 -0
  52. data/db/migrate/add_fields_to_users.rb +28 -0
  53. data/db/migrate/create_blogs.rb +16 -0
  54. data/db/migrate/create_galleries.rb +15 -0
  55. data/db/migrate/create_images.rb +17 -0
  56. data/db/migrate/create_profiles.rb +24 -0
  57. data/db/migrate/create_roles.rb +16 -0
  58. data/init.rb +2 -0
  59. data/lib/generators/wheels/LICENCE +20 -0
  60. data/lib/generators/wheels/USAGE +8 -0
  61. data/lib/generators/wheels/core_extensions.rb +56 -0
  62. data/lib/generators/wheels/install_generator.rb +25 -0
  63. data/lib/generators/wheels/recipes/cancan.rb +6 -0
  64. data/lib/generators/wheels/recipes/cucumber.rb +39 -0
  65. data/lib/generators/wheels/recipes/default.rb +18 -0
  66. data/lib/generators/wheels/recipes/design.rb +16 -0
  67. data/lib/generators/wheels/recipes/devise.rb +8 -0
  68. data/lib/generators/wheels/recipes/factory_girl.rb +5 -0
  69. data/lib/generators/wheels/recipes/haml.rb +8 -0
  70. data/lib/generators/wheels/recipes/jquery.rb +6 -0
  71. data/lib/generators/wheels/recipes/mongoid.rb +7 -0
  72. data/lib/generators/wheels/recipes/postgresql.rb +11 -0
  73. data/lib/generators/wheels/recipes/remarkable.rb +9 -0
  74. data/lib/generators/wheels/recipes/rspec.rb +23 -0
  75. data/lib/generators/wheels/recipes/wheels.rb +34 -0
  76. data/lib/generators/wheels/snippets/cucumber/database_config +3 -0
  77. data/lib/generators/wheels/templater.rb +29 -0
  78. data/lib/generators/wheels/templates/cancan/ability.rb +13 -0
  79. data/lib/generators/wheels/templates/database/postgresql.yml +19 -0
  80. data/lib/generators/wheels/templates/git/gitignore +8 -0
  81. data/lib/generators/wheels/templates/haml/app/views/layouts/application.html.haml +9 -0
  82. data/lib/generators/wheels/templates/mongoid/features/step_definitions/mongoid_steps.rb +4 -0
  83. data/lib/generators/wheels/templates/mongoid/features/support/hooks.rb +3 -0
  84. data/lib/generators/wheels/wheels_generator.rb +69 -0
  85. data/lib/wheels/routes.rb +25 -0
  86. data/lib/wheels.rb +2 -0
  87. data/public/404.html +26 -0
  88. data/public/422.html +26 -0
  89. data/public/500.html +26 -0
  90. data/public/favicon.ico +0 -0
  91. data/public/images/dreamy/Thumbs.db +0 -0
  92. data/public/images/dreamy/bg-ad-top.png +0 -0
  93. data/public/images/dreamy/bg-body.png +0 -0
  94. data/public/images/dreamy/bg-feed.gif +0 -0
  95. data/public/images/dreamy/bg-footer.jpg +0 -0
  96. data/public/images/dreamy/bg-header.jpg +0 -0
  97. data/public/images/dreamy/bg-menu-hover.png +0 -0
  98. data/public/images/dreamy/bg-menu.png +0 -0
  99. data/public/images/dreamy/bg-sidebar-bottom.gif +0 -0
  100. data/public/images/dreamy/button-feed.png +0 -0
  101. data/public/images/dreamy/icon-comment.png +0 -0
  102. data/public/images/growl/error.png +0 -0
  103. data/public/images/growl/growl_bottom.png +0 -0
  104. data/public/images/growl/growl_repeat.png +0 -0
  105. data/public/images/growl/growl_top.png +0 -0
  106. data/public/images/growl/info.png +0 -0
  107. data/public/images/menu/item-pointer-mover.gif +0 -0
  108. data/public/images/menu/item-pointer.gif +0 -0
  109. data/public/images/menu/lava.gif +0 -0
  110. data/public/images/menu/lava.png +0 -0
  111. data/public/images/menu/main-bg.png +0 -0
  112. data/public/images/menu/main-delimiter.png +0 -0
  113. data/public/javascripts/jquery.growl.js +143 -0
  114. data/public/javascripts/loadbehind.js +0 -0
  115. data/public/javascripts/menu.js +247 -0
  116. data/public/stylesheets/.gitkeep +0 -0
  117. data/public/stylesheets/dreamy.css +181 -0
  118. data/public/stylesheets/menu.css +101 -0
  119. data/public/stylesheets/sass/dreamy.sass +195 -0
  120. data/public/stylesheets/sass/menu.sass +105 -0
  121. data/public/stylesheets/scaffold.css +56 -0
  122. data/public/stylesheets/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  123. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  124. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  125. data/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  126. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  127. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  128. data/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  129. data/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  130. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  131. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  132. data/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  133. data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  134. data/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  135. data/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  136. data/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  137. data/public/stylesheets/ui-lightness/jquery-ui-1.8.2.custom.css +359 -0
  138. data/test/helper.rb +10 -0
  139. data/test/test_wheels.rb +7 -0
  140. metadata +220 -0
@@ -0,0 +1,19 @@
1
+ development:
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ database: %database_name%
5
+ pool: 5
6
+ username: %database_username%
7
+ password: %database_password%
8
+ host: localhost
9
+ port: 5432
10
+
11
+ # Warning: The database defined as "test" will be erased and
12
+ # re-generated from your development database when you run "rake".
13
+ # Do not set this db to the same as development or production.
14
+ test:
15
+ adapter: sqlite3
16
+ database: db/test.sqlite3
17
+ pool: 5
18
+ timeout: 5000
19
+
@@ -0,0 +1,8 @@
1
+ .ackrc
2
+ .rvmrc
3
+ config/database.yml
4
+ config/mongoid.yml
5
+ public/cache/
6
+ public/stylesheets/compiled/
7
+ public/system/*
8
+ tmp/restart.txt
@@ -0,0 +1,9 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ = csrf_meta_tag
5
+ /[if lt IE 9]
6
+ = javascript_include_tag 'html5'
7
+ %body
8
+ = yield
9
+ = javascript_include_tag :defaults
@@ -0,0 +1,4 @@
1
+ Given /^an? (.+) exists with an? (.+) of "([^"]*)"$/ do |model, field, value|
2
+ factory_name = model.gsub(' ', '_')
3
+ Factory factory_name, field => value
4
+ end
@@ -0,0 +1,3 @@
1
+ Before do |scenario|
2
+ Mongoid.master.collections.select {|c| c.name !~ /system/ }.each(&:drop)
3
+ end
@@ -0,0 +1,69 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+ require 'rails/generators/generated_attribute'
4
+ require 'rails/generators/active_record'
5
+
6
+ class WheelsGenerator < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+ require File.join(File.dirname(__FILE__), 'core_extensions.rb')
9
+ source_root File.expand_path('../../../../', __FILE__)
10
+ desc "Installs files needed for App Template gem."
11
+
12
+ # argument :scope, :required => false, :default => nil,
13
+ # :desc => "The scope to copy views to"
14
+
15
+ # class_option :template_engine, :type => :string, :aliases => "-t",
16
+ # :desc => "Template engine for the views. Available options are 'erb' and 'haml'."
17
+
18
+ def init
19
+ initialize_templater
20
+ end
21
+
22
+ def load_recipes
23
+ required_recipes = %w(default jquery haml devise cancan postgresql)
24
+ required_recipes.each {|required_recipe| apply recipe(required_recipe)}
25
+
26
+ # apply recipe(ask("Which database? (m)ongoid or (p)ostgresql")=='m' ? 'mongoid' : 'postgresql')
27
+
28
+ load_options
29
+ # apply(recipe('cucumber')) if yes?("Do you want to some cukes?")
30
+ apply recipe('design')
31
+ apply recipe('wheels')
32
+ end
33
+
34
+ def bundle_install
35
+ run 'bundle install'
36
+ end
37
+
38
+ def execute
39
+ execute_stategies
40
+ end
41
+
42
+ def configure_generators
43
+ generators_configuration = <<-END
44
+ config.generators do |g|
45
+ g.template_engine :haml
46
+ g.fixture_replacement :factory_girl, :dir => 'spec/factories'
47
+ end
48
+ END
49
+
50
+ environment generators_configuration
51
+ end
52
+
53
+ def init_git
54
+ git :add => "."
55
+ git :commit => "-m 'Initial commit'"
56
+ if (a=ask("Enter github username/reponame or blank for none.")).length > 0
57
+ run "git remote add origin git@github.com:#{a}.git"
58
+ end
59
+ end
60
+
61
+ def self.next_migration_number(dirname)
62
+ if ActiveRecord::Base.timestamped_migrations
63
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
64
+ else
65
+ "%.3d" % (current_migration_number(dirname) + 1)
66
+ end
67
+ end
68
+ end
69
+
@@ -0,0 +1,25 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+ def wheels_resources
4
+ resources :galleries do
5
+ resources :images
6
+ end
7
+ resource :profile
8
+ resources :blogs, :path=>"blog"
9
+
10
+ devise_for :users
11
+
12
+ resources :users do
13
+ resource :profile
14
+ resources :galleries
15
+ resources :blogs, :path=>"blog" do
16
+ resources :blog_images, :path=>"images"
17
+ end
18
+ end
19
+ scope :module=>"admin" do
20
+ resources :users
21
+ end
22
+ end
23
+ end
24
+ end
25
+
data/lib/wheels.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'wheels/routes.rb'
2
+
data/public/404.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
data/public/422.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
data/public/500.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,143 @@
1
+ /*
2
+ * jQuery Growl plugin
3
+ * Version 1.0.2 (8/1/2009)
4
+ * @requires jQuery v1.3.2 or later
5
+ *
6
+ * Examples at: http://fragmentedcode.com/jquery-growl
7
+ * Copyright (c) 2008-2009 David Higgins
8
+ *
9
+ * Special thanks to Daniel Mota for inspiration:
10
+ * http://icebeat.bitacoras.com/mootools/growl/
11
+ */
12
+
13
+ /*
14
+ USAGE:
15
+
16
+ $.growl(title, msg);
17
+ $.growl(title, msg, image);
18
+ $.growl(title, msg, image, priority);
19
+
20
+ THEME/SKIN:
21
+
22
+ You can override the default look and feel by updating these objects:
23
+ $.growl.settings.displayTimeout = 4000;
24
+ $.growl.settings.noticeTemplate = ''
25
+ + '<div>'
26
+ + '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
27
+ + '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; display: block; color: #ffffff; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
28
+ + ' <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
29
+ + ' <h3 style="margin: 0pt; margin-left: 77px; padding-bottom: 10px; font-size: 13px;">%title%</h3>'
30
+ + ' <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
31
+ + '</div>'
32
+ + '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
33
+ + '</div>';
34
+ $.growl.settings.noticeCss = {
35
+ position: 'relative'
36
+ };
37
+
38
+ To change the 'dock' look, and position:
39
+
40
+ $.growl.settings.dockTemplate = '<div></div>';
41
+ $.growl.settings.dockCss = {
42
+ position: 'absolute',
43
+ top: '10px',
44
+ right: '10px',
45
+ width: '300px'
46
+ };
47
+
48
+ The dockCss will allow you to 'dock' the notifications to a specific area
49
+ on the page, such as TopRight (the default) or TopLeft, perhaps even in a
50
+ smaller area with "overflow: scroll" enabled?
51
+ */
52
+
53
+ (function($) {
54
+
55
+ $.growl = function(title,message,image,priority) { notify(title,message,image,priority); }
56
+ $.growl.version = "1.0.2";
57
+
58
+ function create(rebuild) {
59
+ var instance = document.getElementById('growlDock');
60
+ if(!instance || rebuild) {
61
+ instance = $(jQuery.growl.settings.dockTemplate).attr('id', 'growlDock').addClass('growl');
62
+ if(jQuery.growl.settings.defaultStylesheet) {
63
+ $('head').append('<link rel="stylesheet" type="text/css" href="' + jQuery.growl.settings.defaultStylesheet + '" />');
64
+ }
65
+
66
+ } else {
67
+ instance = $(instance);
68
+ }
69
+ $('body').append(instance.css(jQuery.growl.settings.dockCss));
70
+ return instance;
71
+ };
72
+
73
+ function r(text, expr, val) {
74
+ while(expr.test(text)) {
75
+ text = text.replace(expr, val);
76
+ }
77
+ return text;
78
+ };
79
+
80
+ function notify(title,message,image,priority) {
81
+ var instance = create();
82
+ var html = jQuery.growl.settings.noticeTemplate;
83
+ if(typeof(html) == 'object') html = $(html).html();
84
+ html = r(html, /%message%/, (message?message:''));
85
+ html = r(html, /%title%/, (title?title:''));
86
+ html = r(html, /%image%/, (image?image:jQuery.growl.settings.defaultImage));
87
+ html = r(html, /%priority%/, (priority?priority:'normal'));
88
+
89
+ var notice = $(html)
90
+ .hide()
91
+ .css(jQuery.growl.settings.noticeCss)
92
+ .fadeIn(jQuery.growl.settings.notice);;
93
+
94
+ $.growl.settings.noticeDisplay(notice);
95
+ instance.append(notice);
96
+ $('a[rel="close"]', notice).click(function() {
97
+ notice.remove();
98
+ });
99
+ if ($.growl.settings.displayTimeout > 0) {
100
+ setTimeout(function(){
101
+ jQuery.growl.settings.noticeRemove(notice, function(){
102
+ notice.remove();
103
+ });
104
+ }, jQuery.growl.settings.displayTimeout);
105
+ }
106
+ };
107
+
108
+
109
+ // default settings
110
+ $.growl.settings = {
111
+ dockTemplate: '<div></div>',
112
+ dockCss: {
113
+ position: 'fixed',
114
+ top: '10px',
115
+ right: '10px',
116
+ width: '300px',
117
+ zIndex: 50000
118
+ },
119
+ noticeTemplate:
120
+ '<div class="notice">' +
121
+ ' <h3 style="margin-top: 15px"><a rel="close">%title%</a></h3>' +
122
+ ' <p>%message%</p>' +
123
+ '</div>',
124
+ noticeCss: {
125
+ opacity: .75,
126
+ backgroundColor: '#333333',
127
+ color: '#ffffff'
128
+ },
129
+ noticeDisplay: function(notice) {
130
+ notice.css({'opacity':'0'}).fadeIn(jQuery.growl.settings.noticeFadeTimeout);
131
+ },
132
+ noticeRemove: function(notice, callback) {
133
+ notice.animate({opacity: '0', height: '0px'}, {duration:jQuery.growl.settings.noticeFadeTimeout, complete: callback});
134
+ },
135
+ noticeFadeTimeout: 'slow',
136
+ displayTimeout: 3500,
137
+ defaultImage: 'growl.jpg',
138
+ defaultStylesheet: null,
139
+ noticeElement: function(el) {
140
+ $.growl.settings.noticeTemplate = $(el);
141
+ }
142
+ };
143
+ })(jQuery);
File without changes