    # File lib/chef/knife/cookbook_create.rb, line 238
          def create_metadata(dir, cookbook_name, copyright, email, license)
            msg("** Creating metadata for cookbook: #{cookbook_name}")

            license_name = case license
                           when "apachev2"
                             "Apache 2.0"
                           when "gplv2"
                             "GNU Public License 2.0"
                           when "gplv3"
                             "GNU Public License 3.0"
                           when "mit"
                             "MIT"
                           when "none"
                             "All rights reserved"
                           end

            unless File.exists?(File.join(dir, cookbook_name, "metadata.rb"))
              open(File.join(dir, cookbook_name, "metadata.rb"), "w") do |file|
                if File.exists?(File.join(dir, cookbook_name, "README.#{config[:readme_format]}"))
                  long_description = "long_description IO.read(File.join(File.dirname(__FILE__), 'README.#{config[:readme_format]}'))"
                end
                file.puts "maintainer       \"\#{copyright}\"\nmaintainer_email \"\#{email}\"\nlicense          \"\#{license_name}\"\ndescription      \"Installs/Configures \#{cookbook_name}\"\n\#{long_description}\nversion          \"0.0.1\"\n"
              end
            end
          end