Sha256: 7ff56c02d512e82228ef32b602968a62a8a7f7ff8ea2ef8971d05e4351ecd24e

Contents?: true

Size: 613 Bytes

Versions: 7

Compression:

Stored size: 613 Bytes

Contents

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

    def self.introspected
      dirs = Papers.config.javascript_paths

      # TODO: add logic for determining rails. Is Rails.root better than Dir.pwd for such a case?
      root_regexp = /^#{Regexp.escape Dir.pwd.to_s}\//
      dirs.map { |dir| Dir["#{dir}/**/*.js"] }.flatten.map { |name| name.sub(root_regexp, '') }
    end

    def self.manifest_key
      "javascripts"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
papers-1.3.1 lib/papers/dependency_specification/javascript.rb
papers-1.3.0 lib/papers/dependency_specification/javascript.rb
papers-1.2.0 lib/papers/dependency_specification/javascript.rb
papers-1.1.0 lib/papers/dependency_specification/javascript.rb
papers-1.0.3 lib/papers/dependency_specification/javascript.rb
papers-1.0.2 lib/papers/dependency_specification/javascript.rb
papers-1.0.1 lib/papers/dependency_specification/javascript.rb