gn 0.0.1 → 0.0.1.1
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.md +59 -28
- metadata +3 -3
data/Readme.md
CHANGED
@@ -2,50 +2,81 @@
|
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
5
|
-
gn is the simplest file/folder/structure/whatever generator you could
|
5
|
+
gn is the simplest file/folder/structure/whatever generator you could
|
6
|
+
ever find.
|
6
7
|
|
7
8
|
## Usage
|
8
9
|
|
9
|
-
Say you want to generate always a typical README file, like this
|
10
|
+
Say you want to generate always a typical `README` file, like this
|
11
|
+
one, you should do the following:
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
Create a folder `readme` on your current folder and add an `init.rb`
|
14
|
+
with the following content:
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def name
|
18
|
-
"CHANGEME"
|
19
|
-
end
|
16
|
+
```ruby
|
17
|
+
module Plan
|
18
|
+
module Readme
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
20
|
+
def name
|
21
|
+
"CHANGEME"
|
22
|
+
end
|
26
23
|
|
27
|
-
|
24
|
+
def destination
|
25
|
+
"readme"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
```
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
+
Create a `readme/templates` folder and add the template for your
|
32
|
+
README files:
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
```
|
35
|
+
mkdir readme/templates
|
36
|
+
touch readme/templates/readme.mote
|
37
|
+
```
|
34
38
|
|
35
|
-
|
39
|
+
For example, add the following to the template:
|
36
40
|
|
37
|
-
|
41
|
+
```markdown
|
42
|
+
# {{name}}
|
38
43
|
|
39
|
-
|
40
|
-
|
41
|
-
|
44
|
+
Copyright (c) 2012 Lucas Florio
|
45
|
+
```
|
46
|
+
|
47
|
+
Templates are rendered using [`mote`](http://soveran.github.com/mote),
|
48
|
+
the minimalist template engine. In `mote` variable interpolation is
|
49
|
+
done by using the `{{variable}}` syntax, as shown in the example
|
50
|
+
above. Variable names are extracted from the current context, in this
|
51
|
+
case the `Plan::Readme` module.
|
52
|
+
|
53
|
+
Then run the generator like this:
|
54
|
+
|
55
|
+
```
|
56
|
+
gn readme
|
57
|
+
```
|
58
|
+
|
59
|
+
Now your default `$EDITOR` will pop open with a copy of your `init.rb`
|
60
|
+
file, ready to be updated if necessary. **Note that your original
|
61
|
+
`init.rb` file won't be modified**.
|
62
|
+
|
63
|
+
Close your editor and done! Your `gn` generated `README` file will be
|
64
|
+
placed in your current directory.
|
42
65
|
|
43
66
|
## Other usages
|
44
67
|
|
45
|
-
You can use gn to generate different things. In our case, we design it
|
68
|
+
You can use gn to generate different things. In our case, we design it
|
69
|
+
so we could generate basic crud/scaffolds for
|
70
|
+
[Cuba](http://soveran.github.com/cuba), but you could use it for
|
71
|
+
whatever you want.
|
46
72
|
|
47
|
-
See the folder named examples for some ideas.
|
73
|
+
See the folder named examples for some ideas.
|
48
74
|
|
49
75
|
## Installation
|
50
76
|
|
51
|
-
|
77
|
+
```
|
78
|
+
gem install gn
|
79
|
+
```
|
80
|
+
|
81
|
+
Given that `gn` is still in development process, you should add
|
82
|
+
`--pre` to your `gem install`.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
4
|
+
version: 0.0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ date: 2012-06-02 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: mote
|
18
|
-
requirement: &
|
18
|
+
requirement: &70117254417960 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70117254417960
|
27
27
|
description: Simple Generator for the masses
|
28
28
|
email:
|
29
29
|
- lucasefe@gmail.com
|