Class: Downloads::Commands::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/downloads/commands/video.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#configuration, #local, #options, #remote

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

command_name, inherited, #initialize, #usage

Constructor Details

This class inherits a constructor from Downloads::Commands::Base

Instance Attribute Details

#urisObject

Returns the value of attribute uris.



8
9
10
# File 'lib/downloads/commands/video.rb', line 8

def uris
  @uris
end

Class Method Details

.usageObject



10
11
12
# File 'lib/downloads/commands/video.rb', line 10

def self.usage
  "#{super} URL ..."
end

Instance Method Details

#configure(argv) ⇒ Object



14
15
16
17
18
19
# File 'lib/downloads/commands/video.rb', line 14

def configure(argv)
  self.uris = []
  while uri = shift_argument(argv)
    self.uris << parse_uri(uri)
  end
end

#runObject



21
22
23
# File 'lib/downloads/commands/video.rb', line 21

def run
  remote.run("wget '#{download_uris.join("' '")}' --no-check-certificate")
end

#valid?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/downloads/commands/video.rb', line 25

def valid?
  download_uris.any?
end