snapshot 0.9.3 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 524dab0c4b7be609151cb4e277fa150257cfa9b0
4
- data.tar.gz: 5eae566a40f1a11789385d14fb49d3439dd06acf
3
+ metadata.gz: a7f64dd119934c713a6b6fc7e05653ac8ebca9d1
4
+ data.tar.gz: 28d7d068560b15e39d75acdfdaf822bd49464aca
5
5
  SHA512:
6
- metadata.gz: 99fcceb0567036b19e04c0c20b1348f1595ffd62094b0c57371e11581f16b31042b97f7554edc41042d5e92f9a0e13c0ae80016f73afa31b9ccc680e12873d82
7
- data.tar.gz: 0e3ba863d08edea6ca0ebbb46d742bbfcdfbb5ffaf925abf7c3b81e98ed4cc3d02fafae33c56023eeb26e013e4eca5c3f2641c07ecea2877e54a43f2e5488b2e
6
+ metadata.gz: f5697b920fda9b3352ce8c187f9c9489445ac49d285b02bcbed61fbdb1c55eb63b027d1c86154700f2a60eaf4bb6dcd9234fa5ca746aed1659efa29a10290516
7
+ data.tar.gz: 4ec9ce6549d8007be4c8dc9e026e96347ed249e7bc17e1505d96eceb7a46aad63a13afe69a36d272fad77160f1c4f42fe78bf40ac74cf1f9fdf2720d85ab35df
data/README.md CHANGED
@@ -71,6 +71,8 @@ As a result, `snapshot` will be completely rewritten from ground up without chan
71
71
  - UI Tests are written in Swift or Objective C
72
72
  - UI Tests can be executed in a much cleaner and better way
73
73
 
74
+ A note to the new release of Xcode 7: `snapshot` has some issues with the GM, please use Xcode 6 for UI Automation until this is resolved.
75
+
74
76
  -------
75
77
  <p align="center">
76
78
  <a href="#features">Features</a> &bull;
@@ -69,13 +69,14 @@ class SnapshotApplication
69
69
  command :reset_simulators do |c|
70
70
  c.syntax = 'snapshot reset_simulators'
71
71
  c.description = "This will remove all your existing simulators and re-create new ones"
72
- c.option '-i', '--ios String', String, 'The iOS Version you want to use'
72
+ c.option '-i', '--ios String', String, 'The comma separated list of iOS Versions you want to use'
73
73
 
74
74
  c.action do |args, options|
75
- version = options.ios || Snapshot::LatestIosVersion.version
75
+ versions = [Snapshot::LatestIosVersion.version]
76
+ versions = options.ios.split(',') if options.ios
76
77
  require 'snapshot/reset_simulators'
77
78
 
78
- Snapshot::ResetSimulators.clear_everything!(version)
79
+ Snapshot::ResetSimulators.clear_everything!(versions)
79
80
  end
80
81
  end
81
82
 
@@ -16,4 +16,12 @@ module Snapshot
16
16
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
17
17
 
18
18
  Snapshot::DependencyChecker.check_dependencies
19
+
20
+ def self.xcode_version
21
+ `xcodebuild -version`.match(/Xcode (.*)/)[1]
22
+ end
23
+
24
+ def self.min_xcode7?
25
+ xcode_version.split(".").first.to_i >= 7
26
+ end
19
27
  end
@@ -134,7 +134,6 @@
134
134
  tmpImg.src = img.src;
135
135
  imageDisplay.style.height = 'auto';
136
136
  imageDisplay.style.width = 'auto';
137
- imageDisplay.style.paddingTop = '20px';
138
137
  if (window.innerHeight < tmpImg.height) {
139
138
  imageDisplay.style.height = document.documentElement.clientHeight+'px';
140
139
  } else if (window.innerWidth < tmpImg.width) {
@@ -1,6 +1,6 @@
1
1
  module Snapshot
2
2
  class ResetSimulators
3
- def self.clear_everything!(ios_version)
3
+ def self.clear_everything!(ios_versions)
4
4
  # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5
5
  # !! Warning: This script will remove all your existing simulators !!
6
6
  # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -35,8 +35,10 @@ module Snapshot
35
35
  all_device_types.each do |device_type|
36
36
  next if device_type.join(' ').include?"Watch" # we don't want to deal with the Watch right now
37
37
 
38
- puts "Creating #{device_type} for iOS version #{ios_version}"
39
- `xcrun simctl create '#{device_type[0]}' #{device_type[1]} #{ios_version}`
38
+ ios_versions.each do |ios_version|
39
+ puts "Creating #{device_type} for iOS version #{ios_version}"
40
+ `xcrun simctl create '#{device_type[0]}' #{device_type[1]} #{ios_version}`
41
+ end
40
42
  end
41
43
  end
42
44
  end
@@ -51,7 +51,7 @@ module Snapshot
51
51
  break if errors.any? && ENV["SNAPSHOT_BREAK_ON_FIRST_ERROR"]
52
52
  end
53
53
 
54
- `killall "iOS Simulator"` # close the simulator after the script is finished
54
+ kill_simulator # close the simulator after the script is finished
55
55
 
56
56
  return unless take_snapshots
57
57
 
@@ -100,20 +100,24 @@ module Snapshot
100
100
 
101
101
  def com(cmd)
102
102
  puts cmd.magenta if $verbose
103
- Open3.popen3("#{cmd} 2>&1") do |stdin, stdout, stderr, wait_thr|
104
- result = stdout.read
105
- puts result if (result.to_s.length > 0 and $verbose)
103
+
104
+ IO.popen("#{cmd} 2>&1", err: [:child, :out]) do |io|
105
+ io.each do |line|
106
+ puts line if (line.to_s.length > 0 and $verbose)
107
+ end
108
+ io.close
106
109
  end
107
110
  end
108
111
 
109
112
  udid = udid_for_simulator(device)
110
113
 
111
- com("killall 'iOS Simulator'")
114
+ kill_simulator
112
115
  sleep 3
113
116
  com("xcrun simctl boot '#{udid}'")
114
- com("xcrun simctl uninstall booted '#{app_identifier}'")
117
+
118
+ com("xcrun simctl uninstall '#{udid}' '#{app_identifier}'") unless Snapshot.min_xcode7?
115
119
  sleep 3
116
- com("xcrun simctl install booted '#{@app_path.shellescape}'")
120
+ com("xcrun simctl install '#{udid}' #{@app_path.shellescape}") unless Snapshot.min_xcode7?
117
121
  com("xcrun simctl shutdown booted")
118
122
  end
119
123
 
@@ -221,6 +225,11 @@ module Snapshot
221
225
  end
222
226
  end
223
227
 
228
+ def kill_simulator
229
+ `killall "iOS Simulator"`
230
+ `killall "Simulator"`
231
+ end
232
+
224
233
  def copy_screenshots(language)
225
234
  resulting_path = File.join(SnapshotConfig.shared_instance.screenshots_path, language)
226
235
 
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.9.3"
2
+ VERSION = "0.10.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.4.6
180
+ rubygems_version: 2.4.5
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Automate taking localized screenshots of your iOS app on every device