bin/jeckyl in jeckyl-0.3.7 vs bin/jeckyl in jeckyl-0.4.0
- old
+ new
@@ -11,11 +11,11 @@
# and in the file copyright.txt. Under the terms of this licence, all derivative works
# must themselves be licensed under the Open Software Licence v. 3.0
#
#
-require 'rubygems'
+#require 'rubygems' # not required in ruby 1.9.3 +
require 'optplus'
require 'jeckyl'
require 'jeckyl/errors'
@@ -128,21 +128,24 @@
describe "klass", "generate a simple class template"
def klass
name = next_argument_or_error("missing class name")
+ names = name.split("::")
+ mod_name = names[0]
+ class_name = names[1] || 'Config'
parent = next_argument_or('Jeckyl::Config')
puts <<EOTXT
# Simple framework for defining Jeckyl options to put into a config hash
-module #{name}
+module #{mod_name}
# configuration parameters for #{name}
#
# @see file:<PATH_TO_CONFIG_MARKDOWN_FILE> #{name} Parameter Descriptions
#
- class Config < #{parent}
+ class #{class_name} < #{parent}
def configure_a_parameter(val)
default "default"
comment "Comment line",
"more comments"
@@ -152,13 +155,17 @@
end
end
EOTXT
end
- help :klass, "Generate a simple class file as a template for defining your",
- "own parameters. You can also specify a class to inherit if you want to",
- "pick up additional parameters. Otherwise the parent will default to",
- "Jeckyl::Config. Alternatives include Jellog::Config and JerbilService::Config."
+ help :klass, " jeckyl klass <name> [<parent_class>}]",
+ "",
+ "Generate a simple class file as a template for defining your",
+ "own parameters. You can also specify a class to inherit if you want as",
+ "an additional parameter. Otherwise the parent will default to",
+ "Jeckyl::Config. Alternatives include Jellog::Config and JerbilService::Config.",
+ "Note the class name can be compound and will be split into module and class.",
+ "For example: 'Module::Class'."
describe "check", "check the given config file is valid for the given class"
def check(klass_file, conf_file)
\ No newline at end of file