codeigniter-scaffold 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "codeigniter-scaffold"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jribeiro"]
@@ -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
- return Kernel.puts("Some arguments are needed, please, try again.") if not valid?(args)
9
- parse(args)
10
-
11
- create("controller.php","application/controllers/#{@model.downcase}.php")
12
- create("model.php","application/models/#{@model.downcase}_model.php")
13
- create("migration.sql","application/migrations/create_#{@model.downcase}.sql")
14
- mkdir ("application/views/#{@model.downcase}")
15
- create("view_create.php","application/views/#{@model.downcase}/create.php")
16
- create("view_index.php","application/views/#{@model.downcase}/index.php")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeigniter-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: