Class: AppRepo::Setup
- Inherits:
-
Object
- Object
- AppRepo::Setup
- Defined in:
- lib/apprepo/setup.rb
Overview
Responsible for setting up the Repofile configuration
Instance Method Summary collapse
- #download_manifest(apprepo_path, _options) ⇒ Object
-
#generate_apprepo_file(_apprepo_path, options) ⇒ Object
This method takes care of creating a new ‘apprepo’ folder with metadata and screenshots folders.
- #run(options) ⇒ Object
- #setup_apprepo(file_path, data, _apprepo_path, _options) ⇒ Object
Instance Method Details
#download_manifest(apprepo_path, _options) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/apprepo/setup.rb', line 30 def download_manifest(apprepo_path, ) path = File.join(apprepo_path, 'metadata') FileUtils.mkdir_p(path) UI.success("TODO: DOWNLOAD MANIFEST'") AppRepo::Uploader.new().download_manifest_only end |
#generate_apprepo_file(_apprepo_path, options) ⇒ Object
This method takes care of creating a new ‘apprepo’ folder with metadata and screenshots folders
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/apprepo/setup.rb', line 16 def generate_apprepo_file(_apprepo_path, ) # v = options[:app].latest_version # generate_apprepo_file(v, File.join(apprepo_path, 'manifest.json')) # Generate the final Repofile here gem_path = Helper.gem_path('apprepo') apprepo = File.read("#{gem_path}/../assets/RepofileDefault") apprepo.gsub!('[[APP_IDENTIFIER]]', [:app].bundle_id) apprepo.gsub!('[[APPREPO_IPA_PATH]]', [:app].file_path) apprepo.gsub!('[[APP_VERSION]]', [:app].version) apprepo.gsub!('[[APP_NAME]]', [:app].name) # apprepo (was deliver) end |
#run(options) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/apprepo/setup.rb', line 37 def run() UI.('[AppRepo:Setup] Running...') containing = (File.directory?('fastlane') ? 'fastlane' : '.') file_path = File.join(containing, 'Repofile') data = generate_apprepo_file(containing, ) setup_apprepo(file_path, data, containing, ) end |
#setup_apprepo(file_path, data, _apprepo_path, _options) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/apprepo/setup.rb', line 4 def setup_apprepo(file_path, data, _apprepo_path, ) UI.('[AppRepo:Setup] Setting up...') File.write(file_path, data) # TODO: implement later download_manifest(apprepo_path, ) UI.success("NOT! created new Repofile at path '#{file_path}'") end |