Sha256: 9df0e5c92402e4f647e227e607529cd4c1d05f3d50d07a5e48cc3640bda198c2

Contents?: true

Size: 609 Bytes

Versions: 16

Compression:

Stored size: 609 Bytes

Contents

require 'jsduck/util/json'

module JsDuck
  module Options

    # Handles reading of JSB3 files.
    class Jsb

      # Extracts files of first build in JSB3 file.
      def self.read(filename)
        json = Util::Json.read(filename)
        basedir = File.dirname(filename)

        return json["builds"][0]["packages"].map do |package_id|
          package = json["packages"].find {|p| p["id"] == package_id }
          (package ? package["files"] : []).map do |file|
            File.expand_path(basedir + "/" + file["path"] + file["name"])
          end
        end.flatten
      end

    end

  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
solvas-jsduck-6.0.0.30539 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/options/jsb.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.10 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.9 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.8 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.7 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.5 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.4 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.3 lib/jsduck/options/jsb.rb
jsduck-troopjs-0.0.1 lib/jsduck/options/jsb.rb
jsduck-6.0.0beta lib/jsduck/options/jsb.rb