wheels 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +2 -0
- data/Rakefile +22 -22
- data/lib/{generators/core_extensions.rb → core_extensions.rb} +2 -2
- data/lib/generators/{recipes → wheels/recipes}/cancan.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/cucumber.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/default.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/design.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/devise.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/factory_girl.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/haml.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/jquery.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/mongoid.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/postgresql.rb +0 -0
- data/lib/generators/wheels/recipes/public.rb +9 -0
- data/lib/generators/{recipes → wheels/recipes}/recipes.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/remarkable.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/rspec.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/wheels.rb +0 -0
- data/lib/generators/{snippets → wheels/snippets}/cucumber/database_config +0 -0
- data/lib/generators/{templates → wheels/templates}/cancan/ability.rb +0 -0
- data/lib/generators/{templates → wheels/templates}/database/postgresql.yml +0 -0
- data/lib/generators/{templates → wheels/templates}/git/gitignore +0 -0
- data/lib/generators/{templates → wheels/templates}/haml/app/views/layouts/application.html.haml +0 -0
- data/lib/generators/{templates → wheels/templates}/mongoid/features/step_definitions/mongoid_steps.rb +0 -0
- data/lib/generators/{templates → wheels/templates}/mongoid/features/support/hooks.rb +0 -0
- data/lib/generators/wheels/wheels_generator.rb +0 -2
- data/lib/generators/wheels_update/core_extensions.3.rb +64 -0
- data/lib/generators/{recipes/wheels_update.rb → wheels_update/recipes/wheels.rb} +0 -0
- data/lib/generators/wheels_update/wheels_update_generator.rb +1 -1
- data/lib/wheels/base.rb +7 -0
- data/lib/wheels/routes.rb +2 -13
- data/test/functional/access_control_entries_controller_test.rb +49 -0
- data/test/functional/app_configs_controller_test.rb +49 -0
- data/test/functional/discussions_controller_test.rb +49 -0
- data/test/functional/external_links_controller_test.rb +49 -0
- data/test/functional/feedback_mailer_test.rb +8 -0
- data/test/functional/feedbacks_controller_test.rb +49 -0
- data/test/functional/forums_controller_test.rb +49 -0
- data/test/functional/layouts_controller_test.rb +49 -0
- data/test/functional/member_pages_controller_test.rb +49 -0
- data/test/functional/members_controller_test.rb +8 -0
- data/test/functional/menus_controller_test.rb +49 -0
- data/test/functional/pages_controller_test.rb +49 -0
- data/test/functional/product_revisions_controller_test.rb +49 -0
- data/test/performance/browsing_test.rb +9 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/access_control_entry_test.rb +8 -0
- data/test/unit/app_config_test.rb +8 -0
- data/test/unit/attachment_test.rb +8 -0
- data/test/unit/discussion_test.rb +8 -0
- data/test/unit/external_link_test.rb +8 -0
- data/test/unit/feedback_test.rb +8 -0
- data/test/unit/forum_message_test.rb +8 -0
- data/test/unit/forum_test.rb +8 -0
- data/test/unit/helpers/access_control_entries_helper_test.rb +4 -0
- data/test/unit/helpers/app_configs_helper_test.rb +4 -0
- data/test/unit/helpers/discussions_helper_test.rb +4 -0
- data/test/unit/helpers/external_links_helper_test.rb +4 -0
- data/test/unit/helpers/feedbacks_helper_test.rb +4 -0
- data/test/unit/helpers/forums_helper_test.rb +4 -0
- data/test/unit/helpers/layouts_helper_test.rb +4 -0
- data/test/unit/helpers/member_pages_helper_test.rb +4 -0
- data/test/unit/helpers/members_helper_test.rb +4 -0
- data/test/unit/helpers/menus_helper_test.rb +4 -0
- data/test/unit/helpers/pages_helper_test.rb +4 -0
- data/test/unit/helpers/product_revisions_helper_test.rb +4 -0
- data/test/unit/layout_test.rb +8 -0
- data/test/unit/member_page_test.rb +8 -0
- data/test/unit/menu_test.rb +8 -0
- data/test/unit/page_revision_test.rb +8 -0
- data/test/unit/page_test.rb +8 -0
- data/test/unit/product_revision_test.rb +8 -0
- data/test/unit/settings_test.rb +8 -0
- data/test/unit/sitemap_test.rb +8 -0
- data/test/unit/user_test.rb +8 -0
- data/wheels.gemspec +122 -252
- metadata +124 -266
- data/LICENSE +0 -20
- data/README.rdoc +0 -17
- data/VERSION +0 -1
- data/app/controllers/access_control_entries_controller.rb +0 -20
- data/app/controllers/app_configs_controller.rb +0 -17
- data/app/controllers/application_controller.rb +0 -39
- data/app/controllers/attachments_controller.rb +0 -16
- data/app/controllers/blogs_controller.rb +0 -39
- data/app/controllers/discussions_controller.rb +0 -10
- data/app/controllers/external_links_controller.rb +0 -5
- data/app/controllers/feedbacks_controller.rb +0 -10
- data/app/controllers/forum_messages_controller.rb +0 -13
- data/app/controllers/forums_controller.rb +0 -2
- data/app/controllers/galleries_controller.rb +0 -60
- data/app/controllers/images_controller.rb +0 -30
- data/app/controllers/menus_controller.rb +0 -2
- data/app/controllers/pages_controller.rb +0 -71
- data/app/controllers/profiles_controller.rb +0 -16
- data/app/controllers/sitemaps_controller.rb +0 -135
- data/app/controllers/users_controller.rb +0 -28
- data/app/helpers/access_control_entries_helper.rb +0 -2
- data/app/helpers/app_configs_helper.rb +0 -2
- data/app/helpers/application_helper.rb +0 -36
- data/app/helpers/blogs_helper.rb +0 -10
- data/app/helpers/discussions_helper.rb +0 -2
- data/app/helpers/external_links_helper.rb +0 -2
- data/app/helpers/feedbacks_helper.rb +0 -2
- data/app/helpers/forums_helper.rb +0 -2
- data/app/helpers/menus_helper.rb +0 -2
- data/app/helpers/pages_helper.rb +0 -192
- data/app/helpers/sitemaps_helper.rb +0 -12
- data/app/mailers/feedback_mailer.rb +0 -10
- data/app/models/ability.rb +0 -43
- data/app/models/access_control_entry.rb +0 -100
- data/app/models/app_config.rb +0 -26
- data/app/models/attachment.rb +0 -10
- data/app/models/blog.rb +0 -10
- data/app/models/discussion.rb +0 -19
- data/app/models/external_link.rb +0 -4
- data/app/models/feedback.rb +0 -11
- data/app/models/forum.rb +0 -4
- data/app/models/forum_message.rb +0 -5
- data/app/models/gallery.rb +0 -5
- data/app/models/image.rb +0 -10
- data/app/models/menu.rb +0 -4
- data/app/models/page.rb +0 -7
- data/app/models/page_revision.rb +0 -2
- data/app/models/profile.rb +0 -12
- data/app/models/role.rb +0 -29
- data/app/models/s3_provider.rb +0 -84
- data/app/models/sitemap.rb +0 -171
- data/app/models/tagging.rb +0 -4
- data/app/models/user.rb +0 -69
- data/app/validators/email_validator.rb +0 -22
- data/app/views/access_control_entries/_form.html.haml +0 -33
- data/app/views/access_control_entries/_index.html.haml +0 -46
- data/app/views/access_control_entries/_show.html.haml +0 -12
- data/app/views/access_control_entries/create.js.haml +0 -3
- data/app/views/access_control_entries/destroy.js.haml +0 -3
- data/app/views/access_control_entries/edit.html.haml +0 -7
- data/app/views/access_control_entries/edit.js.haml +0 -3
- data/app/views/access_control_entries/index.html.haml +0 -2
- data/app/views/access_control_entries/index.js.haml +0 -3
- data/app/views/access_control_entries/new.html.haml +0 -5
- data/app/views/access_control_entries/new.js.haml +0 -3
- data/app/views/access_control_entries/show.html.haml +0 -2
- data/app/views/access_control_entries/show.js.haml +0 -4
- data/app/views/access_control_entries/update.js.haml +0 -3
- data/app/views/app_configs/_form.html.haml +0 -11
- data/app/views/app_configs/_index.html.haml +0 -6
- data/app/views/app_configs/_show.html.haml +0 -4
- data/app/views/app_configs/create.js.haml +0 -3
- data/app/views/app_configs/css.css.haml +0 -2
- data/app/views/app_configs/destroy.js.haml +0 -3
- data/app/views/app_configs/edit.html.haml +0 -2
- data/app/views/app_configs/edit.js.haml +0 -3
- data/app/views/app_configs/index.html.haml +0 -2
- data/app/views/app_configs/index.js.haml +0 -3
- data/app/views/app_configs/new.html.haml +0 -2
- data/app/views/app_configs/new.js.haml +0 -3
- data/app/views/app_configs/show.html.haml +0 -2
- data/app/views/app_configs/show.js.haml +0 -3
- data/app/views/app_configs/update.js.haml +0 -3
- data/app/views/attachments/_form.html.haml +0 -26
- data/app/views/attachments/_index.html.haml +0 -9
- data/app/views/attachments/_show.html.haml +0 -6
- data/app/views/attachments/_uploadify.html.erb +0 -12
- data/app/views/attachments/create.js.haml +0 -3
- data/app/views/attachments/destroy.js.haml +0 -3
- data/app/views/attachments/edit.js.haml +0 -3
- data/app/views/attachments/index.html.haml +0 -2
- data/app/views/attachments/index.js.haml +0 -3
- data/app/views/attachments/new.html.haml +0 -3
- data/app/views/attachments/new.js.haml +0 -3
- data/app/views/attachments/show.html.haml +0 -2
- data/app/views/attachments/show.js.haml +0 -3
- data/app/views/attachments/update.js.haml +0 -3
- data/app/views/blogs/_form.html.haml +0 -22
- data/app/views/blogs/edit.html.haml +0 -8
- data/app/views/blogs/index.html.haml +0 -21
- data/app/views/blogs/index.xml.builder +0 -27
- data/app/views/blogs/new.html.haml +0 -6
- data/app/views/blogs/show.html.haml +0 -25
- data/app/views/discussions/_form.html.haml +0 -16
- data/app/views/discussions/edit.html.haml +0 -7
- data/app/views/discussions/index.html.haml +0 -10
- data/app/views/discussions/new.html.haml +0 -25
- data/app/views/discussions/show.html.haml +0 -16
- data/app/views/external_links/_fields_for.html.haml +0 -2
- data/app/views/external_links/_form.html.haml +0 -18
- data/app/views/external_links/_show.html.haml +0 -7
- data/app/views/external_links/create.js.haml +0 -3
- data/app/views/external_links/destroy.js.haml +0 -3
- data/app/views/external_links/edit.html.haml +0 -7
- data/app/views/external_links/edit.js.haml +0 -3
- data/app/views/external_links/index.html.haml +0 -23
- data/app/views/external_links/index.js.haml +0 -3
- data/app/views/external_links/new.html.haml +0 -5
- data/app/views/external_links/new.js.haml +0 -3
- data/app/views/external_links/show.html.haml +0 -2
- data/app/views/external_links/show.js.haml +0 -3
- data/app/views/external_links/update.js.haml +0 -3
- data/app/views/feedback_mailer/submit_feedback.html.haml +0 -22
- data/app/views/feedbacks/_form.html.haml +0 -37
- data/app/views/feedbacks/index.html.haml +0 -27
- data/app/views/feedbacks/new.html.haml +0 -6
- data/app/views/feedbacks/show.html.haml +0 -19
- data/app/views/forum_messages/_form.html.haml +0 -6
- data/app/views/forum_messages/index.html.haml +0 -11
- data/app/views/forum_messages/new.html.haml +0 -5
- data/app/views/forums/_form.html.haml +0 -13
- data/app/views/forums/edit.html.haml +0 -7
- data/app/views/forums/index.html.haml +0 -23
- data/app/views/forums/new.html.haml +0 -5
- data/app/views/forums/show.html.haml +0 -20
- data/app/views/galleries/_form.html.haml +0 -30
- data/app/views/galleries/_show.html.haml +0 -21
- data/app/views/galleries/edit.html.haml +0 -7
- data/app/views/galleries/index.html.haml +0 -15
- data/app/views/galleries/new.html.haml +0 -5
- data/app/views/galleries/show.html.haml +0 -4
- data/app/views/images/_form.html.haml +0 -10
- data/app/views/images/create.js.haml +0 -3
- data/app/views/images/destroy.js.haml +0 -3
- data/app/views/images/edit.html.haml +0 -7
- data/app/views/images/edit.js.haml +0 -3
- data/app/views/images/index.html.haml +0 -17
- data/app/views/images/index.js.haml +0 -3
- data/app/views/images/new.html.haml +0 -5
- data/app/views/images/new.js.haml +0 -3
- data/app/views/images/show.html.haml +0 -5
- data/app/views/images/show.js.haml +0 -3
- data/app/views/images/update.js.haml +0 -3
- data/app/views/layouts/application.html.haml +0 -59
- data/app/views/layouts/bare.html.haml +0 -2
- data/app/views/layouts/image_dialog.html.haml +0 -18
- data/app/views/loadbehind/_destroy.js.haml +0 -3
- data/app/views/loadbehind/_edit.js.haml +0 -4
- data/app/views/loadbehind/_errors.html.haml +0 -5
- data/app/views/loadbehind/_growl_template.html.haml +0 -65
- data/app/views/loadbehind/_show_box.html.haml +0 -9
- data/app/views/loadbehind/_view.js.haml +0 -4
- data/app/views/loadbehind/growl.js.haml +0 -4
- data/app/views/loadbehind/index.js.haml +0 -4
- data/app/views/menus/_form.html.haml +0 -13
- data/app/views/menus/edit.html.haml +0 -7
- data/app/views/menus/index.html.haml +0 -19
- data/app/views/menus/new.html.haml +0 -5
- data/app/views/menus/show.html.haml +0 -7
- data/app/views/pages/_child_pages_links.html.haml +0 -5
- data/app/views/pages/_control_panel.html.haml +0 -15
- data/app/views/pages/_form.html.haml +0 -27
- data/app/views/pages/_form_fields.html.haml +0 -23
- data/app/views/pages/_show.html.haml +0 -4
- data/app/views/pages/_show_attachment.html.haml +0 -6
- data/app/views/pages/_show_small.html.haml +0 -2
- data/app/views/pages/create.js.haml +0 -3
- data/app/views/pages/destroy.js.haml +0 -3
- data/app/views/pages/edit.html.haml +0 -16
- data/app/views/pages/edit.js.haml +0 -4
- data/app/views/pages/index.html.haml +0 -19
- data/app/views/pages/index.js.haml +0 -3
- data/app/views/pages/new.html.haml +0 -5
- data/app/views/pages/new.js.haml +0 -3
- data/app/views/pages/show.html.haml +0 -20
- data/app/views/pages/show.js.haml +0 -3
- data/app/views/pages/update.js.haml +0 -3
- data/app/views/profiles/_form.html.haml +0 -26
- data/app/views/profiles/edit.html.haml +0 -7
- data/app/views/profiles/index.html.haml +0 -25
- data/app/views/profiles/new.html.haml +0 -5
- data/app/views/profiles/show.html.haml +0 -21
- data/app/views/sitemaps/edit.html.haml +0 -12
- data/app/views/sitemaps/edit.js.erb +0 -0
- data/app/views/sitemaps/index.html.haml +0 -83
- data/app/views/sitemaps/index.json.erb +0 -23
- data/app/views/sitemaps/new.html.haml +0 -8
- data/app/views/sitemaps/new.js.erb +0 -0
- data/app/views/users/edit.html.haml +0 -45
- data/app/views/users/index.html.haml +0 -19
- data/config/amazon_s3.yml +0 -15
- data/db/migrate/0000_devise_create_users.rb +0 -26
- data/db/migrate/0010_add_fields_to_users.rb +0 -28
- data/db/migrate/0020_create_blogs.rb +0 -16
- data/db/migrate/0030_create_galleries.rb +0 -15
- data/db/migrate/0040_create_images.rb +0 -17
- data/db/migrate/0050_create_profiles.rb +0 -24
- data/db/migrate/0060_insert_admin_user_and_roles.rb +0 -24
- data/db/migrate/0070_create_pages.rb +0 -16
- data/db/migrate/0080_create_forums.rb +0 -13
- data/db/migrate/0090_create_discussions.rb +0 -14
- data/db/migrate/0100_create_forum_messages.rb +0 -15
- data/db/migrate/0110_create_access_control_entries.rb +0 -23
- data/db/migrate/0120_create_attachments.rb +0 -17
- data/db/migrate/0130_create_roles.rb +0 -13
- data/db/migrate/0140_create_feedbacks.rb +0 -20
- data/db/migrate/0150_create_external_links.rb +0 -14
- data/db/migrate/0160_create_sitemaps.rb +0 -17
- data/db/migrate/0170_create_menus.rb +0 -14
- data/db/migrate/0180_acts_as_taggable_on_migration.rb +0 -28
- data/init.rb +0 -2
data/README
ADDED
data/Rakefile
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
require 'rake'
|
|
1
|
+
|
|
3
2
|
PKG_FILES = FileList[
|
|
4
3
|
'wheels.gemspec',
|
|
5
4
|
'Gemfile',
|
|
6
|
-
'
|
|
7
|
-
'Rakefile', 'README', '
|
|
8
|
-
'
|
|
9
|
-
'config/**/*',
|
|
10
|
-
'db/**/*',
|
|
5
|
+
'install.rb',
|
|
6
|
+
'Rakefile', 'README', 'uninstall.rb',
|
|
7
|
+
'assets/**/*',
|
|
11
8
|
'lib/**/*',
|
|
12
|
-
'
|
|
9
|
+
'rails/**/*',
|
|
13
10
|
'test/**/*'
|
|
14
11
|
]
|
|
15
12
|
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'rake'
|
|
15
|
+
|
|
16
16
|
begin
|
|
17
17
|
require 'jeweler'
|
|
18
|
-
Jeweler::Tasks.new do |
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
18
|
+
Jeweler::Tasks.new do |s|
|
|
19
|
+
s.name = "wheels"
|
|
20
|
+
s.author = "Tyler Gannon"
|
|
21
|
+
s.email = "t--g__a--nnon@gmail.com"
|
|
22
|
+
s.homepage = "http://github.com/tylergannon/wheels"
|
|
23
|
+
s.platform = Gem::Platform::RUBY
|
|
24
|
+
s.description = "some extra stuff for rails apps"
|
|
25
|
+
s.summary = "My favorite rails goodies all in one"
|
|
26
|
+
s.files = PKG_FILES.to_a
|
|
27
|
+
s.require_path = "lib"
|
|
28
|
+
s.has_rdoc = false
|
|
29
|
+
s.extra_rdoc_files = ["README"]
|
|
31
30
|
end
|
|
31
|
+
|
|
32
32
|
Jeweler::GemcutterTasks.new
|
|
33
33
|
rescue LoadError
|
|
34
34
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
|
@@ -63,7 +63,7 @@ Rake::RDocTask.new do |rdoc|
|
|
|
63
63
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
64
64
|
|
|
65
65
|
rdoc.rdoc_dir = 'rdoc'
|
|
66
|
-
rdoc.title = "
|
|
66
|
+
rdoc.title = "da_huangs_ruby_extensions #{version}"
|
|
67
67
|
rdoc.rdoc_files.include('README*')
|
|
68
68
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
69
69
|
end
|
|
@@ -16,8 +16,8 @@ module Rails
|
|
|
16
16
|
stategies.each {|stategy| stategy.call }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def gemfile
|
|
20
|
-
File.open(File.expand_path('Gemfile',
|
|
19
|
+
def gemfile
|
|
20
|
+
File.open(File.expand_path('Gemfile', source_root)) do |gemfile|
|
|
21
21
|
while line = gemfile.readline
|
|
22
22
|
line = line.split("#").first.strip
|
|
23
23
|
if line.index('gem') == 0
|
|
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,9 @@
|
|
|
1
|
+
|
|
2
|
+
get "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "public/javascripts/jquery.js"
|
|
3
|
+
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Set default JavaScript files
|
|
8
|
+
# environment "config.action_view.javascript_expansions = { :defaults => ['jquery', 'rails'] }"
|
|
9
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/generators/{templates → wheels/templates}/haml/app/views/layouts/application.html.haml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,13 +2,11 @@ require 'rails/generators'
|
|
|
2
2
|
require 'rails/generators/migration'
|
|
3
3
|
require 'rails/generators/generated_attribute'
|
|
4
4
|
require 'rails/generators/active_record'
|
|
5
|
-
require File.join(File.dirname(__FILE__), '../core_extensions.rb')
|
|
6
5
|
|
|
7
6
|
class WheelsGenerator < Rails::Generators::Base
|
|
8
7
|
include Rails::Generators::Migration
|
|
9
8
|
require File.join(File.dirname(__FILE__), '../core_extensions.rb')
|
|
10
9
|
source_root File.expand_path('../../../../', __FILE__)
|
|
11
|
-
SOURCE_ROOT = source_root
|
|
12
10
|
desc "Installs files needed for App Template gem."
|
|
13
11
|
|
|
14
12
|
# argument :scope, :required => false, :default => nil,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Generators
|
|
3
|
+
module Actions
|
|
4
|
+
|
|
5
|
+
attr_accessor :stategies
|
|
6
|
+
attr_accessor :recipes
|
|
7
|
+
attr_reader :template_options
|
|
8
|
+
|
|
9
|
+
def initialize_templater
|
|
10
|
+
self.recipes = []
|
|
11
|
+
@stategies = []
|
|
12
|
+
@template_options = {}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def execute_stategies
|
|
16
|
+
stategies.each {|stategy| stategy.call }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def load_options
|
|
20
|
+
@template_options[:design] = ask("Which design framework? [none(default), compass]: ").downcase
|
|
21
|
+
@template_options[:design] = "none" if @template_options[:design].nil?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def recipe(name)
|
|
25
|
+
recipes << name
|
|
26
|
+
File.join File.dirname(__FILE__), 'recipes', "#{name}.rb"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# TODO: Refactor loading of files
|
|
30
|
+
|
|
31
|
+
def load_snippet(name, group)
|
|
32
|
+
path = File.expand_path name, snippet_path(group)
|
|
33
|
+
File.read path
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def load_template(name, group, match={})
|
|
37
|
+
path = File.expand_path name, template_path(group)
|
|
38
|
+
contents = File.read path
|
|
39
|
+
match.each do |key, value|
|
|
40
|
+
contents.gsub! "\%#{key.to_s}\%", value
|
|
41
|
+
end
|
|
42
|
+
contents
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def migrations
|
|
46
|
+
Dir.new('db/migrate').entries
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def have_migration?(name)
|
|
50
|
+
!migrations.select{|t| t.include? name}.empty?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def snippet_path(name)
|
|
54
|
+
File.join(File.dirname(__FILE__), 'snippets', name)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def template_path(name)
|
|
58
|
+
File.join(File.dirname(__FILE__), 'templates', name)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
File without changes
|
data/lib/wheels/base.rb
ADDED
data/lib/wheels/routes.rb
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
module ActionDispatch::Routing
|
|
2
2
|
class Mapper
|
|
3
3
|
def wheels_resources
|
|
4
|
-
resources :access_control_entries
|
|
5
|
-
|
|
6
|
-
put :sort
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
resources :app_configs do
|
|
11
|
-
member do
|
|
12
|
-
get :css
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
4
|
+
resources :access_control_entries
|
|
5
|
+
resources :app_configs
|
|
16
6
|
resources :blogs, :path=>"blog"
|
|
17
7
|
resources :external_links
|
|
18
8
|
resources :feedbacks, :path=>"feedback", :only=>[:new, :index, :create]
|
|
@@ -47,7 +37,6 @@ module ActionDispatch::Routing
|
|
|
47
37
|
end
|
|
48
38
|
end
|
|
49
39
|
|
|
50
|
-
match '/css' => 'app_configs#css'
|
|
51
40
|
match '/admin' => "sitemaps#index"
|
|
52
41
|
match "change_password" => "users#edit"
|
|
53
42
|
match "verify_password" => "users#verify", :format=>:json
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class AccessControlEntriesControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@access_control_entry = access_control_entries(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:access_control_entries)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create access_control_entry" do
|
|
20
|
+
assert_difference('AccessControlEntry.count') do
|
|
21
|
+
post :create, :access_control_entry => @access_control_entry.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to access_control_entry_path(assigns(:access_control_entry))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show access_control_entry" do
|
|
28
|
+
get :show, :id => @access_control_entry.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @access_control_entry.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update access_control_entry" do
|
|
38
|
+
put :update, :id => @access_control_entry.to_param, :access_control_entry => @access_control_entry.attributes
|
|
39
|
+
assert_redirected_to access_control_entry_path(assigns(:access_control_entry))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy access_control_entry" do
|
|
43
|
+
assert_difference('AccessControlEntry.count', -1) do
|
|
44
|
+
delete :destroy, :id => @access_control_entry.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to access_control_entries_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class AppConfigsControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@app_config = app_configs(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:app_configs)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create app_config" do
|
|
20
|
+
assert_difference('AppConfig.count') do
|
|
21
|
+
post :create, :app_config => @app_config.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to app_config_path(assigns(:app_config))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show app_config" do
|
|
28
|
+
get :show, :id => @app_config.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @app_config.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update app_config" do
|
|
38
|
+
put :update, :id => @app_config.to_param, :app_config => @app_config.attributes
|
|
39
|
+
assert_redirected_to app_config_path(assigns(:app_config))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy app_config" do
|
|
43
|
+
assert_difference('AppConfig.count', -1) do
|
|
44
|
+
delete :destroy, :id => @app_config.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to app_configs_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class DiscussionsControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@discussion = discussions(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:discussions)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create discussion" do
|
|
20
|
+
assert_difference('Discussion.count') do
|
|
21
|
+
post :create, :discussion => @discussion.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to discussion_path(assigns(:discussion))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show discussion" do
|
|
28
|
+
get :show, :id => @discussion.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @discussion.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update discussion" do
|
|
38
|
+
put :update, :id => @discussion.to_param, :discussion => @discussion.attributes
|
|
39
|
+
assert_redirected_to discussion_path(assigns(:discussion))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy discussion" do
|
|
43
|
+
assert_difference('Discussion.count', -1) do
|
|
44
|
+
delete :destroy, :id => @discussion.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to discussions_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class ExternalLinksControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@external_link = external_links(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:external_links)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create external_link" do
|
|
20
|
+
assert_difference('ExternalLink.count') do
|
|
21
|
+
post :create, :external_link => @external_link.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to external_link_path(assigns(:external_link))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show external_link" do
|
|
28
|
+
get :show, :id => @external_link.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @external_link.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update external_link" do
|
|
38
|
+
put :update, :id => @external_link.to_param, :external_link => @external_link.attributes
|
|
39
|
+
assert_redirected_to external_link_path(assigns(:external_link))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy external_link" do
|
|
43
|
+
assert_difference('ExternalLink.count', -1) do
|
|
44
|
+
delete :destroy, :id => @external_link.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to external_links_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class FeedbacksControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@feedback = feedbacks(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:feedbacks)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create feedback" do
|
|
20
|
+
assert_difference('Feedback.count') do
|
|
21
|
+
post :create, :feedback => @feedback.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to feedback_path(assigns(:feedback))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show feedback" do
|
|
28
|
+
get :show, :id => @feedback.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @feedback.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update feedback" do
|
|
38
|
+
put :update, :id => @feedback.to_param, :feedback => @feedback.attributes
|
|
39
|
+
assert_redirected_to feedback_path(assigns(:feedback))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy feedback" do
|
|
43
|
+
assert_difference('Feedback.count', -1) do
|
|
44
|
+
delete :destroy, :id => @feedback.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to feedbacks_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class ForumsControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@forum = forums(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:forums)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create forum" do
|
|
20
|
+
assert_difference('Forum.count') do
|
|
21
|
+
post :create, :forum => @forum.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to forum_path(assigns(:forum))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show forum" do
|
|
28
|
+
get :show, :id => @forum.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @forum.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update forum" do
|
|
38
|
+
put :update, :id => @forum.to_param, :forum => @forum.attributes
|
|
39
|
+
assert_redirected_to forum_path(assigns(:forum))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy forum" do
|
|
43
|
+
assert_difference('Forum.count', -1) do
|
|
44
|
+
delete :destroy, :id => @forum.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to forums_path
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class LayoutsControllerTest < ActionController::TestCase
|
|
4
|
+
setup do
|
|
5
|
+
@layout = layouts(:one)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
test "should get index" do
|
|
9
|
+
get :index
|
|
10
|
+
assert_response :success
|
|
11
|
+
assert_not_nil assigns(:layouts)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get new" do
|
|
15
|
+
get :new
|
|
16
|
+
assert_response :success
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
test "should create layout" do
|
|
20
|
+
assert_difference('Layout.count') do
|
|
21
|
+
post :create, :layout => @layout.attributes
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
assert_redirected_to layout_path(assigns(:layout))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should show layout" do
|
|
28
|
+
get :show, :id => @layout.to_param
|
|
29
|
+
assert_response :success
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
test "should get edit" do
|
|
33
|
+
get :edit, :id => @layout.to_param
|
|
34
|
+
assert_response :success
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "should update layout" do
|
|
38
|
+
put :update, :id => @layout.to_param, :layout => @layout.attributes
|
|
39
|
+
assert_redirected_to layout_path(assigns(:layout))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "should destroy layout" do
|
|
43
|
+
assert_difference('Layout.count', -1) do
|
|
44
|
+
delete :destroy, :id => @layout.to_param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
assert_redirected_to layouts_path
|
|
48
|
+
end
|
|
49
|
+
end
|