bwoken 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@ module Bwoken
33
33
  def test_suite_path
34
34
  File.join(tmp_path, 'javascript')
35
35
  end
36
-
36
+
37
37
  def path_to_developer_dir
38
38
  `xcode-select -print-path`.strip
39
39
  end
@@ -21,17 +21,17 @@ module Bwoken
21
21
  end
22
22
 
23
23
  def sdk
24
- if Bwoken::Device.connected?
25
- 'iphoneos'
26
- else
24
+ if Bwoken::Device.should_use_simulator?
27
25
  'iphonesimulator'
26
+ else
27
+ 'iphoneos'
28
28
  end
29
29
  end
30
30
 
31
31
  def configuration_build_dir
32
32
  File.join(build_path, sdk)
33
33
  end
34
-
34
+
35
35
  def xcconfig
36
36
  File.join(File.dirname(__FILE__), 'configs', 'bwoken.xcconfig')
37
37
  end
@@ -1,12 +1,24 @@
1
1
  module Bwoken
2
2
  class Device
3
- def self.connected?
4
- self.uuid ? true : false
5
- end
3
+ class << self
4
+
5
+ def should_use_simulator?
6
+ want_simulator? || ! connected?
7
+ end
8
+
9
+ def want_simulator?
10
+ ENV['SIMULATOR'] && ENV['SIMULATOR'].downcase == 'true'
11
+ end
12
+
13
+ def connected?
14
+ self.uuid ? true : false
15
+ end
16
+
17
+ def uuid
18
+ ioreg = `ioreg -w 0 -rc IOUSBDevice -k SupportsIPhoneOS`
19
+ ioreg[/"USB Serial Number" = "([0-9a-z]+)"/] && $1
20
+ end
6
21
 
7
- def self.uuid
8
- ioreg = `ioreg -w 0 -rc IOUSBDevice -k SupportsIPhoneOS`
9
- ioreg[/"USB Serial Number" = "([0-9a-z]+)"/] && $1
10
22
  end
11
23
 
12
24
  end
@@ -66,10 +66,10 @@ module Bwoken
66
66
  end
67
67
 
68
68
  def device_flag
69
- if Bwoken::Device.connected?
70
- "-w #{Bwoken::Device.uuid}"
71
- else
69
+ if Bwoken::Device.should_use_simulator?
72
70
  ''
71
+ else
72
+ "-w #{Bwoken::Device.uuid}"
73
73
  end
74
74
  end
75
75
 
@@ -1,3 +1,3 @@
1
1
  module Bwoken
2
- VERSION = "1.1.1" unless defined?(::Bwoken::VERSION)
2
+ VERSION = "1.2.0" unless defined?(::Bwoken::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bwoken
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-25 00:00:00.000000000 Z
13
+ date: 2013-03-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coffee-script-source
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -4146561164984030990
149
+ hash: 1445511706226898183
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements:
@@ -155,10 +155,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  segments:
157
157
  - 0
158
- hash: -4146561164984030990
158
+ hash: 1445511706226898183
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 1.8.24
161
+ rubygems_version: 1.8.25
162
162
  signing_key:
163
163
  specification_version: 3
164
164
  summary: Runs your UIAutomation tests from the command line for both iPhone and iPad;