codeigniter-scaffold 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +9 -0
- data/README.rdoc +9 -0
- data/codeigniter-scaffold.gemspec +1 -1
- data/lib/codeigniter_scaffold/command/scaffold.rb +16 -9
- metadata +1 -1
data/README
CHANGED
@@ -9,6 +9,15 @@ Simple scaffold generator for codeigniter 2.1.
|
|
9
9
|
-i, --init unzip a codeigniter 2.1.2 installaion in the current dir
|
10
10
|
-s, --scaffold <model-name> field1:string, field2:text field3:integer, and so on..
|
11
11
|
|
12
|
+
== Pre-setup
|
13
|
+
|
14
|
+
1. After running 'codeigniter-scaffold --init':
|
15
|
+
* Open 'application/config/config.php' and set-up the 'base_url' property;
|
16
|
+
* Open 'application/config/database.php' and set-up your database settings;
|
17
|
+
2. After running 'codeigniter-scaffold --scaffold [options...]'
|
18
|
+
* Go to 'application/migrations' and run the generated script into your database;
|
19
|
+
3. Have fun =)
|
20
|
+
|
12
21
|
== Contributing to codeigniter-scaffold
|
13
22
|
|
14
23
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/README.rdoc
CHANGED
@@ -9,6 +9,15 @@ Simple scaffold generator for codeigniter 2.1.
|
|
9
9
|
-i, --init unzip a codeigniter 2.1.2 installaion in the current dir
|
10
10
|
-s, --scaffold <model-name> field1:string, field2:text field3:integer, and so on..
|
11
11
|
|
12
|
+
== Pre-setup
|
13
|
+
|
14
|
+
1. After running 'codeigniter-scaffold --init':
|
15
|
+
* Open 'application/config/config.php' and set-up the 'base_url' property;
|
16
|
+
* Open 'application/config/database.php' and set-up your database settings;
|
17
|
+
2. After running 'codeigniter-scaffold --scaffold [options...]'
|
18
|
+
* Go to 'application/migrations' and run the generated script into your database;
|
19
|
+
3. Have fun =)
|
20
|
+
|
12
21
|
== Contributing to codeigniter-scaffold
|
13
22
|
|
14
23
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
@@ -4,16 +4,23 @@ module CodeigniterScaffold
|
|
4
4
|
|
5
5
|
attr_accessor :model, :attributes
|
6
6
|
|
7
|
+
ARGS_ARE_NEEDED = "Some arguments are needed, please, try again."
|
8
|
+
ARGS_WRONG = "Something goes wrong! Aborting."
|
9
|
+
|
7
10
|
def run(args)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
begin
|
12
|
+
return Kernel.puts(ARGS_ARE_NEEDED) unless valid?(args)
|
13
|
+
parse(args)
|
14
|
+
|
15
|
+
create("controller.php","application/controllers/#{@model.downcase}.php")
|
16
|
+
create("model.php","application/models/#{@model.downcase}_model.php")
|
17
|
+
create("migration.sql","application/migrations/create_#{@model.downcase}.sql")
|
18
|
+
mkdir ("application/views/#{@model.downcase}")
|
19
|
+
create("view_create.php","application/views/#{@model.downcase}/create.php")
|
20
|
+
create("view_index.php","application/views/#{@model.downcase}/index.php")
|
21
|
+
rescue
|
22
|
+
return Kernel.puts(ARGS_WRONG)
|
23
|
+
end
|
17
24
|
end
|
18
25
|
|
19
26
|
protected
|