Class: Mysigner::Export::Exporter
- Inherits:
-
Object
- Object
- Mysigner::Export::Exporter
- Defined in:
- lib/mysigner/export/exporter.rb
Defined Under Namespace
Classes: ExportError
Instance Method Summary collapse
- #export!(method: :appstore, team_id: nil, signing_style: 'automatic') ⇒ Object
-
#initialize(archive_path, output_dir: nil) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(archive_path, output_dir: nil) ⇒ Exporter
Returns a new instance of Exporter.
12 13 14 15 16 17 |
# File 'lib/mysigner/export/exporter.rb', line 12 def initialize(archive_path, output_dir: nil) @archive_path = File.(archive_path) @output_dir = output_dir || File.dirname(@archive_path) validate_archive! end |
Instance Method Details
#export!(method: :appstore, team_id: nil, signing_style: 'automatic') ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mysigner/export/exporter.rb', line 19 def export!(method: :appstore, team_id: nil, signing_style: 'automatic') say_exporting(method) # Generate export options plist = (method, team_id, signing_style) begin # Run xcodebuild -exportArchive success = execute_export() raise ExportError, 'Export failed. Check output above for errors.' unless success # Find the generated .ipa file ipa_path = find_ipa_file raise ExportError, "Export reported success but .ipa file not found in: #{@output_dir}" unless ipa_path ipa_path ensure # Clean up temp plist File.delete() if && File.exist?() end end |