Class: Mdq::List
- Inherits:
-
Object
- Object
- Mdq::List
- Defined in:
- lib/mdq/list.rb
Overview
List
Instance Method Summary collapse
-
#initialize(options) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(options) ⇒ List
Returns a new instance of List.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mdq/list.rb', line 9 def initialize() db = Mdq::DB.new query = ['query'] models = db.get(query) output = JSON.pretty_generate(models.as_json) puts output if ['output'] File.open(['output'], 'w') do |f| f.write(output) end end ob = Mdq::OutputBuilder.new models.each do |device| model = Device.find_by(udid: device.udid) udid = model.udid is_android = model.android? ob.add(db.device_screencap([:cap], udid, is_android)) if [:cap] ob.add(db.app_install([:install], udid, is_android)) if [:install] ob.add(db.app_uninstall([:uninstall], udid, is_android)) if [:uninstall] rescue StandardError # none end ob.print end |