calabash/calabash-ios — pull request #364 by jmoody (2014-05-02 10:31:17+00:00)
Title: SimulatorHelper replaced with SimulatorLauncher - a bridge to sim_launcher gem

## motivation

The SimulatorHelper module was out of step with the rest of the calabash gem. The module was a collection of ruby class methods which made it impossible to integrate with new gem features like:

* logging
* server/gem compatibility tests

It also contained behaviors that were duplicated elsewhere in the gem. For example, it queried the calabash server for version information - something that is already done (well) by the Device class. The PlaybackHelpers helpers module was (in a strange twist) using these iOS version methods to determine which version of the recordings to playback.

The purpose of the SimulatorHelper module was to provide a bridge to the sim_launcher gem.

The SimulatorHelper module has been replaced by a class SimulatorLauncher and as much as possible its responsibilities have been limited to managing the interaction between the calabash gem and sim_launcher gem.

- [ ] @krukow needs review

### backwards compatibility

These changes are backward compatible. Deprecated API calls are marked as deprecated.

#### launch hooks
The default launch hooks contain an `at_exit` hook:

```
at_exit do
launcher = Calabash::Cucumber::Launcher.new
if launcher.simulator_target?
# this has been deprecated
Calabash::Cucumber::SimulatorHelper.stop unless launcher.calabash_no_stop?
end
end
```

Calls to `Calabash::Cucumber::SimulatorHelper.stop` will print a deprecated warning:

```
WARN: deprecated '0.9.169' - Calabash::Cucumber::SimulatorHelper module has been replaced
please update your code to use this pattern:
launcher = Calabash::Cucumber::Launcher.new
launcher.simulator_launcher.stop
```

The default launch hooks have been updated to:

```
# launch hooks for new projects
at_exit do
launcher = Calabash::Cucumber::Launcher.new
if launcher.simulator_target?
launcher.simulator_launcher.stop unless launcher.calabash_no_stop?
end
end
```

#### deprecated methods

The following methods were removed from the API

- `get_version` - use Device class
- `ios_version` - use Device class
- `ios_major_version` - use Device class
- `version_check` - use `Launcher.launcher.check_server_gem_compatibility`

## testing

Testing is on-going.