Class: Hanamismith::Extensions::NPM

Inherits:
Object
  • Object
show all
Defined in:
lib/hanamismith/extensions/npm.rb

Overview

Ensures NPM packages are installed if NPM is available.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ NPM

Returns a new instance of NPM.



18
19
20
21
# File 'lib/hanamismith/extensions/npm.rb', line 18

def initialize(configuration, **)
  super(**)
  @configuration = configuration
end

Class Method Details

.callObject



16
# File 'lib/hanamismith/extensions/npm.rb', line 16

def self.call(...) = new(...).call

Instance Method Details

#callObject



23
24
25
26
# File 'lib/hanamismith/extensions/npm.rb', line 23

def call
  logger.error { "Unable to detect NPM. Install NPM and run: `npm install`." } unless run
  configuration
end