Sha256: 0d4484b808ed436b9d033bdd8e4f5537aa9699ff43ce7390ecd7af874f6535cd
Contents?: true
Size: 884 Bytes
Versions: 13
Compression:
Stored size: 884 Bytes
Contents
module Sprinkle module Installers # = Npm package Installed # # Installs an npm module # # == Example Usage # # package :magic_beans do # npm 'grunt' # end # # verify { has_npm 'grunt' } class Npm < Installer attr_accessor :package_name api do def npm(package, &block) install Npm.new(self, package, &block) end end verify_api do def has_npm(package) @commands << "npm --global list | grep \"#{package}@\"" end end def initialize(parent, package_name, &block) #:nodoc: super parent, &block @package_name = package_name end protected def install_commands #:nodoc: "npm install --global #{@package_name}" end end end end
Version data entries
13 entries across 13 versions & 1 rubygems