cog 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cog +32 -19
- data/lib/cog/generator.rb +2 -2
- data/lib/cog/version.rb +1 -1
- metadata +3 -3
data/bin/cog
CHANGED
@@ -23,22 +23,29 @@ command :init do |c|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
desc '
|
27
|
-
arg_name 'name'
|
26
|
+
desc 'List or create generators for the current project'
|
28
27
|
command [:generator, :gen] do |c|
|
29
28
|
|
30
|
-
c.
|
31
|
-
c.arg_name 'tool_name'
|
32
|
-
c.default_value 'basic'
|
33
|
-
c.flag :tool
|
29
|
+
c.default_command :list
|
34
30
|
|
35
|
-
c.
|
36
|
-
|
37
|
-
|
31
|
+
c.desc 'List generators for the current project'
|
32
|
+
c.command :list do |sub|
|
33
|
+
sub.action do |global_options, option, args|
|
38
34
|
x = Cog::Generator.list global_options[:v]
|
39
35
|
puts x.join "\n" unless x.empty?
|
40
|
-
|
41
|
-
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
c.desc 'Create a new generator for the current project'
|
40
|
+
c.arg_name 'generator_name'
|
41
|
+
c.command :new do |sub|
|
42
|
+
|
43
|
+
sub.desc 'which tool to use to create the generator'
|
44
|
+
sub.arg_name 'tool_name'
|
45
|
+
sub.default_value 'basic'
|
46
|
+
sub.flag :tool
|
47
|
+
|
48
|
+
sub.action do |global_options, options, args|
|
42
49
|
args.each do |name|
|
43
50
|
Cog::Generator.create name, :tool => options[:tool], :verbose => global_options[:v]
|
44
51
|
end
|
@@ -46,18 +53,24 @@ command [:generator, :gen] do |c|
|
|
46
53
|
end
|
47
54
|
end
|
48
55
|
|
49
|
-
desc '
|
50
|
-
arg_name 'name'
|
56
|
+
desc 'List or create DSLs known as cog tools'
|
51
57
|
skips_pre
|
52
58
|
command :tool do |c|
|
53
|
-
|
54
|
-
c.
|
55
|
-
|
56
|
-
|
59
|
+
|
60
|
+
c.default_command :list
|
61
|
+
|
62
|
+
c.desc 'List the available tools'
|
63
|
+
c.command :list do |sub|
|
64
|
+
sub.action do |global_options, options, args|
|
57
65
|
x = Cog::Tool.list global_options[:v]
|
58
66
|
puts x.join "\n" unless x.empty?
|
59
|
-
|
60
|
-
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
c.desc 'Create a new tool'
|
71
|
+
c.arg_name 'tool_name'
|
72
|
+
c.command :new do |sub|
|
73
|
+
sub.action do |global_options, options, args|
|
61
74
|
args.each do |name|
|
62
75
|
Cog::Tool.create name
|
63
76
|
end
|
data/lib/cog/generator.rb
CHANGED
@@ -132,7 +132,7 @@ module Cog
|
|
132
132
|
def copy_if_missing(src, dest)
|
133
133
|
unless File.exists? dest
|
134
134
|
FileUtils.cp src, dest
|
135
|
-
STDOUT.write "Created #{dest}\n".color(:
|
135
|
+
STDOUT.write "Created #{dest}\n".color(:green)
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
@@ -141,7 +141,7 @@ module Cog
|
|
141
141
|
path = File.join path_components
|
142
142
|
unless File.exists? path
|
143
143
|
FileUtils.mkdir_p path
|
144
|
-
STDOUT.write "Created #{path}\n".color(:
|
144
|
+
STDOUT.write "Created #{path}\n".color(:green)
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
data/lib/cog/version.rb
CHANGED
metadata
CHANGED