Class: Pbind::Command::Mock
- Inherits:
-
Pbind::Command
- Object
- CLAide::Command
- Pbind::Command
- Pbind::Command::Mock
- Defined in:
- lib/pbind/command/mock.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Mock
constructor
A new instance of Mock.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pbind::Command
options, report_error, #verify_project_exists
Constructor Details
#initialize(argv) ⇒ Mock
Returns a new instance of Mock.
17 18 19 20 21 |
# File 'lib/pbind/command/mock.rb', line 17 def initialize(argv) super @client = argv.shift_argument @action = argv.shift_argument end |
Instance Method Details
#run ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/pbind/command/mock.rb', line 29 def run @action = @action.gsub(/\//, '-') @api_name = 'PBLocalhost' @project_root = File.dirname(@project_path) @api_install_dir = File.absolute_path(File.join(@project_root, @api_name)) @project = Xcodeproj::Project.open(@project_path) @changed = false add_mock_json super end |
#validate! ⇒ Object
23 24 25 26 27 |
# File 'lib/pbind/command/mock.rb', line 23 def validate! verify_project_exists help! 'The client is required.' unless @client help! 'The action is required.' unless @action end |