snapshot 1.6.0 → 1.7.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: 6ad2e98962df5f2e97ec3c33bede4babdce30168
4
- data.tar.gz: bc9ac35cf07d90461d297c20aa3977f5c137e7dc
3
+ metadata.gz: 2bfb5b368926119bc4632fb4621c5c0cec9ff2c4
4
+ data.tar.gz: 8045f7a9167e3cef5b8fa19231c3dd16dfd31b31
5
5
  SHA512:
6
- metadata.gz: 756b6e5a499083e7dee9a325fb41e7b3820311e18b3f7de6bc61c6be325ccef38a406d3f749e073b5bdc26768a259c8240db630e688348e3af8097466c9082a1
7
- data.tar.gz: 9cd8d9b921a58da4bd3333f9be6c40b966c00b2285adb178e9d1eea96c6449aeaf44aed345e6f4ab9a0e8eaa0979d039232a341dad80eac73b99f83cc0dbe15a
6
+ metadata.gz: 60fce8fd07f9784372473296ab2106f83a4db5855acd1a887869b751fd504d39c4e512dfc96e0535182a9267e7cd1e133b22af43227d9363e309205265709f65
7
+ data.tar.gz: 683460e6eba4fe459133f0ed94c563b7c6b86be798566541e30cf1b6622bf26479633c24b12588ee73305e094aa4a4437580a9dc44b5c731712f8e0e423357fc
data/README.md CHANGED
@@ -201,6 +201,12 @@ Reinstall the app before running `snapshot`
201
201
  snapshot --reinstall_app --app_identifier "tools.fastlane.app"
202
202
  ```
203
203
 
204
+ By default `snapshot` automatically retries running UI Tests if they fail. This is due to randomly failing UI Tests (e.g. [#372](https://github.com/fastlane/snapshot/issues/372)). You can adapt this number using
205
+
206
+ ```sh
207
+ snapshot --number_of_retries 3
208
+ ```
209
+
204
210
  For a list for all available options run
205
211
 
206
212
  ```sh
@@ -10,6 +10,7 @@ import Foundation
10
10
  import XCTest
11
11
 
12
12
  var deviceLanguage = ""
13
+ var locale = ""
13
14
 
14
15
  @available(*, deprecated, message="use setupSnapshot: instead")
15
16
  func setLanguage(app: XCUIApplication) {
@@ -35,7 +36,7 @@ class Snapshot: NSObject {
35
36
  let path = "/tmp/language.txt"
36
37
 
37
38
  do {
38
- let locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
39
+ locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
39
40
  deviceLanguage = locale.substringToIndex(locale.startIndex.advancedBy(2, limit:locale.endIndex))
40
41
  app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))", "-AppleLocale", "\"\(locale)\"", "-ui_testing"]
41
42
  } catch {
@@ -1,6 +1,7 @@
1
1
  module Snapshot
2
2
  # Responsible for collecting the generated screenshots and copying them over to the output directory
3
3
  class Collector
4
+ # Returns true if it succeeds
4
5
  def self.fetch_screenshots(output, language, device_type, launch_arguments_index)
5
6
  # Documentation about how this works in the project README
6
7
  containing = File.join(TestCommandGenerator.derived_data_path, "Logs", "Test")
@@ -14,7 +15,7 @@ module Snapshot
14
15
  end
15
16
 
16
17
  if matches.count != to_store.count
17
- Helper.log.error "Looks like the number of screenshots (#{to_store.count}) doesn't match the number of names (#{matches.count})"
18
+ UI.error "Looks like the number of screenshots (#{to_store.count}) doesn't match the number of names (#{matches.count})"
18
19
  end
19
20
 
20
21
  matches.each_with_index do |current, index|
@@ -30,9 +31,9 @@ module Snapshot
30
31
  output_path = File.join(language_folder, components.join("-") + ".png")
31
32
  from_path = File.join(attachments_path, filename)
32
33
  if $verbose
33
- Helper.log.info "Copying file '#{from_path}' to '#{output_path}'...".green
34
+ UI.success "Copying file '#{from_path}' to '#{output_path}'..."
34
35
  else
35
- Helper.log.info "Copying '#{output_path}'...".green
36
+ UI.success "Copying '#{output_path}'..."
36
37
  end
37
38
  FileUtils.cp(from_path, output_path)
38
39
  end
@@ -41,10 +42,10 @@ module Snapshot
41
42
  end
42
43
 
43
44
  def self.attachments(containing)
44
- Helper.log.info "Collecting screenshots..."
45
+ UI.message "Collecting screenshots..."
45
46
 
46
47
  plist_path = Dir[File.join(containing, "*.plist")].last # we clean the folder before each run
47
- Helper.log.info "Loading up '#{plist_path}'..." if $verbose
48
+ UI.verbose "Loading up '#{plist_path}'..."
48
49
  report = Plist.parse_xml(plist_path)
49
50
 
50
51
  to_store = [] # contains the names of all the attachments we want to use
@@ -54,10 +55,7 @@ module Snapshot
54
55
  (subtest["Subtests"] || []).each do |subtest2|
55
56
  (subtest2["Subtests"] || []).each do |subtest3|
56
57
  (subtest3["ActivitySummaries"] || []).each do |activity|
57
- # We now check if it's the rotation gesture, because that's the only thing we care about
58
- if activity["Title"] == "Set device orientation to Unknown"
59
- to_store << activity["Attachments"].last["FileName"]
60
- end
58
+ check_activity(activity, to_store)
61
59
  end
62
60
  end
63
61
  end
@@ -65,9 +63,19 @@ module Snapshot
65
63
  end
66
64
  end
67
65
 
68
- Helper.log.info "Found #{to_store.count} screenshots..."
69
- Helper.log.info "Found #{to_store.join(', ')}" if $verbose
66
+ UI.message "Found #{to_store.count} screenshots..."
67
+ UI.verbose "Found #{to_store.join(', ')}"
70
68
  return to_store
71
69
  end
70
+
71
+ def self.check_activity(activity, to_store)
72
+ # We now check if it's the rotation gesture, because that's the only thing we care about
73
+ if activity["Title"] == "Set device orientation to Unknown"
74
+ to_store << activity["Attachments"].last["FileName"]
75
+ end
76
+ (activity["SubActivities"] || []).each do |subactivity|
77
+ check_activity(subactivity, to_store)
78
+ end
79
+ end
72
80
  end
73
81
  end
@@ -9,41 +9,41 @@ module Snapshot
9
9
 
10
10
  def self.check_xcode_select
11
11
  unless `xcode-select -v`.include? "xcode-select version"
12
- Helper.log.fatal '#############################################################'
13
- Helper.log.fatal "# You have to install the Xcode commdand line tools to use snapshot"
14
- Helper.log.fatal "# Install the latest version of Xcode from the AppStore"
15
- Helper.log.fatal "# Run xcode-select --install to install the developer tools"
16
- Helper.log.fatal '#############################################################'
17
- raise "Run 'xcode-select --install' and start snapshot again"
12
+ UI.error '#############################################################'
13
+ UI.error "# You have to install the Xcode commdand line tools to use snapshot"
14
+ UI.error "# Install the latest version of Xcode from the AppStore"
15
+ UI.error "# Run xcode-select --install to install the developer tools"
16
+ UI.error '#############################################################'
17
+ UI.user_error!("Run 'xcode-select --install' and start snapshot again")
18
18
  end
19
19
 
20
20
  if Snapshot::LatestIosVersion.version.to_f < 9 # to_f is bad, but should be good enough
21
- Helper.log.fatal '#############################################################'
22
- Helper.log.fatal "# Your xcode-select Xcode version is below 7.0"
23
- Helper.log.fatal "# To use snapshot 1.0 and above you need at least iOS 9"
24
- Helper.log.fatal "# Set the path to the Xcode version that supports UI Tests"
25
- Helper.log.fatal "# or downgrade to versions older than snapshot 1.0"
26
- Helper.log.fatal '#############################################################'
27
- raise "Run 'sudo xcode-select -s /Applications/Xcode-beta.app'"
21
+ UI.error '#############################################################'
22
+ UI.error "# Your xcode-select Xcode version is below 7.0"
23
+ UI.error "# To use snapshot 1.0 and above you need at least iOS 9"
24
+ UI.error "# Set the path to the Xcode version that supports UI Tests"
25
+ UI.error "# or downgrade to versions older than snapshot 1.0"
26
+ UI.error '#############################################################'
27
+ UI.user_error!("Run 'sudo xcode-select -s /Applications/Xcode-beta.app'")
28
28
  end
29
29
  end
30
30
 
31
31
  def self.check_simulators
32
- Helper.log.debug "Found #{FastlaneCore::Simulator.all.count} simulators." if $verbose
32
+ UI.verbose("Found #{FastlaneCore::Simulator.all.count} simulators.")
33
33
  if FastlaneCore::Simulator.all.count == 0
34
- Helper.log.fatal '#############################################################'
35
- Helper.log.fatal "# You have to add new simulators using Xcode"
36
- Helper.log.fatal "# You can let snapshot create new simulators: 'snapshot reset_simulators'"
37
- Helper.log.fatal "# Manually: Xcode => Window => Devices"
38
- Helper.log.fatal "# Please run `instruments -s` to verify your xcode path"
39
- Helper.log.fatal '#############################################################'
40
- raise "Create the new simulators and run this script again"
34
+ UI.error '#############################################################'
35
+ UI.error "# You have to add new simulators using Xcode"
36
+ UI.error "# You can let snapshot create new simulators: 'snapshot reset_simulators'"
37
+ UI.error "# Manually: Xcode => Window => Devices"
38
+ UI.error "# Please run `instruments -s` to verify your xcode path"
39
+ UI.error '#############################################################'
40
+ UI.user_error!("Create the new simulators and run this script again")
41
41
  end
42
42
  end
43
43
 
44
44
  def self.check_simctl
45
45
  unless `xcrun simctl`.include? "openurl"
46
- raise "Could not find `xcrun simctl`. Make sure you have the latest version of Xcode and Mac OS installed.".red
46
+ UI.user_error!("Could not find `xcrun simctl`. Make sure you have the latest version of Xcode and Mac OS installed.")
47
47
  end
48
48
  end
49
49
  end
@@ -1,9 +1,5 @@
1
1
  module Snapshot
2
- # This classes methods are called when something goes wrong in the building process
3
2
  class ErrorHandler
4
- class TestsFailedException < StandardError
5
- end
6
-
7
3
  class << self
8
4
  # @param [Array] The output of the errored build (line by line)
9
5
  # This method should raise an exception in any case, as the return code indicated a failed build
@@ -11,23 +7,16 @@ module Snapshot
11
7
  # The order of the handling below is import
12
8
 
13
9
  if return_code == 65
14
- raise TestsFailedException.new, "Tests failed - check out the log above".red
10
+ UI.user_error!("Tests failed - check out the log above")
15
11
  end
16
12
 
17
13
  case output
18
14
  when /com\.apple\.CoreSimulator\.SimError/
19
- print "The simulator failed to launch - retrying..."
15
+ UI.important "The simulator failed to launch - retrying..."
20
16
  when /is not configured for Running/
21
- raise TestsFailedException.new, "Scheme is not properly configured, make sure to check out the snapshot README"
17
+ UI.user_error!("Scheme is not properly configured, make sure to check out the snapshot README")
22
18
  end
23
19
  end
24
-
25
- private
26
-
27
- # Just to make things easier
28
- def print(text)
29
- Helper.log.error text.red
30
- end
31
20
  end
32
21
  end
33
22
  end
@@ -10,7 +10,7 @@ module Snapshot
10
10
  # First we need to kill the simulator
11
11
  Snapshot.kill_simulator
12
12
 
13
- Helper.log.debug "Patching '#{config_path}' to scale simulator to 100%"
13
+ UI.message "Patching '#{config_path}' to scale simulator to 100%"
14
14
 
15
15
  FastlaneCore::Simulator.all.each do |simulator|
16
16
  simulator_name = simulator.name.tr("\s", "-")
@@ -62,11 +62,6 @@ module Snapshot
62
62
  description: "By default, the latest version should be used automatically. If you want to change it, do it here",
63
63
  short_option: "-i",
64
64
  default_value: Snapshot::LatestIosVersion.version),
65
- FastlaneCore::ConfigItem.new(key: :stop_after_first_error,
66
- env_name: 'SNAPSHOT_BREAK_ON_FIRST_ERROR',
67
- description: "Should snapshot stop immediately after one of the tests failed on one device?",
68
- default_value: false,
69
- is_string: false),
70
65
  FastlaneCore::ConfigItem.new(key: :skip_open_summary,
71
66
  env_name: 'SNAPSHOT_SKIP_OPEN_SUMMARY',
72
67
  description: "Don't open the HTML summary after running `snapshot`",
@@ -121,7 +116,18 @@ module Snapshot
121
116
  short_option: "-s",
122
117
  env_name: 'SNAPSHOT_SCHEME',
123
118
  description: "The scheme you want to use, this must be the scheme for the UI Tests",
124
- optional: true) # optional true because we offer a picker to the user
119
+ optional: true), # optional true because we offer a picker to the user
120
+ FastlaneCore::ConfigItem.new(key: :number_of_retries,
121
+ short_option: "-n",
122
+ env_name: 'SNAPSHOT_NUMBER_OF_RETRIES',
123
+ description: "The number of times a test can fail before snapshot should stop retrying",
124
+ type: Integer,
125
+ default_value: 1),
126
+ FastlaneCore::ConfigItem.new(key: :stop_after_first_error,
127
+ env_name: 'SNAPSHOT_BREAK_ON_FIRST_ERROR',
128
+ description: "Should snapshot stop immediately after the tests completely failed on one device?",
129
+ default_value: false,
130
+ is_string: false)
125
131
  ]
126
132
  end
127
133
  end
@@ -4,7 +4,7 @@ require 'fastimage'
4
4
  module Snapshot
5
5
  class ReportsGenerator
6
6
  def generate
7
- Helper.log.info "Generating HTML Report"
7
+ UI.message "Generating HTML Report"
8
8
 
9
9
  screens_path = Snapshot.config[:output_directory]
10
10
 
@@ -34,7 +34,7 @@ module Snapshot
34
34
  File.write(export_path, html)
35
35
 
36
36
  export_path = File.expand_path(export_path)
37
- Helper.log.info "Successfully created HTML file with an overview of all the screenshots: '#{export_path}'".green
37
+ UI.success "Successfully created HTML file with an overview of all the screenshots: '#{export_path}'"
38
38
  system("open '#{export_path}'") unless Snapshot.config[:skip_open_summary]
39
39
  end
40
40
 
@@ -3,14 +3,18 @@ require 'plist'
3
3
 
4
4
  module Snapshot
5
5
  class Runner
6
- attr_accessor :number_of_retries
6
+ # The number of times we failed on launching the simulator... sigh
7
+ attr_accessor :number_of_retries_due_to_failing_simulator
8
+
9
+ # All the errors we experience while running snapshot
10
+ attr_accessor :collected_errors
7
11
 
8
12
  def work
9
13
  if File.exist?("./fastlane/snapshot.js") or File.exist?("./snapshot.js")
10
- Helper.log.warn "Found old snapshot configuration file 'snapshot.js'".red
11
- Helper.log.warn "You updated to snapshot 1.0 which now uses UI Automation".red
12
- Helper.log.warn "Please follow the migration guide: https://github.com/fastlane/snapshot/blob/master/MigrationGuide.md".red
13
- Helper.log.warn "And read the updated documentation: https://github.com/fastlane/snapshot".red
14
+ UI.error "Found old snapshot configuration file 'snapshot.js'"
15
+ UI.error "You updated to snapshot 1.0 which now uses UI Automation"
16
+ UI.error "Please follow the migration guide: https://github.com/fastlane/snapshot/blob/master/MigrationGuide.md"
17
+ UI.error "And read the updated documentation: https://github.com/fastlane/snapshot"
14
18
  sleep 3 # to be sure the user sees this, as compiling clears the screen
15
19
  end
16
20
 
@@ -20,10 +24,10 @@ module Snapshot
20
24
 
21
25
  clear_previous_screenshots if Snapshot.config[:clear_previous_screenshots]
22
26
 
23
- Helper.log.info "Building and running project - this might take some time...".green
27
+ UI.success "Building and running project - this might take some time..."
24
28
 
25
- self.number_of_retries = 0
26
- errors = []
29
+ self.number_of_retries_due_to_failing_simulator = 0
30
+ self.collected_errors = []
27
31
  results = {} # collect all the results for a nice table
28
32
  launch_arguments_set = config_launch_arguments
29
33
  Snapshot.config[:devices].each do |device|
@@ -31,22 +35,14 @@ module Snapshot
31
35
  Snapshot.config[:languages].each do |language|
32
36
  results[device] ||= {}
33
37
 
34
- begin
35
- results[device][language] = launch(language, device, launch_arguments)
36
- rescue => ex
37
- Helper.log.error ex # we should to show right here as well
38
- Helper.log.error "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
39
- errors << ex
40
- results[device][language] = false
41
- raise ex if Snapshot.config[:stop_after_first_error]
42
- end
38
+ results[device][language] = run_for_device_and_language(language, device, launch_arguments)
43
39
  end
44
40
  end
45
41
  end
46
42
 
47
43
  print_results(results)
48
44
 
49
- raise errors.join('; ') if errors.count > 0
45
+ raise self.collected_errors.join('; ') if self.collected_errors.count > 0
50
46
 
51
47
  # Generate HTML report
52
48
  ReportsGenerator.new.generate
@@ -55,6 +51,24 @@ module Snapshot
55
51
  FileUtils.rm_rf(TestCommandGenerator.derived_data_path)
56
52
  end
57
53
 
54
+ # This is its own method so that it can re-try if the tests fail randomly
55
+ # @return true/false depending on if the tests succeded
56
+ def run_for_device_and_language(language, device, launch_arguments, retries = 0)
57
+ return launch(language, device, launch_arguments)
58
+ rescue => ex
59
+ UI.error ex.to_s # show the reason for failure to the user, but still maybe retry
60
+
61
+ if retries < Snapshot.config[:number_of_retries]
62
+ UI.important "Tests failed, re-trying #{retries + 1} out of #{Snapshot.config[:number_of_retries] + 1} times"
63
+ run_for_device_and_language(language, device, launch_arguments, retries + 1)
64
+ else
65
+ UI.error "Backtrace:\n\t#{ex.backtrace.join("\n\t")}" if $verbose
66
+ self.collected_errors << ex
67
+ raise ex if Snapshot.config[:stop_after_first_error]
68
+ return false # for the results
69
+ end
70
+ end
71
+
58
72
  def config_launch_arguments
59
73
  launch_arguments = Array(Snapshot.config[:launch_arguments])
60
74
  # if more than 1 set of arguments, use a tuple with an index
@@ -87,6 +101,7 @@ module Snapshot
87
101
  puts ""
88
102
  end
89
103
 
104
+ # Returns true if it succeded
90
105
  def launch(language, device_type, launch_arguments)
91
106
  screenshots_path = TestCommandGenerator.derived_data_path
92
107
  FileUtils.rm_rf(File.join(screenshots_path, "Logs"))
@@ -105,7 +120,7 @@ module Snapshot
105
120
 
106
121
  command = TestCommandGenerator.generate(device_type: device_type)
107
122
 
108
- Helper.log_alert("#{device_type} - #{language}")
123
+ UI.header("#{device_type} - #{language}")
109
124
 
110
125
  prefix_hash = [
111
126
  {
@@ -125,14 +140,14 @@ module Snapshot
125
140
  ErrorHandler.handle_test_error(output, return_code)
126
141
 
127
142
  # no exception raised... that means we need to retry
128
- Helper.log.info "Caught error... #{return_code}".red
143
+ UI.error "Caught error... #{return_code}"
129
144
 
130
- self.number_of_retries += 1
131
- if self.number_of_retries < 20
145
+ self.number_of_retries_due_to_failing_simulator += 1
146
+ if self.number_of_retries_due_to_failing_simulator < 20
132
147
  launch(language, device_type, launch_arguments)
133
148
  else
134
149
  # It's important to raise an error, as we don't want to collect the screenshots
135
- raise "Too many errors... no more retries...".red
150
+ UI.crash!("Too many errors... no more retries...")
136
151
  end
137
152
  end)
138
153
 
@@ -141,19 +156,19 @@ module Snapshot
141
156
  end
142
157
 
143
158
  def uninstall_app(device_type)
144
- Helper.log.debug "Uninstalling app '#{Snapshot.config[:app_identifier]}' from #{device_type}..."
159
+ UI.verbose "Uninstalling app '#{Snapshot.config[:app_identifier]}' from #{device_type}..."
145
160
  Snapshot.config[:app_identifier] ||= ask("App Identifier: ")
146
161
  device_udid = TestCommandGenerator.device_udid(device_type)
147
162
 
148
- Helper.log.info "Launch Simulator #{device_type}".yellow
149
- `xcrun instruments -w #{device_udid} &> /dev/null`
163
+ UI.message "Launch Simulator #{device_type}"
164
+ Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
150
165
 
151
- Helper.log.info "Uninstall application #{Snapshot.config[:app_identifier]}".yellow
152
- `xcrun simctl uninstall #{device_udid} #{Snapshot.config[:app_identifier]} &> /dev/null`
166
+ UI.message "Uninstall application #{Snapshot.config[:app_identifier]}"
167
+ Helper.backticks("xcrun simctl uninstall #{device_udid} #{Snapshot.config[:app_identifier]} &> /dev/null")
153
168
  end
154
169
 
155
170
  def clear_previous_screenshots
156
- Helper.log.info "Clearing previously generated screenshots".yellow
171
+ UI.important "Clearing previously generated screenshots"
157
172
  path = File.join(".", Snapshot.config[:output_directory], "*", "*.png")
158
173
  Dir[path].each do |current|
159
174
  File.delete(current)
@@ -167,9 +182,9 @@ module Snapshot
167
182
  content = File.read(path)
168
183
 
169
184
  if content.include?("start.pressForDuration(0, thenDragToCoordinate: finish)")
170
- Helper.log.error "Your '#{path}' is outdated, please run `snapshot update`".red
171
- Helper.log.error "to update your Helper file".red
172
- raise "Please update your Snapshot Helper file".red
185
+ UI.error "Your '#{path}' is outdated, please run `snapshot update`"
186
+ UI.error "to update your Helper file"
187
+ UI.user_error!("Please update your Snapshot Helper file")
173
188
  end
174
189
  end
175
190
  end
@@ -3,13 +3,13 @@ module Snapshot
3
3
  class ScreenshotFlatten
4
4
  # @param (String) The path in which the screenshots are located in
5
5
  def run(path)
6
- Helper.log.info "Removing the alpha channel from generated png files"
6
+ UI.message "Removing the alpha channel from generated png files"
7
7
  flatten(path)
8
8
  end
9
9
 
10
10
  def flatten(path)
11
11
  Dir.glob([path, '/**/*.png'].join('/')).each do |file|
12
- Helper.log.info "Removing alpha channel from '#{file}'" if $verbose
12
+ UI.verbose("Removing alpha channel from '#{file}'")
13
13
  `sips -s format bmp '#{file}' &> /dev/null` # &> /dev/null because there is warning because of the extension
14
14
  `sips -s format png '#{file}'`
15
15
  end
@@ -5,13 +5,13 @@ module Snapshot
5
5
  class ScreenshotRotate
6
6
  # @param (String) The path in which the screenshots are located in
7
7
  def run(path)
8
- Helper.log.debug "Rotating the screenshots (if necessary)"
8
+ UI.verbose "Rotating the screenshots (if necessary)"
9
9
  rotate(path)
10
10
  end
11
11
 
12
12
  def rotate(path)
13
13
  Dir.glob([path, '/**/*.png'].join('/')).each do |file|
14
- Helper.log.debug "Rotating '#{file}'" if $verbose
14
+ UI.verbose "Rotating '#{file}'"
15
15
 
16
16
  command = nil
17
17
  if file.end_with? "landscapeleft.png"
@@ -10,23 +10,21 @@ module Snapshot
10
10
  gem_path = Helper.gem_path("snapshot")
11
11
  paths = self.class.find_helper
12
12
 
13
- Helper.log.info "Found the following SnapshotHelper:"
14
- puts ''
15
- paths.each { |p| Helper.log.info "\t#{p}" }
16
- puts ''
17
- Helper.log.info "Are you sure you want to automatically update the helpers listed above?"
18
- Helper.log.info "This will overwrite all its content with the latest code."
19
- Helper.log.info "The underlying API will not change. You can always migrate manually by looking at"
20
- Helper.log.info "https://github.com/fastlane/snapshot/blob/master/lib/assets/SnapshotHelper.swift"
13
+ UI.message "Found the following SnapshotHelper:"
14
+ paths.each { |p| UI.message "\t#{p}" }
15
+ UI.important "Are you sure you want to automatically update the helpers listed above?"
16
+ UI.message "This will overwrite all its content with the latest code."
17
+ UI.message "The underlying API will not change. You can always migrate manually by looking at"
18
+ UI.message "https://github.com/fastlane/snapshot/blob/master/lib/assets/SnapshotHelper.swift"
21
19
 
22
- return 1 unless agree("Overwrite configuration files? (y/n)".red, true)
20
+ return 1 unless UI.confirm("Overwrite configuration files?")
23
21
 
24
22
  paths.each do |path|
25
- Helper.log.info "Updating '#{path}'..."
23
+ UI.message "Updating '#{path}'..."
26
24
  File.write(path, File.read("#{gem_path}/lib/assets/SnapshotHelper.swift"))
27
25
  end
28
26
 
29
- Helper.log.info "Successfully updated helper files".green
27
+ UI.success "Successfully updated helper files"
30
28
  end
31
29
  end
32
30
  end
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  DESCRIPTION = "Automate taking localized screenshots of your iOS app on every device"
4
4
  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: 1.6.0
4
+ version: 1.7.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: 2016-02-01 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.30.0
33
+ version: 0.36.1
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.30.0
43
+ version: 0.36.1
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0