class TogoStanza::CLI::StanzaRemover

Public Instance Methods

check_exist() click to toggle source
# 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_input() click to toggle source
# 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_gem() click to toggle source
# File lib/togostanza/cli.rb, line 103
def prune_gem
  gsub_file("Gemfile", "gem '#{file_name}', path: './#{file_name}'\n", "")
end
prune_gem_lock() click to toggle source
# File lib/togostanza/cli.rb, line 107
def prune_gem_lock
  run "bundle install"
end
remove_files() click to toggle source
# File lib/togostanza/cli.rb, line 99
def remove_files
  remove_file("#{file_name}")
end

Private Instance Methods

chop_slash() click to toggle source
# File lib/togostanza/cli.rb, line 113
def chop_slash
  if name[-1] == '/'
    name.chop
  else
    name
  end
end
file_name() click to toggle source
# File lib/togostanza/cli.rb, line 125
def file_name
  stanza_id + '_stanza'
end
stanza_id() click to toggle source
# File lib/togostanza/cli.rb, line 121
def stanza_id
  chop_slash.underscore.sub(/_stanza$/, '')
end