Class: Manager
- Inherits:
-
Object
- Object
- Manager
- Defined in:
- lib/flick/manager.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#udid ⇒ Object
Returns the value of attribute udid.
Instance Method Summary collapse
-
#initialize(options) ⇒ Manager
constructor
A new instance of Manager.
- #install ⇒ Object
- #run ⇒ Object
- #uninstall ⇒ Object
Constructor Details
#initialize(options) ⇒ Manager
Returns a new instance of Manager.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/flick/manager.rb', line 5 def initialize Flick::Checker.manager [:action] Flick::Checker.platform [:platform] self.action = [:action] self.platform = [:platform] case platform when "ios" self.driver = Flick::Ios.new when "android" self.driver = Flick::Android.new end self.udid = self.driver.udid self.file = [:file] self.name = [:name] end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def action @action end |
#driver ⇒ Object
Returns the value of attribute driver.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def driver @driver end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def name @name end |
#platform ⇒ Object
Returns the value of attribute platform.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def platform @platform end |
#udid ⇒ Object
Returns the value of attribute udid.
3 4 5 |
# File 'lib/flick/manager.rb', line 3 def udid @udid end |
Instance Method Details
#install ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/flick/manager.rb', line 25 def install if file.nil? puts "Specify a file path. e.g. -f #{Dir.home}/myApp/amazing-app.apk or .app".red; abort else Flick::Checker.file_exists? file driver.install file end end |
#run ⇒ Object
21 22 23 |
# File 'lib/flick/manager.rb', line 21 def run self.send(action) end |
#uninstall ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/flick/manager.rb', line 34 def uninstall if name.nil? puts "Specify a Package Name or Bundle ID. e.g. -n ".red; abort else driver.uninstall name end end |