Class: Torba::RemoteSources::Npm
- Defined in:
- lib/torba/remote_sources/npm.rb
Overview
Represents npm package.
Instance Attribute Summary collapse
-
#package ⇒ String
readonly
Package name.
-
#version ⇒ String
readonly
Package version.
Attributes inherited from Targz
Instance Method Summary collapse
-
#initialize(package, version) ⇒ Npm
constructor
A new instance of Npm.
Methods included from Common
Constructor Details
#initialize(package, version) ⇒ Npm
Returns a new instance of Npm.
20 21 22 23 24 25 |
# File 'lib/torba/remote_sources/npm.rb', line 20 def initialize(package, version) @package = package @version = version super("https://registry.npmjs.org/#{package}/-/#{package}-#{version}.tgz") @digest = "#{package}-#{Torba.digest(url)}" end |
Instance Attribute Details
#package ⇒ String (readonly)
Returns package name.
11 12 13 |
# File 'lib/torba/remote_sources/npm.rb', line 11 def package @package end |
#version ⇒ String (readonly)
Returns package version.
16 17 18 |
# File 'lib/torba/remote_sources/npm.rb', line 16 def version @version end |