Class: Fav::WritableCommand

Inherits:
FavCommand show all
Defined in:
lib/fav.rb

Overview

A command that writes back to the Favs file

Direct Known Subclasses

AddCommand, RemoveCommand

Instance Attribute Summary

Attributes inherited from FavCommand

#cli_options, #command_args, #command_name, #command_options, #config, #favs_file

Instance Method Summary collapse

Methods inherited from FavCommand

#initialize, #run!

Constructor Details

This class inherits a constructor from Fav::FavCommand

Instance Method Details

#post_groupObject

Write the contents after performing the command



142
143
144
145
146
# File 'lib/fav.rb', line 142

def post_group
  file = File.open("#{ENV['HOME']}/.favs", 'w')
  self.config.write(file)
  file.close
end