Skip to content

Commit

Permalink
Merge branch 'master' of github.com:padrino/padrino-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed Nov 7, 2010
2 parents b4e79e2 + 9deacd9 commit 2b1221e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions padrino-admin/lib/padrino-admin/generators/orm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def initialize(name, orm, columns=nil, column_fields=nil)
end

def field_type(type)
type = :string if type.nil? #Couchrest-Hack to avoid the next line to fail
type = type.to_s.demodulize.downcase.to_sym unless type.is_a?(Symbol)
case type
when :integer, :float, :decimal then :text_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ def setup_orm
when 'mysql'
ar.gsub! /!DB_DEVELOPMENT!/, MYSQL.gsub(/!DB_NAME!/,"\"#{db}_development\"")
ar.gsub! /!DB_PRODUCTION!/, MYSQL.gsub(/!DB_NAME!/,"\"#{db}_production\"")
ar.gsub! /!DB_TEST/, MYSQL.gsub(/!DB_NAME!/,"\"#{db}_test\"")
ar.gsub! /!DB_TEST!/, MYSQL.gsub(/!DB_NAME!/,"\"#{db}_test\"")
require_dependencies 'mysql'
when 'mysql2'
ar.gsub! /!DB_DEVELOPMENT!/, MYSQL2.gsub(/!DB_NAME!/,"\"#{db}_development\"")
ar.gsub! /!DB_PRODUCTION!/, MYSQL2.gsub(/!DB_NAME!/,"\"#{db}_production\"")
ar.gsub! /!DB_TEST/, MYSQL2.gsub(/!DB_NAME!/,"\"#{db}_test\"")
ar.gsub! /!DB_TEST!/, MYSQL2.gsub(/!DB_NAME!/,"\"#{db}_test\"")
require_dependencies 'mysql2'
when 'postgres'
ar.gsub! /!DB_DEVELOPMENT!/, POSTGRES.gsub(/!DB_NAME!/,"\"#{db}_development\"")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

def setup_orm
require_dependencies 'couchrest'
require_dependencies 'couchrest_extended_document'
require_dependencies 'json_pure'
create_file("config/database.rb", COUCHREST.gsub(/!NAME!/, @app_name.underscore))
empty_directory('app/models')
Expand Down
14 changes: 7 additions & 7 deletions padrino-gen/lib/padrino-gen/generators/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def self.banner; "padrino-gen project [name] [options]"; end

argument :name, :desc => "The name of your padrino project"

class_option :app , :desc => "The application name", :aliases => '-n', :default => nil, :type => :string
class_option :bundle, :desc => "Run bundle install", :aliases => '-b', :default => false, :type => :boolean
class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
class_option :dev, :desc => "Use padrino from a git checkout", :default => false, :type => :boolean
class_option :tiny, :desc => "Generate tiny app skeleton", :aliases => '-i', :default => false, :type => :boolean
class_option :adapter, :desc => "SQL adapter for ORM (sqlite, mysql, postgres)", :aliases => '-a', :default => "sqlite", :type => :string
class_option :template, :desc => "Generate project from template", :aliases => '-p', :default => nil, :type => :string
class_option :app , :desc => "The application name", :aliases => '-n', :default => nil, :type => :string
class_option :bundle, :desc => "Run bundle install", :aliases => '-b', :default => false, :type => :boolean
class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
class_option :dev, :desc => "Use padrino from a git checkout", :default => false, :type => :boolean
class_option :tiny, :desc => "Generate tiny app skeleton", :aliases => '-i', :default => false, :type => :boolean
class_option :adapter, :desc => "SQL adapter for ORM (sqlite, mysql, mysql2, postgres)", :aliases => '-a', :default => "sqlite", :type => :string
class_option :template, :desc => "Generate project from template", :aliases => '-p', :default => nil, :type => :string

# Definitions for the available customizable components
component_option :orm, "database engine", :aliases => '-d', :choices => [:activerecord, :datamapper, :mongomapper, :mongoid, :sequel, :couchrest, :ohm, :mongomatic], :default => :none
Expand Down

0 comments on commit 2b1221e

Please sign in to comment.