New public API to support all of the ios-sim command line options #22

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
@mgrebenets

Hi.

I really wanted sim_launcher to support more command line options of ios-sim, especially options like :retina, :tall and :env.
I am aware of #16 pull request, but it has too many changes for me to grasp, also deals with things like Frank, Sinatra and so on. And it's been there for quite a while as well, with no progress.

So I tried to come up with minimum changes required to support more ios-sim options.

I also kept the public API unchanged (launch_ios_app) so it's backwards compatible.

The start_simulator, launch_ipad_app, launch_ipad_app_with_name, launch_iphone_app, launch_iphone_app_with_name are backwards compatible as well. They do have new arguments, but these arguments have default values, so it won't break existing code.

The new public API is launch_ios_app_with_options, it's almost same as launch_ios_app with addition of one new argument options. This options hash can be used to pass any command line option that ios-sim supports.
Here are some examples

s = SimLauncher::Simulator.new
# iPad retina, SDK 6.1, load environment variables from env.plist
options = { :retina => nil, :env => "env.plist" }
s.start_simulator("6.1", "ipad", options)
# iPhone tall retina (4-inch), SDK 7.0, set environment variables 'dev' and 'reset' to true
options = { :retina => nil, :tall => nil, :setenv => "dev=true", :setenv => "reset=true" }
s.start_simulator("7.0", "iphone", options)
# Start with no options (backwards compatibility)
s.start_simulator("7.0", "iphone")

I know that :retina => nil might be a bit confusing, I'd welcome any suggestions on this one.

This is pretty much all the change.

The differences look big because of the comments added to document the code.
You can now run yardoc . and get 100% code documented.

Finally, I was confused by mixed styling in the code.
Some places use spaces around operands, some don't.
Some pieces of code put spaces around ( and ), others don't.
So followed https://github.com/bbatsov/ruby-style-guide and https://github.com/styleguide/ruby to make the code consistent, but after all that's just cosmetic change.

Maksym Grebenets added some commits Oct 17, 2013

Maksym Grebenets
Add ios app launcher with options, document code
- Add new method  to launch simulator with options
- Keep  for backwards compatibility
- Modify , ,  and  to support options and app arguments
  - Make update safe for backwards compatibility
- Document all the code to get 100 percent documentation coverage (used yardoc)
@mokagio

This comment has been minimized.

Show comment Hide comment
@mokagio

mokagio Jan 19, 2015

+1

mokagio commented Jan 19, 2015

+1

@mgrebenets

This comment has been minimized.

Show comment Hide comment
@mgrebenets

mgrebenets Feb 3, 2017

Will close it for now, seems like there's no demand for almost 4 years 😅

Will close it for now, seems like there's no demand for almost 4 years 😅

@mgrebenets mgrebenets closed this Feb 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment