Module: InstallGemLocal::PushGem

Included in:
Action
Defined in:
lib/install_gem_local/action/push_gem.rb

Instance Method Summary collapse

Instance Method Details

#push_gemObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/install_gem_local/action/push_gem.rb', line 3

def push_gem
  till_install
  puts ''
  puts 'Push Gem'.blue
  files_exists = file_names
  if files_exists.count > 1
    push_gem_from_path(multiple_version_selection)
  elsif files_exists.count == 1
    push_gem_from_path(files_exists.first)
  else
    ap 'Gem not exist'
  end
end

#push_gem_from_path(file_name) ⇒ Object



17
18
19
20
21
# File 'lib/install_gem_local/action/push_gem.rb', line 17

def push_gem_from_path(file_name)
  return if file_name == 'exit'

  tty_command.run("gem push #{file_name}")
end