Class: PodPrebuild::Output
- Inherits:
-
Object
- Object
- PodPrebuild::Output
- Defined in:
- lib/cocoapods-binary-ht/prebuild_output/output.rb
Instance Method Summary collapse
- #clean_delta_file ⇒ Object
- #create_dir_if_needed(dir) ⇒ Object
- #delta_dir ⇒ Object
-
#initialize(prebuild_sandbox) ⇒ Output
constructor
A new instance of Output.
- #prebuild_delta_path ⇒ Object
- #write_delta_file(options) ⇒ Object
Constructor Details
#initialize(prebuild_sandbox) ⇒ Output
Returns a new instance of Output.
6 7 8 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 6 def initialize(prebuild_sandbox) @sandbox = prebuild_sandbox end |
Instance Method Details
#clean_delta_file ⇒ Object
18 19 20 21 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 18 def clean_delta_file Pod::UI. "Clean delta file: #{prebuild_delta_path}" FileUtils.rm_rf(prebuild_delta_path) end |
#create_dir_if_needed(dir) ⇒ Object
23 24 25 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 23 def create_dir_if_needed(dir) FileUtils.mkdir_p dir unless File.directory?(dir) end |
#delta_dir ⇒ Object
14 15 16 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 14 def delta_dir @delta_dir ||= File.dirname(prebuild_delta_path) end |
#prebuild_delta_path ⇒ Object
10 11 12 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 10 def prebuild_delta_path @prebuild_delta_path ||= PodPrebuild.config.prebuild_delta_path end |
#write_delta_file(options) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cocoapods-binary-ht/prebuild_output/output.rb', line 27 def write_delta_file() updated = [:updated] deleted = [:deleted] if updated.empty? && deleted.empty? Pod::UI.puts "No changes in prebuild" return end Pod::UI. "Write prebuild changes to: #{prebuild_delta_path}" create_dir_if_needed(delta_dir) changes = PodPrebuild::JSONFile.new(prebuild_delta_path) changes["updated"] = updated changes["deleted"] = deleted changes.save! end |