jfs-generators 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +53 -3
- data/rails_generators/jfs_model/USAGE +20 -0
- metadata +2 -1
data/README.md
CHANGED
@@ -1,7 +1,57 @@
|
|
1
|
-
generators
|
2
|
-
|
1
|
+
jfs-generators
|
2
|
+
==============
|
3
|
+
|
4
|
+
My collection of Ruby on Rails generators.
|
5
|
+
|
6
|
+
|
7
|
+
Install
|
8
|
+
-------
|
9
|
+
|
10
|
+
If you have never grabbed a gem from github or you aren't sure if you have, run
|
11
|
+
the following command: (you should only have to do this once):
|
12
|
+
|
13
|
+
gem sources -a http://gems.github.com
|
14
|
+
|
15
|
+
Once you have setup GitHub as a gem source, run this command to install the gem:
|
16
|
+
|
17
|
+
sudo gem install jfs-generators
|
18
|
+
|
19
|
+
|
20
|
+
Usage
|
21
|
+
-----
|
22
|
+
|
23
|
+
Once you install the gem, the generators should be available to all Ruby on
|
24
|
+
Rails applications on your system. Run `script/generate` without any arguments
|
25
|
+
to see a list of the available generators in your environment.
|
26
|
+
|
27
|
+
To run the generator, go to your rails project directory and call it using the
|
28
|
+
`script/generate` or `script/destroy` command. For example:
|
29
|
+
|
30
|
+
script/generate jfs_model Article title:string content:text
|
31
|
+
|
32
|
+
|
33
|
+
jfs_model
|
34
|
+
---------
|
35
|
+
|
36
|
+
Stubs out a new model. Pass the model name, either CamelCased or under_scored,
|
37
|
+
and an optional list of attribute pairs as arguments. Attribute pairs are
|
38
|
+
column_name:sql_type arguments specifying the model's attributes. Timestamps are
|
39
|
+
added by default, so you don't have to specify them by hand as
|
40
|
+
`created_at:datetime updated_at:datetime`.
|
41
|
+
|
42
|
+
This generates a model class in `app/models` and a migration in `db/migrate`.
|
43
|
+
|
44
|
+
Examples:
|
45
|
+
|
46
|
+
./script/generate jfs_model Account
|
47
|
+
|
48
|
+
creates an Account model at `app/models/account.rb` and a migration at
|
49
|
+
`db/migrate/XXX_add_accounts.rb`.
|
50
|
+
|
51
|
+
./script/generate model Article title:string content:text
|
52
|
+
|
53
|
+
creates an Article model with a string title and text body.
|
3
54
|
|
4
|
-
Description goes here.
|
5
55
|
|
6
56
|
Copyright
|
7
57
|
---------
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Description:
|
2
|
+
Stubs out a new model. Pass the model name, either CamelCased or
|
3
|
+
under_scored, and an optional list of attribute pairs as arguments.
|
4
|
+
|
5
|
+
Attribute pairs are column_name:sql_type arguments specifying the
|
6
|
+
model's attributes. Timestamps are added by default, so you don't have to
|
7
|
+
specify them by hand as 'created_at:datetime updated_at:datetime'.
|
8
|
+
|
9
|
+
This generates a model class in app/models and a migration in db/migrate.
|
10
|
+
|
11
|
+
Examples:
|
12
|
+
`./script/generate jfs_model Account`
|
13
|
+
|
14
|
+
creates an Account model and migration:
|
15
|
+
Model: app/models/account.rb
|
16
|
+
Migration: db/migrate/XXX_add_accounts.rb
|
17
|
+
|
18
|
+
`./script/generate model Article title:string content:text`
|
19
|
+
|
20
|
+
creates an Article model with a string title and text body,.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jfs-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Stahl
|
@@ -24,6 +24,7 @@ extra_rdoc_files:
|
|
24
24
|
- README.md
|
25
25
|
files:
|
26
26
|
- lib/generators.rb
|
27
|
+
- rails_generators/jfs_model/USAGE
|
27
28
|
- rails_generators/jfs_model/jfs_model_generator.rb
|
28
29
|
- rails_generators/jfs_model/templates/migration.rb
|
29
30
|
- rails_generators/jfs_model/templates/model.rb
|