def update_tasks_task
      require 'net/https'
      require 'uri'
      
      uri = URI.parse('https://raw.github.com/wvanbergen/github-gem/master/tasks/github-gem.rake')
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      response = http.request(Net::HTTP::Get.new(uri.path))

      if Net::HTTPSuccess === response
        open(__FILE__, "w") { |file| file.write(response.body) }
        relative_file = File.expand_path(__FILE__).sub(%r[^#{@root_dir}/], '')
        if `#{git} ls-files -m #{relative_file}`.split("\n").any?
          sh git, 'add', relative_file
          sh git, 'commit', '-m', "Updated to latest gem release management tasks."
        else
          puts "Release managament tasks already are at the latest version."
        end
      else
        raise "Download failed with HTTP status #{response.code}!"
      end
    end
def update_tasks_task
      require 'net/https'
      require 'uri'
      
      uri = URI.parse('https://raw.github.com/wvanbergen/github-gem/master/tasks/github-gem.rake')
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      response = http.request(Net::HTTP::Get.new(uri.path))

      if Net::HTTPSuccess === response
        open(__FILE__, "w") { |file| file.write(response.body) }
        relative_file = File.expand_path(__FILE__).sub(%r[^#{@root_dir}/], '')
        if `#{git} ls-files -m #{relative_file}`.split("\n").any?
          sh git, 'add', relative_file
          sh git, 'commit', '-m', "Updated to latest gem release management tasks."
        else
          puts "Release managament tasks already are at the latest version."
        end
      else
        raise "Download failed with HTTP status #{response.code}!"
      end
    end
Updates the tasks file using the latest file found on Github