Class: Albacore::Cli
Instance Method Summary collapse
- #download_paket ⇒ Object
- #download_tool(uri, file_name) ⇒ Object
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
Methods included from CliDSL
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
10 11 12 13 14 15 |
# File 'lib/albacore/cli.rb', line 10 def initialize args # Run a semver command. Raise a CommandError if the command does not exist. # Expects an array of commands, such as ARGV. @args = args run_command(@args.shift || :help) end |
Instance Method Details
#download_paket ⇒ Object
193 194 195 |
# File 'lib/albacore/cli.rb', line 193 def download_paket download_tool 'https://github.com/fsprojects/Paket/releases/download/0.16.2/paket.bootstrapper.exe', 'paket.bootstrapper.exe' unless File.exists? './tools/paket.bootstrapper.exe' end |
#download_tool(uri, file_name) ⇒ Object
197 198 199 200 201 202 203 204 205 |
# File 'lib/albacore/cli.rb', line 197 def download_tool uri, file_name target = "./tools/#{file_name}" File.open(target, "wb") do |saved_file| open(uri, "rb") do |read_file| saved_file.write(read_file.read) end end end |