Sha256: f7a766c64a226a9149ac6ff694042b58fb05ce743a2a474431f4bfd41e6aa6e2
Contents?: true
Size: 668 Bytes
Versions: 52
Compression:
Stored size: 668 Bytes
Contents
context = ChefCLI::Generator.context cookbook_dir = File.join(context.cookbook_root, context.cookbook_name) libraries_dir = File.join(cookbook_dir, 'libraries') helpers_path = File.join(cookbook_dir, 'libraries', "#{context.new_file_basename}.rb") directory libraries_dir def camelize(name) name.to_s.split(/[^a-zA-Z]/).map(&:capitalize).join end cookbook_class_name = camelize(context.cookbook_name) helper_class_name = "#{camelize(context.new_file_basename)}Helpers" template helpers_path do source 'helpers.rb.erb' helpers(ChefCLI::Generator::TemplateHelper) variables(cookbook_class_name: cookbook_class_name, helper_class_name: helper_class_name) end
Version data entries
52 entries across 52 versions & 1 rubygems