Class: Bozo::Tools::OpenCover

Inherits:
Object
  • Object
show all
Defined in:
lib/bozo/tools/opencover.rb

Instance Method Summary collapse

Constructor Details

#initializeOpenCover

Creates a new instance.



8
9
10
# File 'lib/bozo/tools/opencover.rb', line 8

def initialize
  @url = 'https://github.com/OpenCover/opencover/releases/download/4.6.166/opencover.4.6.166.zip'
end

Instance Method Details

#retrieve(destination_path) ⇒ Object

Retreives the OpenCover tool exe from the path



21
22
23
24
25
26
27
28
29
# File 'lib/bozo/tools/opencover.rb', line 21

def retrieve(destination_path)
  zip_file_path = download_path('opencover.4.6.166.zip')

  open(zip_file_path, 'wb') do |file|
    file << open(@url).read
  end

  extract_zip(zip_file_path, destination_path)
end

#source(url) ⇒ Object

Sets the source url for the nuget tool to be retreived from

Parameters:

  • url (String)

    A web server hosting the OpenCover tool



16
17
18
# File 'lib/bozo/tools/opencover.rb', line 16

def source(url)
  @url = url
end