generator working
Oleg
committed Feb 07, 2012
commit acd8a3dace15a0d3d2ddb7145477f3297cdb5022
Showing 3
changed files with
67 additions
and 61 deletions
app/views/layouts/cms_admin/_body.html.erb
+1
-1
| @@ | @@ -13,7 +13,7 @@ |
| <div class='center_column'> | |
| <%= render :partial => 'layouts/cms_admin/center' %> | |
| <div class='sofa'> | |
| - | <a href='https://github.com/comfy/comfortable-mexican-sofa' target='_blank'>ComfortableMexicanSofa</a> |
| + | <a href='https://github.com/comfy' target='_blank'>ComfortableMexicanSofa</a> |
| <span class='version'><%= ComfortableMexicanSofa::VERSION %></span> | |
| </div> | |
| </div> | |
comfortable_mexican_sofa.gemspec
+5
-3
| @@ | @@ -9,7 +9,7 @@ Gem::Specification.new do |s| |
| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | |
| s.authors = ["Oleg Khabarov", "The Working Group Inc"] | |
| - | s.date = "2012-02-02" |
| + | s.date = "2012-02-07" |
| s.description = "" | |
| s.email = "oleg@theworkinggroup.ca" | |
| s.extra_rdoc_files = [ | |
| @@ | @@ -50,6 +50,7 @@ Gem::Specification.new do |s| |
| "app/assets/images/comfortable_mexican_sofa/elrte/smileys/unhappy.png", | |
| "app/assets/images/comfortable_mexican_sofa/elrte/smileys/waii.png", | |
| "app/assets/images/comfortable_mexican_sofa/elrte/smileys/wink.png", | |
| + | "app/assets/images/comfortable_mexican_sofa/icon_draft.gif", |
| "app/assets/images/comfortable_mexican_sofa/icon_layout.gif", | |
| "app/assets/images/comfortable_mexican_sofa/icon_move.gif", | |
| "app/assets/images/comfortable_mexican_sofa/icon_regular.gif", | |
| @@ | @@ -68,6 +69,7 @@ Gem::Specification.new do |s| |
| "app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_454545_256x240.png", | |
| "app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_888888_256x240.png", | |
| "app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_cd0a0a_256x240.png", | |
| + | "app/assets/images/comfortable_mexican_sofa/nav_arrow.png", |
| "app/assets/images/comfortable_mexican_sofa/x.png", | |
| "app/assets/javascripts/comfortable_mexican_sofa/application.js", | |
| "app/assets/javascripts/comfortable_mexican_sofa/codemirror/codemirror.js", | |
| @@ | @@ -237,8 +239,8 @@ Gem::Specification.new do |s| |
| "lib/comfortable_mexican_sofa/version.rb", | |
| "lib/comfortable_mexican_sofa/view_hooks.rb", | |
| "lib/comfortable_mexican_sofa/view_methods.rb", | |
| - | "lib/generators/README", |
| - | "lib/generators/cms_generator.rb", |
| + | "lib/generators/comfy/cms/README", |
| + | "lib/generators/comfy/cms/cms_generator.rb", |
| "lib/tasks/comfortable_mexican_sofa.rake", | |
| "rvmrc.example", | |
| "script/rails", | |
generators/comfy/cms/cms_generator.rb b/lib/generators/comfy/cms/cms_generator.rb
+61
-57
| @@ | @@ -1,60 +1,64 @@ |
| - | class CmsGenerator < Rails::Generators::Base |
| - | |
| - | require 'rails/generators/active_record' |
| - | include Rails::Generators::Migration |
| - | include Thor::Actions |
| - | |
| - | source_root File.expand_path('../../../../..', __FILE__) |
| - | |
| - | def generate_migration |
| - | destination = File.expand_path('db/migrate/01_create_cms.rb', self.destination_root) |
| - | migration_dir = File.dirname(destination) |
| - | destination = self.class.migration_exists?(migration_dir, 'create_cms') |
| - | |
| - | if destination |
| - | puts "\e[0m\e[31mFound existing cms_create.rb migration. Remove it if you want to regenerate.\e[0m" |
| - | else |
| - | migration_template 'db/migrate/01_create_cms.rb', 'db/migrate/create_cms.rb' |
| + | module Comfy |
| + | module Generators |
| + | class CmsGenerator < Rails::Generators::Base |
| + | |
| + | require 'rails/generators/active_record' |
| + | include Rails::Generators::Migration |
| + | include Thor::Actions |
| + | |
| + | source_root File.expand_path('../../../../..', __FILE__) |
| + | |
| + | def generate_migration |
| + | destination = File.expand_path('db/migrate/01_create_cms.rb', self.destination_root) |
| + | migration_dir = File.dirname(destination) |
| + | destination = self.class.migration_exists?(migration_dir, 'create_cms') |
| + | |
| + | if destination |
| + | puts "\e[0m\e[31mFound existing cms_create.rb migration. Remove it if you want to regenerate.\e[0m" |
| + | else |
| + | migration_template 'db/migrate/01_create_cms.rb', 'db/migrate/create_cms.rb' |
| + | end |
| + | end |
| + | |
| + | def generate_initialization |
| + | copy_file 'config/initializers/comfortable_mexican_sofa.rb', |
| + | 'config/initializers/comfortable_mexican_sofa.rb' |
| + | end |
| + | |
| + | def generate_public_assets |
| + | return if ComfortableMexicanSofa.asset_pipeline_enabled? |
| + | directory 'app/assets/stylesheets/comfortable_mexican_sofa', |
| + | 'public/stylesheets/comfortable_mexican_sofa' |
| + | directory 'app/assets/javascripts/comfortable_mexican_sofa', |
| + | 'public/javascripts/comfortable_mexican_sofa' |
| + | directory 'app/assets/images/comfortable_mexican_sofa', |
| + | 'public/images/comfortable_mexican_sofa' |
| + | |
| + | files_to_be_changed = [ |
| + | 'public/stylesheets/comfortable_mexican_sofa/content.css', |
| + | 'public/stylesheets/comfortable_mexican_sofa/widgets.css', |
| + | 'public/stylesheets/comfortable_mexican_sofa/jquery_ui.css', |
| + | 'public/stylesheets/comfortable_mexican_sofa/elrte.css', |
| + | 'public/stylesheets/comfortable_mexican_sofa/files.css' |
| + | ] |
| + | |
| + | files_to_be_changed.each do |file_path| |
| + | gsub_file file_path, '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/' |
| + | end |
| + | end |
| + | |
| + | def generate_cms_seeds |
| + | directory 'db/cms_fixtures', 'db/cms_fixtures' |
| + | end |
| + | |
| + | def show_readme |
| + | readme 'lib/generators/comfy/cms/README' |
| + | end |
| + | |
| + | def self.next_migration_number(dirname) |
| + | ActiveRecord::Generators::Base.next_migration_number(dirname) |
| + | end |
| + | |
| end | |
| end | |
| - | |
| - | def generate_initialization |
| - | copy_file 'config/initializers/comfortable_mexican_sofa.rb', |
| - | 'config/initializers/comfortable_mexican_sofa.rb' |
| - | end |
| - | |
| - | def generate_public_assets |
| - | return if ComfortableMexicanSofa.asset_pipeline_enabled? |
| - | directory 'app/assets/stylesheets/comfortable_mexican_sofa', |
| - | 'public/stylesheets/comfortable_mexican_sofa' |
| - | directory 'app/assets/javascripts/comfortable_mexican_sofa', |
| - | 'public/javascripts/comfortable_mexican_sofa' |
| - | directory 'app/assets/images/comfortable_mexican_sofa', |
| - | 'public/images/comfortable_mexican_sofa' |
| - | |
| - | files_to_be_changed = [ |
| - | 'public/stylesheets/comfortable_mexican_sofa/content.css', |
| - | 'public/stylesheets/comfortable_mexican_sofa/widgets.css', |
| - | 'public/stylesheets/comfortable_mexican_sofa/jquery_ui.css', |
| - | 'public/stylesheets/comfortable_mexican_sofa/elrte.css', |
| - | 'public/stylesheets/comfortable_mexican_sofa/files.css' |
| - | ] |
| - | |
| - | files_to_be_changed.each do |file_path| |
| - | gsub_file file_path, '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/' |
| - | end |
| - | end |
| - | |
| - | def generate_cms_seeds |
| - | directory 'db/cms_fixtures', 'db/cms_fixtures' |
| - | end |
| - | |
| - | def show_readme |
| - | readme 'lib/generators/comfy/cms/README' |
| - | end |
| - | |
| - | def self.next_migration_number(dirname) |
| - | ActiveRecord::Generators::Base.next_migration_number(dirname) |
| - | end |
| - | |
| end | |
| \ No newline at end of file | |