public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
Changed generator column delimiter from | to ,
markbates (author)
Fri Apr 18 13:19:29 -0700 2008
commit  4da6e69f7d9a0a6f3df04cc6b36e054d8ca0d26e
tree    83cec1946c6286bc1ba943332c008ac4ca2f0b7d
parent  32c6f36d70f9452eaadce39b9c351302d23dcb9f
...
1
2
3
 
 
4
5
6
...
1
 
 
2
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 * Mack now uses Erubis, http://www.kuwata-lab.com/erubis/, for it's rendering engine instead of ERB. This makes Mack even faster now! Yippie!
0
-* Added rake generate:model name=<model_name> (optional: cols=<col_1>:<col_1_type>|<col_2>:<col_2_type>) This will also create a migration for you.
0
-* Updated rake generate:migration name=<model_name> (optional: cols=<col_1>:<col_1_type>|<col_2>:<col_2_type>) This will create the proper table migration for you.
0
+* Added rake generate:model name=<model_name> (optional: cols=<col_1>:<col_1_type>,<col_2>:<col_2_type>) This will also create a migration for you.
0
+* Updated rake generate:migration name=<model_name> (optional: cols=<col_1>:<col_1_type>,<col_2>:<col_2_type>) This will create the proper table migration for you.
0
 * Updated rake generate:scaffold to use the ModelGenerator now.
0
 * ScaffoldGenerator now create input fields based on the type of columns, if any, passed in.
0
 * Overall general refactoring of the generator classes.
...
25
26
27
28
 
29
30
31
...
25
26
27
 
28
29
30
31
0
@@ -25,7 +25,7 @@ opts.parse!(ARGV)
0
 include FileUtils
0
 
0
 def mack_version
0
- "0.4.5.100"
0
+ "0.4.5.110"
0
 end
0
 
0
 def create_dir(dir)
...
81
82
83
84
 
85
86
87
...
81
82
83
 
84
85
86
87
0
@@ -81,7 +81,7 @@ module Mack
0
           cs = []
0
           cols = (param(:cols) || param(:columns))
0
           if cols
0
- cols.split("|").each do |x|
0
+ cols.split(",").each do |x|
0
               cs << Mack::Generator::ModelColumn.new(name, x)
0
             end
0
           end
...
23
24
25
26
 
27
28
29
...
23
24
25
 
26
27
28
29
0
@@ -23,7 +23,7 @@
0
 # end
0
 #
0
 # Example with columns:
0
-# rake generate:migration name=create_users cols=username:string|email_address:string|created_at:datetime|updated_at:datetime
0
+# rake generate:migration name=create_users cols=username:string,email_address:string,created_at:datetime,updated_at:datetime
0
 # If using ActiveRecord generates:
0
 # db/migrations/<number>_create_users.rb:
0
 # class CreateUsers < ActiveRecord::Migration
...
29
30
31
32
 
33
34
35
...
29
30
31
 
32
33
34
35
0
@@ -29,7 +29,7 @@
0
 # end
0
 #
0
 # Example with columns:
0
-# rake generate:model name=user cols=username:string|email_address:string|created_at:datetime|updated_at:datetime
0
+# rake generate:model name=user cols=username:string,email_address:string,created_at:datetime,updated_at:datetime
0
 # If using ActiveRecord generates:
0
 # app/models/user.rb:
0
 # class User < ActiveRecord::Base
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ class GemHelper # :nodoc:
0
     self.project = "magrathea"
0
     self.package = "mack"
0
     self.gem_name = "mack"
0
- self.version = "0.4.5.100"
0
+ self.version = "0.4.5.110"
0
   end
0
   
0
   def gem_name_with_version
...
64
65
66
67
 
68
69
70
...
90
91
92
93
 
94
95
96
...
64
65
66
 
67
68
69
70
...
90
91
92
 
93
94
95
96
0
@@ -64,7 +64,7 @@ MIG
0
   def test_generate_active_record_with_columns
0
     use_active_record do
0
       assert app_config.orm = "active_record"
0
- generate_common({"NAME" => "create_users", "cols" => "username:string|email_address:string|created_at:datetime|updated_at:datetime"})
0
+ generate_common({"NAME" => "create_users", "cols" => "username:string,email_address:string,created_at:datetime,updated_at:datetime"})
0
       mig = <<-MIG
0
 class CreateUsers < ActiveRecord::Migration
0
 
0
@@ -90,7 +90,7 @@ MIG
0
   def test_generate_data_mapper_with_columns
0
     use_data_mapper do
0
       assert app_config.orm = "data_mapper"
0
- generate_common({"NAME" => "create_users", "cols" => "username:string|email_address:string|created_at:datetime|updated_at:datetime"})
0
+ generate_common({"NAME" => "create_users", "cols" => "username:string,email_address:string,created_at:datetime,updated_at:datetime"})
0
       mig = <<-MIG
0
 class CreateUsers < DataMapper::Migration
0
 
...
32
33
34
35
 
36
37
38
...
32
33
34
 
35
36
37
38
0
@@ -32,7 +32,7 @@ class ModelGeneratorTest < Test::Unit::TestCase
0
   
0
   def test_generate_data_mapper_with_columns
0
     use_data_mapper do
0
- ModelGenerator.new("name" => "albums", "cols" => "title:string|artist_id:integer|description:text").generate
0
+ ModelGenerator.new("name" => "albums", "cols" => "title:string,artist_id:integer,description:text").generate
0
       assert File.exists?(model_loc)
0
       assert_equal dm_album_with_columns, File.open(model_loc).read
0
       assert File.exists?(migration_loc)
...
212
213
214
215
 
216
217
218
...
212
213
214
 
215
216
217
218
0
@@ -212,7 +212,7 @@ CONT
0
   private
0
   
0
   def orm_common_with_cols
0
- sg = ScaffoldGenerator.new("name" => "zoo", "cols" => "name:string|description:text")
0
+ sg = ScaffoldGenerator.new("name" => "zoo", "cols" => "name:string,description:text")
0
     sg.run
0
     File.open(File.join(MACK_CONFIG, "routes.rb")) do |f|
0
       assert_match "r.resource :zoos # Added by rake generate:scaffold name=zoo", f.read

Comments

    No one has commented yet.