Sha256: 6c208c203360b045c6c79f09609917e521d160d9c828e288e13aafe78a35f3d2

Contents?: true

Size: 653 Bytes

Versions: 15

Compression:

Stored size: 653 Bytes

Contents

require "json"

module Bibliothecary
  module Parsers
    class Bower
      include Bibliothecary::Analyser

      def self.mapping
        {
          match_filename("bower.json") => {
            kind: "manifest",
            parser: :parse_manifest,
          },
        }
      end

      add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)

      def self.parse_manifest(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
        json = JSON.parse(file_contents)
        map_dependencies(json, "dependencies", "runtime") +
        map_dependencies(json, "devDependencies", "development")
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bibliothecary-12.0.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-11.0.1 lib/bibliothecary/parsers/bower.rb
bibliothecary-11.0.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.2.4 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.2.3 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.2.2 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.2.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.1.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-10.0.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-9.1.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-9.0.0 lib/bibliothecary/parsers/bower.rb
bibliothecary-8.8.1 lib/bibliothecary/parsers/bower.rb
bibliothecary-8.7.7 lib/bibliothecary/parsers/bower.rb
bibliothecary-8.7.6 lib/bibliothecary/parsers/bower.rb
bibliothecary-8.7.5 lib/bibliothecary/parsers/bower.rb