Class: Cask::Cmd::Cat

Inherits:
AbstractCommand show all
Defined in:
brew/Library/Homebrew/cask/cmd/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, run, visible

Methods included from Homebrew::Search

#query_regexp, #search_casks, #search_descriptions, #search_formulae, #search_taps

Methods included from Options

#process_arguments

Constructor Details

#initializeCat

Returns a new instance of Cat



6
7
8
9
# File 'brew/Library/Homebrew/cask/cmd/cat.rb', line 6

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

Class Method Details

.helpObject



17
18
19
# File 'brew/Library/Homebrew/cask/cmd/cat.rb', line 17

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

Instance Method Details

#runObject



11
12
13
14
15
# File 'brew/Library/Homebrew/cask/cmd/cat.rb', line 11

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