Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Update names of iPad devices... #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/xclisten
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OptionParser.new do |opts|
opts.on('--ios', '[DEFAULT] Run with iOS sdk') do
@options[:sdk] = 'iphonesimulator'
end
opts.on('-d', '--device DEVICE', 'Simulated device [iphone5s, iphone5, iphone4, ipad2, ipad4, ipad_air]. Default is iphone5s') do |device|
opts.on('-d', '--device DEVICE', "Simulated device [#{IOS_DEVICES.keys * ','}]. Default is iphone5s") do |device|
@options[:device] = device
end
opts.on('-s', '--scheme SCHEME', 'BYOS (Bring your own scheme)') do |scheme|
Expand Down
22 changes: 12 additions & 10 deletions lib/xclisten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
require 'xclisten/shell_task'
require 'listen'

IOS_DEVICES = {
# TODO Update iPhone names.
'iphone5s' => 'iPhone Retina (4-inch 64-bit)',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'iphone5' => 'iPhone Retina (4-inch)',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'iphone4' => 'iPhone Retina (3.5-inch)',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'ipad2' => 'iPad 2',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'ipad_air' => 'iPad Air',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'ipad_retina' => 'iPad Retina',
'ipad_resizable' => 'Resizable iPad'
}

class XCListen

attr_reader :device
Expand All @@ -16,15 +27,6 @@ def initialize(opts = {})
@device = IOS_DEVICES[opts[:device]] || IOS_DEVICES['iphone5s']
end

IOS_DEVICES = {
'iphone5s' => 'iPhone Retina (4-inch 64-bit)',
'iphone5' => 'iPhone Retina (4-inch)',
'iphone4' => 'iPhone Retina (3.5-inch)',
'ipad2' => 'iPad',
'ipad4' => 'iPad Retina',
'ipad_air' => 'iPad Retina (64-bit)'
}

def workspace_path
@workspace_path ||= Dir.glob("**/*.xcworkspace").sort_by(&:length).first
end
Expand All @@ -48,7 +50,7 @@ def install_pods
end

def run_tests
ShellTask.run("#{xcodebuild} test 2> xcodebuild_error.log | xcpretty -tc")
ShellTask.run("#{xcodebuild} test 2>| xcodebuild_error.log | xcpretty -tc")
end

#TODO TEST THIS SPIKE
Expand Down