Sha256: 10292a4611183f191dbb6b6869fba0d38fc68c41e1678e3de6c00fa489bef16b
Contents?: true
Size: 1.01 KB
Versions: 12
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true ## # Usage example: # # ConvenientService::Examples::Rails::Gemfile::Services::AssertNpmPackageAvailable.result(name: "lodash") # module ConvenientService module Examples module Rails module Gemfile module Services class AssertNpmPackageAvailable include RailsService::Config attribute :name, :string validates :name, presence: true if ConvenientService::Dependencies.support_has_result_params_validations_using_active_model_validations? step Services::AssertNodeAvailable ## # NOTE: `> /dev/null 2>&1` is used to hide output. # https://unix.stackexchange.com/a/119650/394253 # # NOTE: For `npm list` and its options docs, see # https://docs.npmjs.com/cli/v7/commands/npm-ls # step Services::RunShell, in: {command: -> { "npm list #{name} --depth=0 > /dev/null 2>&1" }} end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems