Class: Snapshot::Update
- Inherits:
-
Object
- Object
- Snapshot::Update
- Defined in:
- lib/snapshot/update.rb
Overview
Migrate helper files
Class Method Summary collapse
-
.find_helper ⇒ Array
A list of helper files (usually just one).
Instance Method Summary collapse
Class Method Details
.find_helper ⇒ Array
Returns A list of helper files (usually just one).
5 6 7 |
# File 'lib/snapshot/update.rb', line 5 def self.find_helper Dir["./**/SnapshotHelper.swift"] end |
Instance Method Details
#update ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/snapshot/update.rb', line 9 def update paths = self.class.find_helper UI. "Found the following SnapshotHelper:" paths.each { |p| UI. "\t#{p}" } UI.important "Are you sure you want to automatically update the helpers listed above?" UI. "This will overwrite all its content with the latest code." UI. "The underlying API will not change. You can always migrate manually by looking at" UI. "https://github.com/fastlane/fastlane/blob/master/snapshot/lib/assets/SnapshotHelper.swift" return 1 unless UI.confirm("Overwrite configuration files?") paths.each do |path| UI. "Updating '#{path}'..." File.write(path, File.read("#{Snapshot::ROOT}/lib/assets/SnapshotHelper.swift")) end UI.success "Successfully updated helper files" end |