_id
stringlengths
2
6
title
stringlengths
9
130
partition
stringclasses
3 values
text
stringlengths
66
10.5k
language
stringclasses
1 value
meta_information
dict
q10500
Match.Runner.prefixed_working_directory
train
def prefixed_working_directory(working_directory) if self.storage_mode == "git" return working_directory elsif self.storage_mode == "google_cloud" # We fall back to "*", which means certificates and profiles # from all teams that use this bucket would be installed. This is not ideal,...
ruby
{ "resource": "" }
q10501
Fastlane.SetupIos.find_and_setup_xcode_project
train
def find_and_setup_xcode_project(ask_for_scheme: true) UI.message("Parsing your local Xcode project to find the available schemes and the app identifier") config = {} # this is needed as the first method call will store information in there if self.project_path.end_with?("xcworkspace") config[...
ruby
{ "resource": "" }
q10502
Spaceship.Client.team_id=
train
def team_id=(team_id) # First, we verify the team actually exists, because otherwise iTC would return the # following confusing error message # # invalid content provider id # available_teams = teams.collect do |team| { team_id: (team["contentProvider"] || {})["...
ruby
{ "resource": "" }
q10503
Spaceship.Client.persistent_cookie_path
train
def persistent_cookie_path if ENV["SPACESHIP_COOKIE_PATH"] path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie")) else [File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir| ...
ruby
{ "resource": "" }
q10504
Spaceship.Client.paging
train
def paging page = 0 results = [] loop do page += 1 current = yield(page) results += current break if (current || []).count < page_size # no more results end return results end
ruby
{ "resource": "" }
q10505
Spaceship.Client.login
train
def login(user = nil, password = nil) if user.to_s.empty? || password.to_s.empty? require 'credentials_manager/account_manager' puts("Reading keychain entry, because either user or password were empty") if Spaceship::Globals.verbose? keychain_entry = CredentialsManager::AccountManager.ne...
ruby
{ "resource": "" }
q10506
Spaceship.Client.send_shared_login_request
train
def send_shared_login_request(user, password) # Check if we have a cached/valid session # # Background: # December 4th 2017 Apple introduced a rate limit - which is of course fine by itself - # but unfortunately also rate limits successful logins. If you call multiple tools in a # la...
ruby
{ "resource": "" }
q10507
Spaceship.Client.fetch_program_license_agreement_messages
train
def fetch_program_license_agreement_messages all_messages = [] messages_request = request(:get, "https://appstoreconnect.apple.com/olympus/v1/contractMessages") body = messages_request.body if body body = JSON.parse(body) if body.kind_of?(String) body.map do |messages| ...
ruby
{ "resource": "" }
q10508
Spaceship.Client.raise_insufficient_permission_error!
train
def raise_insufficient_permission_error!(additional_error_string: nil, caller_location: 2) # get the method name of the request that failed # `block in` is used very often for requests when surrounded for paging or retrying blocks # The ! is part of some methods when they modify or delete a resource, ...
ruby
{ "resource": "" }
q10509
Spaceship.Client.send_request
train
def send_request(method, url_or_path, params, headers, &block) with_retry do response = @client.send(method, url_or_path, params, headers, &block) log_response(method, url_or_path, response, headers, &block) resp_hash = response.to_hash if resp_hash[:status] == 401 msg =...
ruby
{ "resource": "" }
q10510
Deliver.HtmlGenerator.render_relative_path
train
def render_relative_path(export_path, path) export_path = Pathname.new(export_path) path = Pathname.new(path).relative_path_from(export_path) return path.to_path end
ruby
{ "resource": "" }
q10511
Deliver.HtmlGenerator.render
train
def render(options, screenshots, export_path = nil) @screenshots = screenshots || [] @options = options @export_path = export_path @app_name = (options[:name]['en-US'] || options[:name].values.first) if options[:name] @app_name ||= options[:app].name @languages = options[:descripti...
ruby
{ "resource": "" }
q10512
Fastlane.FastFile.sh
train
def sh(*command, log: true, error_callback: nil, &b) FastFile.sh(*command, log: log, error_callback: error_callback, &b) end
ruby
{ "resource": "" }
q10513
Snapshot.SimulatorLauncherBase.add_media
train
def add_media(device_types, media_type, paths) media_type = media_type.to_s device_types.each do |device_type| UI.verbose("Adding #{media_type}s to #{device_type}...") device_udid = TestCommandGenerator.device_udid(device_type) UI.message("Launch Simulator #{device_type}") ...
ruby
{ "resource": "" }
q10514
Fastlane.Setup.append_lane
train
def append_lane(lane) lane.compact! # remove nil values new_lines = "\n\n" if self.is_swift_fastfile new_lines = "" unless self.fastfile_content.include?("lane() {") # the first lane we don't want new lines self.fastfile_content.gsub!("[[LANES]]", "#{new_lines}\t#{lane.join("\n\t")}[[...
ruby
{ "resource": "" }
q10515
Fastlane.Setup.add_or_update_gemfile
train
def add_or_update_gemfile(update_gemfile_if_needed: false) if gemfile_exists? ensure_gemfile_valid!(update_gemfile_if_needed: update_gemfile_if_needed) else if update_gemfile_if_needed || UI.confirm("It is recommended to run fastlane with a Gemfile set up, do you want fastlane to create one ...
ruby
{ "resource": "" }
q10516
CredentialsManager.CLI.run
train
def run program :name, 'CredentialsManager' program :version, Fastlane::VERSION program :description, 'Manage credentials for fastlane tools.' # Command to add entry to Keychain command :add do |c| c.syntax = 'fastlane fastlane-credentials add' c.description = 'Adds a fast...
ruby
{ "resource": "" }
q10517
CredentialsManager.CLI.add
train
def add(username, password) CredentialsManager::AccountManager.new( user: username, password: password ).add_to_keychain end
ruby
{ "resource": "" }
q10518
Deliver.Setup.generate_deliver_file
train
def generate_deliver_file(deliver_path, options) v = options[:app].latest_version metadata_path = options[:metadata_path] || File.join(deliver_path, 'metadata') generate_metadata_files(v, metadata_path) # Generate the final Deliverfile here return File.read(deliverfile_path) end
ruby
{ "resource": "" }
q10519
Fastlane.PluginInfoCollector.gem_name_taken?
train
def gem_name_taken?(name) require 'open-uri' require 'json' url = "https://rubygems.org/api/v1/gems/#{name}.json" response = JSON.parse(open(url).read) return !!response['version'] rescue false end
ruby
{ "resource": "" }
q10520
Fastlane.PluginInfoCollector.fix_plugin_name
train
def fix_plugin_name(name) name = name.to_s.downcase fixes = { /[\- ]/ => '_', # dashes and spaces become underscores /[^a-z0-9_]/ => '', # anything other than lower case letters, numbers and underscores is removed /fastlane[_]?/ => '', # 'fastlane' or 'fastlane_' is removed /...
ruby
{ "resource": "" }
q10521
Sigh.Resign.installed_identities
train
def installed_identities available = request_valid_identities ids = {} available.split("\n").each do |current| begin sha1 = current.match(/[a-zA-Z0-9]{40}/).to_s name = current.match(/.*\"(.*)\"/)[1] ids[sha1] = name rescue nil end # the ...
ruby
{ "resource": "" }
q10522
Supply.Listing.save
train
def save @google_api.update_listing_for_language(language: language, title: title, short_description: short_description, full_description: full_description, ...
ruby
{ "resource": "" }
q10523
CredentialsManager.AccountManager.invalid_credentials
train
def invalid_credentials(force: false) puts("The login credentials for '#{user}' seem to be wrong".red) if fetch_password_from_env puts("The password was taken from the environment variable") puts("Please make sure it is correct") return false end if force || agree("Do y...
ruby
{ "resource": "" }
q10524
CredentialsManager.AccountManager.options
train
def options hash = {} hash[:p] = ENV["FASTLANE_PATH"] if ENV["FASTLANE_PATH"] hash[:P] = ENV["FASTLANE_PORT"] if ENV["FASTLANE_PORT"] hash[:r] = ENV["FASTLANE_PROTOCOL"] if ENV["FASTLANE_PROTOCOL"] hash.empty? ? nil : hash end
ruby
{ "resource": "" }
q10525
Fastlane.InspectorReporter.inspector_started_query
train
def inspector_started_query(query, inspector) puts("") puts("Looking for related GitHub issues on #{inspector.repo_owner}/#{inspector.repo_name}...") puts("Search query: #{query}") if FastlaneCore::Globals.verbose? puts("") end
ruby
{ "resource": "" }
q10526
Fastlane.InspectorReporter.inspector_successfully_received_report
train
def inspector_successfully_received_report(report, inspector) report.issues[0..(NUMBER_OF_ISSUES_INLINE - 1)].each { |issue| print_issue_full(issue) } if report.issues.count > NUMBER_OF_ISSUES_INLINE report.url.sub!('\'', '%27') puts("and #{report.total_results - NUMBER_OF_ISSUES_INLINE} mo...
ruby
{ "resource": "" }
q10527
Spaceship.TunesClient.select_team
train
def select_team(team_id: nil, team_name: nil) t_id = (team_id || ENV['FASTLANE_ITC_TEAM_ID'] || '').strip t_name = (team_name || ENV['FASTLANE_ITC_TEAM_NAME'] || '').strip if t_name.length > 0 && t_id.length.zero? # we prefer IDs over names, they are unique puts("Looking for App Store Connect...
ruby
{ "resource": "" }
q10528
Spaceship.TunesClient.fetch_errors_in_data
train
def fetch_errors_in_data(data_section: nil, sub_section_name: nil, keys: nil) if data_section && sub_section_name sub_section = data_section[sub_section_name] else sub_section = data_section end unless sub_section return {} end error_map = {} keys.each...
ruby
{ "resource": "" }
q10529
Spaceship.TunesClient.create_application!
train
def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, itunes_connect_users: nil) puts("The `version` parameter is deprecated. Use `Spaceship::Tunes::Application.ensure_version!` method instead") if version ...
ruby
{ "resource": "" }
q10530
Spaceship.TunesClient.pricing_tiers
train
def pricing_tiers @pricing_tiers ||= begin r = request(:get, 'ra/apps/pricing/matrix') data = parse_response(r, 'data')['pricingTiers'] data.map { |tier| Spaceship::Tunes::PricingTier.factory(tier) } end end
ruby
{ "resource": "" }
q10531
Spaceship.TunesClient.supported_territories
train
def supported_territories data = supported_countries data.map { |country| Spaceship::Tunes::Territory.factory(country) } end
ruby
{ "resource": "" }
q10532
Spaceship.TunesClient.upload_watch_icon
train
def upload_watch_icon(app_version, upload_image) raise "app_version is required" unless app_version raise "upload_image is required" unless upload_image du_client.upload_watch_icon(app_version, upload_image, content_provider_id, sso_token_for_image) end
ruby
{ "resource": "" }
q10533
Spaceship.TunesClient.upload_purchase_review_screenshot
train
def upload_purchase_review_screenshot(app_id, upload_image) data = du_client.upload_purchase_review_screenshot(app_id, upload_image, content_provider_id, sso_token_for_image) { "value" => { "assetToken" => data["token"], "sortOrder" => 0, "type" => du_clie...
ruby
{ "resource": "" }
q10534
Spaceship.TunesClient.upload_screenshot
train
def upload_screenshot(app_version, upload_image, device, is_messages) raise "app_version is required" unless app_version raise "upload_image is required" unless upload_image raise "device is required" unless device du_client.upload_screenshot(app_version, upload_image, content_provider_id, sso_...
ruby
{ "resource": "" }
q10535
Spaceship.TunesClient.upload_messages_screenshot
train
def upload_messages_screenshot(app_version, upload_image, device) raise "app_version is required" unless app_version raise "upload_image is required" unless upload_image raise "device is required" unless device du_client.upload_messages_screenshot(app_version, upload_image, content_provider_id,...
ruby
{ "resource": "" }
q10536
Spaceship.TunesClient.upload_trailer_preview
train
def upload_trailer_preview(app_version, upload_trailer_preview, device) raise "app_version is required" unless app_version raise "upload_trailer_preview is required" unless upload_trailer_preview raise "device is required" unless device du_client.upload_trailer_preview(app_version, upload_trail...
ruby
{ "resource": "" }
q10537
Spaceship.TunesClient.ref_data
train
def ref_data r = request(:get, '/WebObjects/iTunesConnect.woa/ra/apps/version/ref') data = parse_response(r, 'data') Spaceship::Tunes::AppVersionRef.factory(data) end
ruby
{ "resource": "" }
q10538
Spaceship.TunesClient.all_build_trains
train
def all_build_trains(app_id: nil, platform: 'ios') platform = 'ios' if platform.nil? r = request(:get, "ra/apps/#{app_id}/buildHistory?platform=#{platform}") handle_itc_response(r.body) end
ruby
{ "resource": "" }
q10539
Spaceship.TunesClient.update_iap_family!
train
def update_iap_family!(app_id: nil, family_id: nil, data: nil) with_tunes_retry do r = request(:put) do |req| req.url("ra/apps/#{app_id}/iaps/family/#{family_id}/") req.body = data.to_json req.headers['Content-Type'] = 'application/json' end handle_itc_respons...
ruby
{ "resource": "" }
q10540
Spaceship.TunesClient.update_iap!
train
def update_iap!(app_id: nil, purchase_id: nil, data: nil) with_tunes_retry do r = request(:put) do |req| req.url("ra/apps/#{app_id}/iaps/#{purchase_id}") req.body = data.to_json req.headers['Content-Type'] = 'application/json' end handle_itc_response(r.body) ...
ruby
{ "resource": "" }
q10541
Spaceship.TunesClient.create_iap!
train
def create_iap!(app_id: nil, type: nil, versions: nil, reference_name: nil, product_id: nil, cleared_for_sale: true, review_notes: nil, review_screenshot: nil, pricing_intervals: nil, family_id: nil, subscription_duration: nil, subscription_free_trial: nil) # Load IAP Template based on Type type ||= "consum...
ruby
{ "resource": "" }
q10542
Spaceship.TunesClient.group_for_view_by
train
def group_for_view_by(view_by, measures) if view_by.nil? || measures.nil? return nil else return { metric: measures.first, dimension: view_by, rank: "DESCENDING", limit: 3 } end end
ruby
{ "resource": "" }
q10543
Snapshot.SimulatorLauncherXcode8.run_for_device_and_language
train
def run_for_device_and_language(language, locale, device, launch_arguments, retries = 0) return launch_one_at_a_time(language, locale, device, launch_arguments) rescue => ex UI.error(ex.to_s) # show the reason for failure to the user, but still maybe retry if retries < launcher_config.number_of_r...
ruby
{ "resource": "" }
q10544
Snapshot.SimulatorLauncherXcode8.launch_one_at_a_time
train
def launch_one_at_a_time(language, locale, device_type, launch_arguments) prepare_for_launch([device_type], language, locale, launch_arguments) add_media([device_type], :photo, launcher_config.add_photos) if launcher_config.add_photos add_media([device_type], :video, launcher_config.add_videos) if la...
ruby
{ "resource": "" }
q10545
FastlaneCore.Configuration.verify_default_value_matches_verify_block
train
def verify_default_value_matches_verify_block @available_options.each do |item| next unless item.verify_block && item.default_value begin unless @values[item.key] # this is important to not verify if there already is a value there item.verify_block.call(item.default_value) ...
ruby
{ "resource": "" }
q10546
FastlaneCore.Configuration.load_configuration_file
train
def load_configuration_file(config_file_name = nil, block_for_missing = nil, skip_printing_values = false) return unless config_file_name self.config_file_name = config_file_name path = FastlaneCore::Configuration.find_configuration_file_path(config_file_name: config_file_name) return if path....
ruby
{ "resource": "" }
q10547
Fastlane.OtherAction.method_missing
train
def method_missing(method_sym, *arguments, &_block) # We have to go inside the fastlane directory # since in the fastlane runner.rb we do the following # custom_dir = ".." # Dir.chdir(custom_dir) do # this goes one folder up, since we're inside the "fastlane" # folder at that poi...
ruby
{ "resource": "" }
q10548
Produce.ItunesConnect.language
train
def language @language = Produce.config[:language] converted = Spaceship::Tunes::LanguageConverter.from_itc_readable_to_itc(@language) @language = converted if converted # overwrite it with the actual value unless AvailableDefaultLanguages.all_languages.include?(@language) UI.user_erro...
ruby
{ "resource": "" }
q10549
Fastlane.Runner.find_alias
train
def find_alias(action_name) Actions.alias_actions.each do |key, v| next unless Actions.alias_actions[key] next unless Actions.alias_actions[key].include?(action_name) return key end nil end
ruby
{ "resource": "" }
q10550
Fastlane.Runner.trigger_action_by_name
train
def trigger_action_by_name(method_sym, custom_dir, from_action, *arguments) # First, check if there is a predefined method in the actions folder class_ref = class_reference_from_action_name(method_sym) unless class_ref class_ref = class_reference_from_action_alias(method_sym) # notify ...
ruby
{ "resource": "" }
q10551
Fastlane.Runner.add_lane
train
def add_lane(lane, override = false) lanes[lane.platform] ||= {} if !override && lanes[lane.platform][lane.name] UI.user_error!("Lane '#{lane.name}' was defined multiple times!") end lanes[lane.platform][lane.name] = lane end
ruby
{ "resource": "" }
q10552
Fastlane.CommandsGenerator.ensure_fastfile
train
def ensure_fastfile return true if FastlaneCore::FastlaneFolder.setup? create = UI.confirm('Could not find fastlane in current directory. Make sure to have your fastlane configuration files inside a folder called "fastlane". Would you like to set fastlane up?') if create Fastlane::Setup.start...
ruby
{ "resource": "" }
q10553
Deliver.Runner.verify_version
train
def verify_version app_version = options[:app_version] UI.message("Making sure the latest version on App Store Connect matches '#{app_version}' from the ipa file...") changed = options[:app].ensure_version!(app_version, platform: options[:platform]) if changed UI.success("Successfully ...
ruby
{ "resource": "" }
q10554
Deliver.Runner.upload_metadata
train
def upload_metadata upload_metadata = UploadMetadata.new upload_screenshots = UploadScreenshots.new # First, collect all the things for the HTML Report screenshots = upload_screenshots.collect_screenshots(options) upload_metadata.load_from_filesystem(options) # Assign "default" val...
ruby
{ "resource": "" }
q10555
Deliver.Runner.upload_binary
train
def upload_binary UI.message("Uploading binary to App Store Connect") if options[:ipa] package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate( app_id: options[:app].apple_id, ipa_path: options[:ipa], package_path: "/tmp", platform: options[:platform...
ruby
{ "resource": "" }
q10556
Supply.Uploader.upload_binary_data
train
def upload_binary_data(apk_path) apk_version_code = nil if apk_path UI.message("Preparing apk at path '#{apk_path}' for upload...") apk_version_code = client.upload_apk(apk_path) UI.user_error!("Could not upload #{apk_path}") unless apk_version_code if Supply.config[:obb_mai...
ruby
{ "resource": "" }
q10557
Supply.Uploader.all_languages
train
def all_languages Dir.entries(metadata_path) .select { |f| File.directory?(File.join(metadata_path, f)) } .reject { |f| f.start_with?('.') } .sort { |x, y| x <=> y } end
ruby
{ "resource": "" }
q10558
Supply.Uploader.upload_obbs
train
def upload_obbs(apk_path, apk_version_code) expansion_paths = find_obbs(apk_path) ['main', 'patch'].each do |type| if expansion_paths[type] upload_obb(expansion_paths[type], type, apk_version_code) end end end
ruby
{ "resource": "" }
q10559
FastlaneCore.CommanderGenerator.generate
train
def generate(options, command: nil) # First, enable `always_trace`, to show the stack trace always_trace! used_switches = [] options.each do |option| next if option.description.to_s.empty? # "private" options next unless option.display_in_shell short_switch = option.sho...
ruby
{ "resource": "" }
q10560
Scan.XCPrettyReporterOptionsGenerator.generate_reporter_options
train
def generate_reporter_options reporter = [] valid_types = @output_types & SUPPORTED_REPORT_TYPES valid_types.each do |raw_type| type = raw_type.strip output_path = File.join(File.expand_path(@output_directory), determine_output_file_name(type)) reporter << "--report #{type}" ...
ruby
{ "resource": "" }
q10561
Supply.Client.abort_current_edit
train
def abort_current_edit ensure_active_edit! call_google_api { client.delete_edit(current_package_name, current_edit.id) } self.current_edit = nil self.current_package_name = nil end
ruby
{ "resource": "" }
q10562
Supply.Client.commit_current_edit!
train
def commit_current_edit! ensure_active_edit! call_google_api { client.commit_edit(current_package_name, current_edit.id) } self.current_edit = nil self.current_package_name = nil end
ruby
{ "resource": "" }
q10563
Supply.Client.listing_for_language
train
def listing_for_language(language) ensure_active_edit! begin result = client.get_listing( current_package_name, current_edit.id, language ) return Listing.new(self, language, result) rescue Google::Apis::ClientError => e return Listing.ne...
ruby
{ "resource": "" }
q10564
Supply.Client.apks_version_codes
train
def apks_version_codes ensure_active_edit! result = call_google_api { client.list_apks(current_package_name, current_edit.id) } return Array(result.apks).map(&:version_code) end
ruby
{ "resource": "" }
q10565
Supply.Client.aab_version_codes
train
def aab_version_codes ensure_active_edit! result = call_google_api { client.list_edit_bundles(current_package_name, current_edit.id) } return Array(result.bundles).map(&:version_code) end
ruby
{ "resource": "" }
q10566
Supply.Client.track_version_codes
train
def track_version_codes(track) ensure_active_edit! begin result = client.get_track( current_package_name, current_edit.id, track ) return result.version_codes || [] rescue Google::Apis::ClientError => e return [] if e.status_code == 404 &&...
ruby
{ "resource": "" }
q10567
Fastlane.PluginManager.available_gems
train
def available_gems return [] unless gemfile_path dsl = Bundler::Dsl.evaluate(gemfile_path, nil, true) return dsl.dependencies.map(&:name) end
ruby
{ "resource": "" }
q10568
Fastlane.PluginManager.plugin_is_added_as_dependency?
train
def plugin_is_added_as_dependency?(plugin_name) UI.user_error!("fastlane plugins must start with '#{self.class.plugin_prefix}' string") unless plugin_name.start_with?(self.class.plugin_prefix) return available_plugins.include?(plugin_name) end
ruby
{ "resource": "" }
q10569
Fastlane.PluginManager.attach_plugins_to_gemfile!
train
def attach_plugins_to_gemfile!(path_to_gemfile) content = gemfile_content || (AUTOGENERATED_LINE + GEMFILE_SOURCE_LINE) # We have to make sure fastlane is also added to the Gemfile, since we now use # bundler to run fastlane content += "\ngem 'fastlane'\n" unless available_gems.include?('fastla...
ruby
{ "resource": "" }
q10570
Fastlane.PluginManager.print_plugin_information
train
def print_plugin_information(references) rows = references.collect do |current| if current[1][:actions].empty? # Something is wrong with this plugin, no available actions [current[0].red, current[1][:version_number], "No actions found".red] else [current[0], current[1...
ruby
{ "resource": "" }
q10571
Screengrab.Runner.if_device_path_exists
train
def if_device_path_exists(device_serial, device_path) return if run_adb_command("adb -s #{device_serial} shell ls #{device_path}", print_all: false, print_command: false).include?('No such file') yield(device_path) rescue # Some vers...
ruby
{ "resource": "" }
q10572
Screengrab.Runner.installed_packages
train
def installed_packages(device_serial) packages = run_adb_command("adb -s #{device_serial} shell pm list packages", print_all: true, print_command: true) packages.split("\n").map { |package| package.gsub("package:", "") } end
ruby
{ "resource": "" }
q10573
Sigh.Runner.fetch_profiles
train
def fetch_profiles UI.message("Fetching profiles...") results = profile_type.find_by_bundle_id(bundle_id: Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos', sub_platform: Sigh.config[:pla...
ruby
{ "resource": "" }
q10574
Sigh.Runner.create_profile!
train
def create_profile! cert = certificate_to_use bundle_id = Sigh.config[:app_identifier] name = Sigh.config[:provisioning_name] || [bundle_id, profile_type.pretty_type].join(' ') unless Sigh.config[:skip_fetch_profiles] if Spaceship.provisioning_profile.all.find { |p| p.name == name } ...
ruby
{ "resource": "" }
q10575
Sigh.Runner.certificate_to_use
train
def certificate_to_use certificates = certificates_for_profile_and_platform # Filter them certificates = certificates.find_all do |c| if Sigh.config[:cert_id] next unless c.id == Sigh.config[:cert_id].strip end if Sigh.config[:cert_owner_name] next unless ...
ruby
{ "resource": "" }
q10576
Sigh.Runner.download_profile
train
def download_profile(profile) UI.important("Downloading provisioning profile...") profile_name ||= "#{profile_type.pretty_type}_#{Sigh.config[:app_identifier]}" if Sigh.config[:platform].to_s == 'tvos' profile_name += "_tvos" end if Sigh.config[:platform].to_s == 'macos' ...
ruby
{ "resource": "" }
q10577
Sigh.Runner.ensure_app_exists!
train
def ensure_app_exists! return if Spaceship::App.find(Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos') print_produce_command(Sigh.config) UI.user_error!("Could not find App with App Identifier '#{Sigh.config[:app_identifier]}'") end
ruby
{ "resource": "" }
q10578
Sigh.DownloadAll.download_all
train
def download_all(download_xcode_profiles: false) UI.message("Starting login with user '#{Sigh.config[:username]}'") Spaceship.login(Sigh.config[:username], nil) Spaceship.select_team UI.message("Successfully logged in") Spaceship.provisioning_profile.all(xcode: download_xcode_profiles).ea...
ruby
{ "resource": "" }
q10579
Fastlane.SocketServer.handle_control_command
train
def handle_control_command(command) exit_reason = nil if command.cancel_signal? UI.verbose("received cancel signal shutting down, reason: #{command.reason}") # send an ack to the client to let it know we're shutting down cancel_response = '{"payload":{"status":"cancelled"}}' ...
ruby
{ "resource": "" }
q10580
Fastlane.SocketServer.send_response
train
def send_response(json) UI.verbose("sending #{json}") begin @client.puts(json) # Send some json to the client rescue Errno::EPIPE => e UI.verbose(e) return COMMAND_EXECUTION_STATE[:error] end return COMMAND_EXECUTION_STATE[:ready] end
ruby
{ "resource": "" }
q10581
Fastlane.SocketServer.execute_action_command
train
def execute_action_command(command: nil) command_return = @command_executor.execute(command: command, target_object: nil) ## probably need to just return Strings, or ready_for_next with object isn't String return_object = command_return.return_value return_value_type = command_return.return_valu...
ruby
{ "resource": "" }
q10582
FastlaneCore.Project.schemes
train
def schemes @schemes ||= if workspace? workspace.schemes.reject do |k, v| v.include?("Pods/Pods.xcodeproj") end.keys else Xcodeproj::Project.schemes(path) end end
ruby
{ "resource": "" }
q10583
FastlaneCore.Project.select_scheme
train
def select_scheme(preferred_to_include: nil) if options[:scheme].to_s.length > 0 # Verify the scheme is available unless schemes.include?(options[:scheme].to_s) UI.error("Couldn't find specified scheme '#{options[:scheme]}'. Please make sure that the scheme is shared, see https://develop...
ruby
{ "resource": "" }
q10584
FastlaneCore.Project.configurations
train
def configurations @configurations ||= if workspace? workspace .file_references .map(&:path) .reject { |p| p.include?("Pods/Pods.xcodeproj") } .map do |p| ...
ruby
{ "resource": "" }
q10585
FastlaneCore.Project.default_build_settings
train
def default_build_settings(key: nil, optional: true) options[:scheme] ||= schemes.first if is_workspace build_settings(key: key, optional: optional) end
ruby
{ "resource": "" }
q10586
Match.Nuke.print_tables
train
def print_tables puts("") if self.certs.count > 0 rows = self.certs.collect do |cert| cert_expiration = cert.expires.nil? ? "Unknown" : cert.expires.strftime("%Y-%m-%d") [cert.name, cert.id, cert.class.to_s.split("::").last, cert_expiration] end puts(Terminal::Tab...
ruby
{ "resource": "" }
q10587
Deliver.UploadMetadata.upload
train
def upload(options) return if options[:skip_metadata] # it is not possible to create new languages, because # :keywords is not write-able on published versions # therefore skip it. verify_available_languages!(options) unless options[:edit_live] app = options[:app] details = a...
ruby
{ "resource": "" }
q10588
Deliver.UploadMetadata.upload_individual_item
train
def upload_individual_item(app, version, language, key, value) details = app.details version.send(key)[language] = value if LOCALISED_VERSION_VALUES.include?(key) details.send(key)[language] = value if LOCALISED_APP_VALUES.include?(key) Helper.show_loading_indicator("Uploading #{language} #{key}...
ruby
{ "resource": "" }
q10589
Deliver.UploadMetadata.verify_available_languages!
train
def verify_available_languages!(options) return if options[:skip_metadata] # Collect all languages we need # We only care about languages from user provided values # as the other languages are on iTC already anyway v = options[:app].edit_version(platform: options[:platform]) UI.user...
ruby
{ "resource": "" }
q10590
Deliver.UploadMetadata.load_from_filesystem
train
def load_from_filesystem(options) return if options[:skip_metadata] # Load localised data ignore_validation = options[:ignore_language_directory_validation] Loader.language_folders(options[:metadata_path], ignore_validation).each do |lang_folder| language = File.basename(lang_folder) ...
ruby
{ "resource": "" }
q10591
Deliver.UploadMetadata.normalize_language_keys
train
def normalize_language_keys(options) (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key| current = options[key] next unless current && current.kind_of?(Hash) current.keys.each do |language| current[language.to_s] = current.delete(language) end end ...
ruby
{ "resource": "" }
q10592
Spaceship.Utilities.resolution
train
def resolution(path) return FastImage.size(path) if content_type(path).start_with?("image") return video_resolution(path) if content_type(path).start_with?("video") raise "Cannot find resolution of file #{path}" end
ruby
{ "resource": "" }
q10593
Fastlane.SocketServerActionCommandExecutor.run_action_requiring_special_handling
train
def run_action_requiring_special_handling(command: nil, parameter_map: nil, action_return_type: nil) action_return = nil closure_argument_value = nil # only used if the action uses it case command.method_name when "sh" error_callback = proc { |string_value| closure_argument_value = stri...
ruby
{ "resource": "" }
q10594
Gym.Runner.build_app
train
def build_app command = BuildCommandGenerator.generate print_command(command, "Generated Build Command") if FastlaneCore::Globals.verbose? FastlaneCore::CommandExecutor.execute(command: command, print_all: true, print_comm...
ruby
{ "resource": "" }
q10595
Gym.Runner.post_build_app
train
def post_build_app command = BuildCommandGenerator.post_build return if command.empty? print_command(command, "Generated Post-Build Command") if FastlaneCore::Globals.verbose? FastlaneCore::CommandExecutor.execute(command: command, print_all: true, ...
ruby
{ "resource": "" }
q10596
Gym.Runner.move_ipa
train
def move_ipa FileUtils.mv(PackageCommandGenerator.ipa_path, File.expand_path(Gym.config[:output_directory]), force: true) ipa_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path))) UI.success("Successfully exported and signed the ipa file:")...
ruby
{ "resource": "" }
q10597
Gym.Runner.copy_mac_app
train
def copy_mac_app exe_name = Gym.project.build_settings(key: "EXECUTABLE_NAME") app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app") UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path) FileUtil...
ruby
{ "resource": "" }
q10598
Gym.Runner.move_manifest
train
def move_manifest if File.exist?(PackageCommandGenerator.manifest_path) FileUtils.mv(PackageCommandGenerator.manifest_path, File.expand_path(Gym.config[:output_directory]), force: true) manifest_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator...
ruby
{ "resource": "" }
q10599
Gym.Runner.move_app_thinning
train
def move_app_thinning if File.exist?(PackageCommandGenerator.app_thinning_path) FileUtils.mv(PackageCommandGenerator.app_thinning_path, File.expand_path(Gym.config[:output_directory]), force: true) app_thinning_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(Package...
ruby
{ "resource": "" }