Class: HammerCLI::Options::Normalizers::File
Class Method Summary
collapse
Instance Method Summary
collapse
#completion_type, #description, inherited
Class Method Details
.common_description ⇒ Object
267
268
269
|
# File 'lib/hammer_cli/options/normalizers.rb', line 267
def common_description
_('Path to a file')
end
|
.completion_type ⇒ Object
263
264
265
|
# File 'lib/hammer_cli/options/normalizers.rb', line 263
def completion_type
:file
end
|
Instance Method Details
#complete(value) ⇒ Object
276
277
278
279
280
281
282
283
284
|
# File 'lib/hammer_cli/options/normalizers.rb', line 276
def complete(value)
Dir[value.to_s+'*'].collect do |file|
if ::File.directory?(file)
file+'/'
else
file+' '
end
end
end
|
272
273
274
|
# File 'lib/hammer_cli/options/normalizers.rb', line 272
def format(path)
::File.read(::File.expand_path(path))
end
|