updating generator for Rails3.1, removing Gemfile.lock

Oleg committed May 10, 2011
commit 51148f260d7b816fd76515574f22067034fa8bd1
Showing 2 changed files with 10 additions and 91 deletions
Gemfile.lock +0 -85
@@ @@ -1,85 +0,0 @@
- GEM
- remote: http://rubygems.org/
- specs:
- abstract (1.0.0)
- actionmailer (3.0.3)
- actionpack (= 3.0.3)
- mail (~> 2.2.9)
- actionpack (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.4)
- rack (~> 1.2.1)
- rack-mount (~> 0.6.13)
- rack-test (~> 0.5.6)
- tzinfo (~> 0.3.23)
- active_link_to (0.0.7)
- activemodel (3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- i18n (~> 0.4)
- activerecord (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- arel (~> 2.0.2)
- tzinfo (~> 0.3.23)
- activeresource (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- activesupport (3.0.3)
- arel (2.0.6)
- builder (2.1.2)
- erubis (2.6.6)
- abstract (>= 1.0.0)
- git (1.2.5)
- i18n (0.5.0)
- jeweler (1.5.1)
- bundler (~> 1.0.0)
- git (>= 1.2.5)
- rake
- mail (2.2.12)
- activesupport (>= 2.3.6)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.16)
- paperclip (2.3.8)
- activerecord
- activesupport
- polyglot (0.3.1)
- rack (1.2.1)
- rack-mount (0.6.13)
- rack (>= 1.0.0)
- rack-test (0.5.6)
- rack (>= 1.0)
- rails (3.0.3)
- actionmailer (= 3.0.3)
- actionpack (= 3.0.3)
- activerecord (= 3.0.3)
- activeresource (= 3.0.3)
- activesupport (= 3.0.3)
- bundler (~> 1.0)
- railties (= 3.0.3)
- railties (3.0.3)
- actionpack (= 3.0.3)
- activesupport (= 3.0.3)
- rake (>= 0.8.7)
- thor (~> 0.14.4)
- rake (0.8.7)
- sqlite3 (1.3.3)
- thor (0.14.6)
- treetop (1.4.9)
- polyglot (>= 0.3.1)
- tzinfo (0.3.23)
-
- PLATFORMS
- ruby
-
- DEPENDENCIES
- active_link_to (>= 0.0.7)
- jeweler (>= 1.4.0)
- paperclip (>= 2.3.8)
- rails (>= 3.0.0)
- sqlite3
generators/cms_generator.rb b/lib/generators/cms_generator.rb +10 -6
@@ @@ -1,5 +1,6 @@
class CmsGenerator < Rails::Generators::Base
+ require 'rails/generators/active_record'
include Rails::Generators::Migration
include Thor::Actions
@@ @@ -22,9 +23,14 @@ class CmsGenerator < Rails::Generators::Base
end
def generate_public_assets
- directory 'public/stylesheets/comfortable_mexican_sofa', 'public/stylesheets/comfortable_mexican_sofa'
- directory 'public/javascripts/comfortable_mexican_sofa', 'public/javascripts/comfortable_mexican_sofa'
- directory 'public/images/comfortable_mexican_sofa', 'public/images/comfortable_mexican_sofa'
+ assets_dir = if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 1 && Rails.configuration.assets.enabled
+ 'app/assets'
+ else
+ 'public'
+ end
+ directory 'public/stylesheets/comfortable_mexican_sofa', "#{assets_dir}/stylesheets/comfortable_mexican_sofa"
+ directory 'public/javascripts/comfortable_mexican_sofa', "#{assets_dir}/javascripts/comfortable_mexican_sofa"
+ directory 'public/images/comfortable_mexican_sofa', "#{assets_dir}/images/comfortable_mexican_sofa"
end
def generate_cms_seeds
@@ @@ -36,9 +42,7 @@ class CmsGenerator < Rails::Generators::Base
end
def self.next_migration_number(dirname)
- orm = Rails.configuration.generators.options[:rails][:orm]
- require "rails/generators/#{orm}"
- "#{orm.to_s.camelize}::Generators::Base".constantize.next_migration_number(dirname)
+ ActiveRecord::Generators::Base.next_migration_number(dirname)
end
end
\ No newline at end of file