gengen 1.0.1 → 1.1.0
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 +22 -4
- data/bin/gengen +2 -0
- data/lib/gengen.rb +9 -3
- data/lib/gengen/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -10,19 +10,37 @@ A simple generator using github repository.
|
|
10
10
|
|
11
11
|
From github:
|
12
12
|
|
13
|
-
gengen user/template [
|
13
|
+
$ gengen user/template [directory] [foo=bar ...]
|
14
14
|
|
15
15
|
↓
|
16
16
|
|
17
|
-
gengen jugyo/sublime-plugin RubyUtils name=RubyUtils command=test
|
17
|
+
$ gengen jugyo/sublime-plugin RubyUtils name=RubyUtils command=test
|
18
18
|
|
19
19
|
From local git repository:
|
20
20
|
|
21
|
-
gengen --local(-l) git_repository_path [
|
21
|
+
$ gengen --local(-l) git_repository_path [directory] [foo=bar ...]
|
22
22
|
|
23
23
|
↓
|
24
24
|
|
25
|
-
gengen -l /path/to/sublime-plugin RubyUtils name=RubyUtils command=test
|
25
|
+
$ gengen -l /path/to/sublime-plugin RubyUtils name=RubyUtils command=test
|
26
|
+
|
27
|
+
## Creating Template
|
28
|
+
|
29
|
+
It is simple. You can embed variables to template using `{{{var}}}`:
|
30
|
+
|
31
|
+
import sublime, sublime_plugin
|
32
|
+
|
33
|
+
class {{{name}}}Command(sublime_plugin.TextCommand):
|
34
|
+
def run(self, edit):
|
35
|
+
sublime.message_dialog("foo")
|
36
|
+
|
37
|
+
You can also embed variables in file name:
|
38
|
+
|
39
|
+
{{{name}}}.py
|
40
|
+
|
41
|
+
## Example Templates
|
42
|
+
|
43
|
+
* [sublime-plugin.gengen](https://github.com/jugyo/sublime-plugin.gengen)
|
26
44
|
|
27
45
|
## Contributing
|
28
46
|
|
data/bin/gengen
CHANGED
data/lib/gengen.rb
CHANGED
@@ -24,7 +24,13 @@ module GenGen
|
|
24
24
|
git_url = "https://github.com/#{github_project}.git"
|
25
25
|
end
|
26
26
|
|
27
|
-
dest_dir = args[1]
|
27
|
+
dest_dir = if args[1]
|
28
|
+
args[1]
|
29
|
+
else
|
30
|
+
print "[directory]: "
|
31
|
+
STDIN.gets.strip
|
32
|
+
end
|
33
|
+
|
28
34
|
if File.exists?(dest_dir)
|
29
35
|
abort "[error] '#{dest_dir}' already exists"
|
30
36
|
end
|
@@ -38,8 +44,8 @@ module GenGen
|
|
38
44
|
def usage!
|
39
45
|
abort <<-D
|
40
46
|
Usage:
|
41
|
-
gengen user/template [
|
42
|
-
gengen --local(-l) git_repository_path [
|
47
|
+
gengen user/template [directory] [foo=bar ...]
|
48
|
+
gengen --local(-l) git_repository_path [directory] [foo=bar ...]
|
43
49
|
|
44
50
|
Examples:
|
45
51
|
gengen jugyo/sublime-plugin RubyUtils name=RubyUtils command=test
|
data/lib/gengen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gengen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
segments:
|
98
98
|
- 0
|
99
|
-
hash:
|
99
|
+
hash: 3888258563139443196
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|
@@ -105,10 +105,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
segments:
|
107
107
|
- 0
|
108
|
-
hash:
|
108
|
+
hash: 3888258563139443196
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.8.
|
111
|
+
rubygems_version: 1.8.24
|
112
112
|
signing_key:
|
113
113
|
specification_version: 3
|
114
114
|
summary: A simple generator
|