Class: Grundler::Commands::Add

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/grundler/commands/add.rb

Instance Method Summary collapse

Methods included from Common

#install, #latest_version, #module?, #no_such_package

Constructor Details

#initialize(cli, packages, json_writer) ⇒ Add

Returns a new instance of Add.



8
9
10
11
12
13
14
15
16
# File 'lib/grundler/commands/add.rb', line 8

def initialize(cli, packages, json_writer)
  super(cli)
  if packages.empty?
    puts "Must specify a package name!"
    return
  end

  json_writer.add(added_packages(packages))
end