Class: AudioStream::CLI
- Inherits:
-
Thor
- Object
- Thor
- AudioStream::CLI
- Includes:
- Helpers, Thor::Actions
- Defined in:
- lib/audiostream/cli.rb
Instance Method Summary collapse
Methods included from Helpers
Instance Method Details
#banner ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/audiostream/cli.rb', line 15 def puts <<-EOL AudioStream (C)2013 CompuTEK Industries. All Rights Reserved. Licenced for usage and distribution under a BSD version 2 Licence. EOL help end |
#time ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/audiostream/cli.rb', line 32 def time help(:time) if [:playlist].nil? @filepath = "#{[:playlist]}" if File.exists?(@filepath) then File.open(@filepath).each do |item| @item=item.chomp next if /^#EXT(M3U|INF:).*$/.match(@item) if File.exists?(@item) then @total_time << playtime(@item) puts "#{@item}: #{playtime(@item)}" else puts "Error: File #{@item} not found" end end else puts "Playlist could not be loaded." end end |
#version ⇒ Object
25 26 27 |
# File 'lib/audiostream/cli.rb', line 25 def version puts AudioStream::VERSION end |