Class: Sem::CLI::SharedConfigs::Files
- Inherits:
-
Dracula
- Object
- Dracula
- Sem::CLI::SharedConfigs::Files
- Defined in:
- lib/sem/cli/shared_configs.rb
Instance Method Summary collapse
- #add(shared_config_path, file_name) ⇒ Object
- #list(shared_config_path) ⇒ Object
- #remove(shared_config_path, file_name) ⇒ Object
Instance Method Details
#add(shared_config_path, file_name) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/sem/cli/shared_configs.rb', line 52 def add(shared_config_path, file_name) content = File.read([:file]) Sem::API::Files.add_to_shared_config(shared_config_path, :path => file_name, :content => content) puts "Added #{file_name} to #{shared_config_path}" end |
#list(shared_config_path) ⇒ Object
44 45 46 47 48 |
# File 'lib/sem/cli/shared_configs.rb', line 44 def list(shared_config_path) files = Sem::API::SharedConfigs.list_files(shared_config_path) Sem::Views::Files.list(files) end |
#remove(shared_config_path, file_name) ⇒ Object
61 62 63 64 65 |
# File 'lib/sem/cli/shared_configs.rb', line 61 def remove(shared_config_path, file_name) Sem::API::Files.remove_from_shared_config(shared_config_path, file_name) puts "Removed #{file_name} from #{shared_config_path}" end |