Class: TogoStanza::CLI::StanzaRemover

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions, Thor::Shell
Defined in:
lib/togostanza/cli.rb

Instance Method Summary collapse

Instance Method Details

#check_existObject



91
92
93
94
95
96
# File 'lib/togostanza/cli.rb', line 91

def check_exist
  unless File.exist?("#{file_name}")
    say("This provider doesn't have #{file_name}")
    exit
  end
end

#check_inputObject



83
84
85
86
87
88
89
# File 'lib/togostanza/cli.rb', line 83

def check_input
  input = yes?("Do you want to remove #{file_name} [y] ?")
  unless input
    say("This operation is canceled")
    exit
  end
end

#prune_gemObject



102
103
104
# File 'lib/togostanza/cli.rb', line 102

def prune_gem
  gsub_file("Gemfile", "gem '#{file_name}', path: './#{file_name}'\n", "")
end

#prune_gem_lockObject



106
107
108
# File 'lib/togostanza/cli.rb', line 106

def prune_gem_lock
  run "bundle install"
end

#remove_filesObject



98
99
100
# File 'lib/togostanza/cli.rb', line 98

def remove_files
  remove_file("#{file_name}")
end