0
+ camel_cased_word = self.dup
0
+ camel_cased_word.to_s.gsub(/::/, '/').
0
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
0
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
0
@@ -32,8 +38,7 @@ class Genosaurus
0
raise ::ArgumentError.new("The required parameter '#{p.to_s.upcase}' is missing for this generator!") unless param(p)
0
@generator_name = self.class.name
0
- @generator_name_underscore = String::Style.underscore(@generator_name)#.underscore
0
- puts "@generator_name_underscore: #{@generator_name_underscore}"
0
+ @generator_name_underscore = @generator_name.underscore #String::Style.underscore(@generator_name)#.underscore
0
@templates_directory_path = nil
0
@@ -83,28 +88,25 @@ class Genosaurus
0
# with ERB and returned. If there is not manifest.yml then an implied manifest is generated from the contents
0
# of the templates_directory_path.
0
- if File.exists?(manifest_path)
0
- # run using the yml file
0
- template = ERB.new(File.open(manifest_path).read, nil, "->")
0
- man = YAML.load(template.result(binding))
0
- files = Dir.glob(File.join(templates_directory_path, "**/*.template"))
0
- files.each_with_index do |f, i|
0
- output_path = f.gsub(templates_directory_path, "")
0
- output_path.gsub!(".template", "")
0
- output_path.gsub!(/^\//, "")
0
- man["template_#{i+1}"] = {
0
- "type" => File.directory?(f) ? "directory" : "file",
0
- "output_path" => Erubis::Eruby.new(output_path, :pattern => '% %').result(binding)
0
+ if File.exists?(manifest_path)
0
+ # run using the yml file
0
+ template = ERB.new(File.open(manifest_path).read, nil, "->")
0
+ man = YAML.load(template.result(binding))
0
+ files = Dir.glob(File.join(templates_directory_path, "**/*.template"))
0
+ files.each_with_index do |f, i|
0
+ output_path = f.gsub(templates_directory_path, "")
0
+ output_path.gsub!(".template", "")
0
+ output_path.gsub!(/^\//, "")
0
+ man["template_#{i+1}"] = {
0
+ "type" => File.directory?(f) ? "directory" : "file",
0
+ "output_path" => Erubis::Eruby.new(output_path, :pattern => '% %').result(binding)
0
# Used to define arguments that are required by the generator.
Comments
No one has commented yet.