Class: VimPK::Commands::List
- Inherits:
-
Object
- Object
- VimPK::Commands::List
- Defined in:
- lib/vimpk/commands/list.rb
Instance Attribute Summary collapse
-
#dest ⇒ Object
readonly
Returns the value of attribute dest.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(options) ⇒ List
Returns a new instance of List.
8 9 10 11 12 |
# File 'lib/vimpk/commands/list.rb', line 8 def initialize() @path = .path @pack = .pack || "*" @type = .type || "{start,opt}" end |
Instance Attribute Details
#dest ⇒ Object (readonly)
Returns the value of attribute dest.
6 7 8 |
# File 'lib/vimpk/commands/list.rb', line 6 def dest @dest end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/vimpk/commands/list.rb', line 14 def call pattern = File.join(@path, @pack, @type, "*") glob = Dir.glob(pattern) raise PackageNotFoundError, "No packages were found in #{pattern}." if glob.empty? glob end |