Class: Fastlane::Helper::UpdateDmgHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::UpdateDmgHelper
- Defined in:
- lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb
Instance Attribute Summary collapse
-
#output_filename ⇒ Object
Returns the value of attribute output_filename.
-
#source ⇒ Object
Returns the value of attribute source.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(params: nil) ⇒ UpdateDmgHelper
constructor
A new instance of UpdateDmgHelper.
- #update_dmg_parameters ⇒ Object
Constructor Details
#initialize(params: nil) ⇒ UpdateDmgHelper
Returns a new instance of UpdateDmgHelper.
8 9 10 11 12 13 14 15 |
# File 'lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb', line 8 def initialize(params: nil) self.params = params self.verbose = self.params[:verbose] == true self.source = File.(self.params[:source]) source_basename_no_extension = File.basename(self.source, File.extname(source)) output_filename = self.params[:output_filename] || "#{File.dirname(self.source)}/#{source_basename_no_extension}.dmg" self.output_filename = File.(output_filename) end |
Instance Attribute Details
#output_filename ⇒ Object
Returns the value of attribute output_filename.
6 7 8 |
# File 'lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb', line 6 def output_filename @output_filename end |
#source ⇒ Object
Returns the value of attribute source.
6 7 8 |
# File 'lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb', line 6 def source @source end |
#verbose ⇒ Object
Returns the value of attribute verbose.
6 7 8 |
# File 'lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb', line 6 def verbose @verbose end |
Instance Method Details
#update_dmg_parameters ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb', line 17 def update_dmg_parameters parameters = { '--source' => self.source, '--output-dmg' => self.output_filename, '--template-dmg' => self.params[:template] } update_dmg_parameters = [] parameters.each do |key, value| if value update_dmg_parameters << key.to_s update_dmg_parameters << value.to_s end end update_dmg_parameters << '--hdiutil-verbose' if self.params[:hdiutil_verbose] update_dmg_parameters << '--hdiutil-quiet' if self.params[:hdiutil_quiet] return update_dmg_parameters end |