Class: Hbc::CLI::Cat

Inherits:
AbstractCommand show all
Defined in:
Library/Homebrew/cask/lib/hbc/cli/cat.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractCommand

abstract?, command_name, needs_init?, run, visible

Methods included from Options

included, #process_arguments

Constructor Details

#initializeCat

Returns a new instance of Cat



4
5
6
7
# File 'Library/Homebrew/cask/lib/hbc/cli/cat.rb', line 4

def initialize(*)
  super
  raise CaskUnspecifiedError if args.empty?
end

Class Method Details

.helpObject



15
16
17
# File 'Library/Homebrew/cask/lib/hbc/cli/cat.rb', line 15

def self.help
  "dump raw source of the given Cask to the standard output"
end

Instance Method Details

#runObject



9
10
11
12
13
# File 'Library/Homebrew/cask/lib/hbc/cli/cat.rb', line 9

def run
  casks.each do |cask|
    puts File.open(cask.sourcefile_path, &:read)
  end
end