Sha256: 73a5531f6973c1cd939594f4e2b0c4d39c1cbaa1127413e4fe3640f698db9635

Contents?: true

Size: 830 Bytes

Versions: 6

Compression:

Stored size: 830 Bytes

Contents

require 'json'

module Papers
  class BowerComponent < DependencySpecification
    def pretty_hash
      {
        name: name_without_version,
        license: license,
        license_url: @license_url,
        project_url: @project_url
      }
    end

    def self.introspected
      full_introspected_entries.map { |e| e['name'] }
    end

    def self.full_introspected_entries
      bower_json_entries.map do |entry|
        {
          'name' => "#{entry['name']}-#{entry['_release']}",
          'homepage' => entry['homepage']
        }
      end
    end

    def self.bower_json_entries
      json_files = Dir["#{Papers.config.bower_components_path}/*/.bower.json"]
      json_files.map do |path|
        JSON.parse File.read(path)
      end
    end

    def self.manifest_key
      "bower_components"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
papers-1.4.0 lib/papers/dependency_specification/bower_component.rb
papers-1.3.2 lib/papers/dependency_specification/bower_component.rb
papers-1.3.1 lib/papers/dependency_specification/bower_component.rb
papers-1.3.0 lib/papers/dependency_specification/bower_component.rb
papers-1.2.0 lib/papers/dependency_specification/bower_component.rb
papers-1.1.0 lib/papers/dependency_specification/bower_component.rb