Sha256: be01809515f66e891fc5b68769261874583d7579e3e7d83bb79f105fb0ac0126

Contents?: true

Size: 822 Bytes

Versions: 12

Compression:

Stored size: 822 Bytes

Contents

module LicenseFinder
  class BowerPackage < Package
    def initialize(bower_module, options={})
      spec = bower_module.fetch("pkgMeta", Hash.new)

      if spec.empty?
        endpoint = bower_module.fetch("endpoint", Hash.new)
        name = endpoint["name"]
        version = endpoint["target"]
      else
        name = spec["name"]
        version = spec["version"]
      end

      super(
        name,
        version,
        options.merge(
          summary: spec["description"],
          description: spec["readme"],
          homepage: spec["homepage"],
          spec_licenses: Package.license_names_from_standard_spec(spec),
          install_path: bower_module["canonicalDir"],
          missing: bower_module["missing"]
        )
      )
    end

    def package_manager
      'Bower'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
license_finder-3.0.4 lib/license_finder/package_managers/bower_package.rb
license_finder-3.0.2 lib/license_finder/package_managers/bower_package.rb
license_finder-3.0.1 lib/license_finder/package_managers/bower_package.rb
license_finder-3.0.0 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.2 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.1 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0.rc9 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0.rc8 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0.rc7 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0.rc6 lib/license_finder/package_managers/bower_package.rb
license_finder-2.1.0.rc5 lib/license_finder/package_managers/bower_package.rb