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.



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

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

Class Method Details

.callObject



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

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

Instance Method Details

#callObject



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

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