Class: JsDuck::Options::Jsb
- Inherits:
-
Object
- Object
- JsDuck::Options::Jsb
- Defined in:
- lib/jsduck/options/jsb.rb
Overview
Handles reading of JSB3 files.
Class Method Summary collapse
-
.read(filename) ⇒ Object
Extracts files of first build in JSB3 file.
Class Method Details
.read(filename) ⇒ Object
Extracts files of first build in JSB3 file.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jsduck/options/jsb.rb', line 10 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.(basedir + "/" + file["path"] + file["name"]) end end.flatten end |