Module: BinInstall::Atom::Package

Defined in:
lib/bin_install/atom/package.rb

Constant Summary collapse

%w[file-icons minimap atom-beautify linter linter-ui-default pigments git-plus busy-signal linter-eslint react].freeze

Class Method Summary collapse

Class Method Details



7
8
9
10
11
12
# File 'lib/bin_install/atom/package.rb', line 7

def self.ask_popular
  return unless installed?

  print 'Would you like to install popular packages for Atom? [Y/n]: '
  install_popular if Shell.default_yes?(gets.chomp)
end

.ask_popular!Object



14
15
16
17
# File 'lib/bin_install/atom/package.rb', line 14

def self.ask_popular!
  print 'Would you like to install popular packages for Atom? [Y/n]: '
  install_popular! if Shell.default_yes?(gets.chomp)
end

.install(package) ⇒ Object



31
32
33
# File 'lib/bin_install/atom/package.rb', line 31

def self.install(package)
  system("apm install #{package}")
end

.install!(package) ⇒ Object



35
36
37
# File 'lib/bin_install/atom/package.rb', line 35

def self.install!(package)
  BinInstall.system!("apm install #{package}")
end


19
20
21
22
23
24
# File 'lib/bin_install/atom/package.rb', line 19

def self.install_popular
  return unless installed?

  puts 'Installing popular Atom packages...'.white
  POPULAR_PACKAGES.each { |p| install(p) }
end

.install_popular!Object



26
27
28
29
# File 'lib/bin_install/atom/package.rb', line 26

def self.install_popular!
  puts 'Installing popular Atom packages...'.white
  POPULAR_PACKAGES.each { |p| install!(p) }
end

.installed?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/bin_install/atom/package.rb', line 39

def self.installed?
  Shell.executable_exists?('apm')
end