Class: NCUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/ncupdater.rb

Instance Method Summary collapse

Constructor Details

#initialize(semver_path = 'test', remote_url = '', commands = '') ⇒ NCUpdater

Returns a new instance of NCUpdater.



14
15
16
17
18
# File 'lib/ncupdater.rb', line 14

def initialize(semver_path = 'test', remote_url = '', commands = '')
  @semver_path = semver_path
  @remote_url = remote_url
  @commands = commands
end

Instance Method Details

#new_version?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ncupdater.rb', line 28

def new_version?
  NCCheckVersion::new::check_for_updates(@semver_path, @remote_url)
end

#updateObject



20
21
22
23
24
25
26
# File 'lib/ncupdater.rb', line 20

def update
  if new_version?
    NCUpdate::new::update(@commands)
  else
    puts 'You are already on latest version..'.colorize(:yellow)
  end
end