Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add cli option to gen a sample file

  • Loading branch information...
commit 7e154afeb4d31e0dd61678066ea7fab66b9a98c6 1 parent 6a48d48
@schacon schacon authored
Showing with 27 additions and 0 deletions.
  1. +10 −0 bin/cm
  2. +17 −0 lib/docurium/cli.rb
View
10 bin/cm
@@ -19,6 +19,16 @@ command :doc do |c|
end
end
+desc 'Generate Docurium config file template'
+long_desc 'Generate Docurium config file template'
+command :gen do |c|
+ c.action do |global_options,options,args|
+ file = args.first || 'api.docurium'
+ Docurium::CLI.gen(file)
+ end
+end
+
+
pre { |global,command,options,args| true }
post { |global,command,options,args| true }
View
17 lib/docurium/cli.rb
@@ -6,5 +6,22 @@ def self.doc(idir, options)
doc.generate_docs
end
+ def self.gen(file)
+
+temp = <<-TEMPLATE
+{
+ "name": "project",
+ "github": "user/project",
+ "input": "include/lib",
+ "prefix": "lib_",
+ "output": "docs"
+}
+TEMPLATE
+ puts "Writing to #{file}"
+ File.open(file, 'w+') do |f|
+ f.write(temp)
+ end
+ end
+
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.