class Hoe

def define_spec

def define_spec
  self.spec = Gem::Specification.new do |s|
    dirs = Dir["lib"]
    manifest = read_manifest
    abort [
           "Manifest is missing or couldn't be read.",
           "The Manifest is kind of a big deal.",
           "Maybe you're using a gem packaged by a linux project.",
           "It seems like they enjoy breaking other people's code.",
           ].join "\n" unless manifest
    s.name                 = name
    s.version              = version if version
    s.summary              = summary
    s.email                = email
    s.homepage             = homepage || urls["home"] || urls.values.first
    s.description          = description
    s.files                = manifest
    s.bindir               = bindir || "bin"
    s.executables          = s.files.grep(/^#{s.bindir}/) { |f| File.basename(f) }
    s.require_paths        = dirs unless dirs.empty?
    s.rdoc_options         = ["--main", readme_file]
    s.post_install_message = post_install_message
    s.metadata             = (urls.keys & URLS_TO_META_MAP.keys).map { |name|
      [URLS_TO_META_MAP[name], urls[name]]
    }.to_h if urls
    missing "Manifest.txt" if s.files.empty?
    case author
    when Array
      s.authors = author
    else
      s.author  = author
    end
    s.extra_rdoc_files += s.files.grep(/\.(txt|rdoc|md)$/)
    s.extra_rdoc_files.reject! { |f| f =~ %r%^(test|spec|vendor|template|data|tmp)/% }
    s.extra_rdoc_files += @extra_rdoc_files
  end
  check_for_version
  if licenses.empty?
    warn "Defaulting gemspec to MIT license."
    warn "Call license in hoe spec to change."
    license "MIT"
  end
  spec.licenses = licenses
  run_spec_extras
end