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



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

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

#check_inputObject



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

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



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

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

#prune_gem_lockObject



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

def prune_gem_lock
  run "bundle install"
end

#remove_filesObject



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

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