Sha256: b128b3eae7d902495c3255fa5f580fcafd9d189a825f6a531c8769aea64be93e

Contents?: true

Size: 400 Bytes

Versions: 5

Compression:

Stored size: 400 Bytes

Contents

require 'json'

module LicenseFinder
  class Bower

    def self.current_packages
      output = `bower list --json`

      json = JSON(output)

      json.fetch("dependencies",[]).map do |package|
        BowerPackage.new(package[1])
      end
    end

    def self.active?
      package_path.exist?
    end

    private

    def self.package_path
      Pathname.new('bower.json')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
license_finder-1.1.1-java lib/license_finder/package_managers/bower.rb
license_finder-1.1.1 lib/license_finder/package_managers/bower.rb
license_finder-1.1.0 lib/license_finder/package_managers/bower.rb
license_finder-1.0.1 lib/license_finder/package_managers/bower.rb
license_finder-1.0.0.1 lib/license_finder/package_managers/bower.rb