class GemHadar

def gemspec_task

gemspec file with content generated by the gemspec method.
indicating the file being written, and uses secure_write to create the
the filename based on the project name, displays a warning message
ensuring the version is set before generating the gemspec. It constructs
This method creates a :gemspec task that depends on the :version task,

gemspec file for the project.
The gemspec_task method defines a Rake task that generates and writes a
def gemspec_task
  desc 'Create a gemspec file'
  task :gemspec => :version do
    filename = "#{name}.gemspec"
    warn "Writing to #{filename.inspect} for #{version}"
    secure_write(filename, gemspec.to_ruby)
  end
end