b0VIM 8.1ÕDo`•×ï_joshJoshs-Mac-mini.local~josh/Projects/fastlane/fastlane/fastlane/lib/fastlane/fastlane_require.rbutf-8 3210#"! UtpQadcQðØÆ„GF$ŸmWKJ/â ¡ < ! î Ó d X W , ñ ð ³ ²   è ç … 9 ö » ‹ € A éÈÇ‚5ð±‚rS8$ ³˜Ža65¯^ý×Ëʈndc7혗umgcend end end end return gem_name gem_name = gem_name.tr("-", "/") if gem_name.start_with?("fastlane-plugin-") # from "fastlane-plugin-xcversion" to "fastlane/plugin/xcversion" def format_gem_require_name(gem_name) end return gems.first gems = fetcher.suggest_gems_from_name(user_supplied_name) end return detected_gem[0].name if (detected_gem = fetcher.detect(:latest) { |nt| nt.name == user_supplied_name }.first) # First search for exact gem with detect then use suggest_gems_from_name # RubyGems 3.2.0 changed behavior of suggest_gems_from_name to no longer return user supplied name (only similar suggestions) fetcher = Gem::SpecFetcher.fetcher def find_gem_name(user_supplied_name) end return $?.success? system(RbConfig.ruby, "-e", require_tester.lines.map(&:chomp).join("; "), name) RB end exit(1) rescue LoadError require ARGV.first begin require_tester = <<-RB.gsub(/^ */, '') # See https://github.com/fastlane/fastlane/issues/6951 # (so we don't actually load anything we don't want to load) # To find out we try to load a gem with that name in a child process # In special cases a gem is already preinstalled, e.g. YAML. return true if installed installed = Gem::Specification.any? { |s| s.name == name and req =~ s.version } def gem_installed?(name, req = Gem::Requirement.default) end require gem_require_name if require_gem UI.success("Successfully installed '#{gem_name}'") installer.install_gem(spec_name, Gem::Requirement.default) # at this point. If we were to shell out, this wouldn't be the case # We install the gem like this because we also want to gem to be available to be required return if Helper.test? UI.important("Found gem \"#{spec_name}\" instead of the required name \"#{gem_name}\"") if spec_name != gem_name spec_name = self.find_gem_name(gem_name) UI.important("Installing Ruby gem '#{gem_name}'...") installer = Gem::CommandManager.instance[:install] require "rubygems/command_manager" end UI.user_error!("Add 'gem \"#{gem_name}\"' to your Gemfile and restart fastlane") unless Helper.test? UI.important("") UI.command_output("gem \"#{gem_name}\"") UI.important("") UI.important("Missing gem '#{gem_name}', please add the following to your local Gemfile:") # Instead tell the user how to add it to their Gemfile # User uses bundler, we don't want to install gems on the fly here if Helper.bundler? end return true require gem_require_name if require_gem UI.success("gem '#{gem_name}' is already installed") if FastlaneCore::Globals.verbose? if gem_installed?(gem_name) # check if it's installed gem_require_name = format_gem_require_name(gem_name) def install_gem_if_needed(gem_name: nil, require_gem: true) class << self class FastlaneRequiremodule Fastlane