Get src to library for specific version

@param string $ver Version of library
176037
public function getLibSrc($ver)
    {
        if (!$this->isValidVersion($ver)) {
            throw new \Exception(
                sprintf(
                    'Invalid library version provided "%s"',
                    $ver
                )
            );
        }

        $options = $this->options;
        $cdnUrl = rtrim($options['cdn-base'], '/').'/'.
            trim($options['cdn-subfolder'], '/').'/'.
            $ver.'/'.
            trim($options['cdn-file-path'], '/');

        return $cdnUrl;
    }
161349
public function getJs()
    {
        if(!$this->includeAssets())
        {
            return '';
        }
        $libraries = $this->getLibrariesInUse();
        $code = '';
        foreach($libraries as $library)
        {
            $code .= "\n" . $library->getJs() . "\n";
        }
        return $code;
    }
1346824
protected function getPathUrl($prePath, $id, $fileName, $format, $version = '', $subVersion = '')
    {
        $segment = $this->getSegment($id) . '/';
        $prePath = rtrim($prePath, '/');

        return str_replace(
            '{slug}',
            $format . '/' . $segment . $id . '-' . rawurlencode($fileName),
            $prePath
        ) . '?v=' . $version . '-' . $subVersion;
    }
1301739
protected function getContentType($type, $version)
    {
        if ($type === 'css') {
            return 'text/css';
        } else if ($type === 'js') {
            return 'text/javascript';
        } else if ($type === 'image') {
            $fileExtension = pathinfo($version, PATHINFO_EXTENSION);
            
            if ($fileExtension === 'svg') {
                return 'image/svg+xml';
            } else if ($fileExtension === 'jpg') {
                return 'image/jpeg';
            } else if ($fileExtension === 'gif') {
                return 'image/gif';
            } else if ($fileExtension === 'png') {
                return 'image/png';
            }
        }
    }
1370720
def get_versioned_files(cls):
        """"""
        encoding = cls._get_terminal_encoding()
        output = run(['bzr', 'ls', '-VR'], encoding=encoding)
        return output.splitlines()
942345
public function getVersionAvailable($prepend = '', $append = '') : string
    {
        if ($this->versionFileExists()) {
            $version = $prepend.$this->getVersionFile().$append;
        } else {
            $response = $this->getRepositoryReleases();
            $releaseCollection = collect(\GuzzleHttp\json_decode($response->getBody()));
            $version = $prepend.$releaseCollection->first()->name.$append;
        }

        return $version;
    }
159503
public function getFontAwesome($useMinified = true, $version = self::VERSION_FONTAWESOME) : string
    {
        return sprintf('<link rel="stylesheet" href="%s">', $this->getFontAwesomeCssLink($useMinified, $version));
    }
1201721
protected function fetchCurrentVersionUrl($currentVersionReference)
    {
        $versionResponse = $this->client->request(
            'GET',
            $currentVersionReference
        );

        if ($this->isErrorResponse($versionResponse)) {
            return $this->inputDispatcher->parse($versionResponse);
        }

        return $versionResponse->headers['Location'];
    }
990566
def prt_ver(self, prt):
        """"""
        if self.ver_list is not None:
            prt.write("# Versions:\n#    {VER}\n\n".format(VER="\n#    ".join(self.ver_list)))
879519
protected function getFromCache($src)
	{
		$differentiator = $this->getCacheDifferentiator();
		$key            = sha1(serialize([get_class($this), $differentiator, $src]));
		$cacheFile      = $this->cacheDir . '/minifier.' . $key . '.js';

		if (!file_exists($cacheFile))
		{
			file_put_contents($cacheFile, $this->minify($src));
		}

		return file_get_contents($cacheFile);
	}
751652
public function getLink(String $key, String $version = 'latest')
    {
        $return = $this->getLinks()[$key] ?? false;

        if( $version !== 'latest' )
        {
            return $this->versionModifier($version, $return);
        }

        return $return;
    }
1291090
private function _parse_font_face($str)
    {
        $descriptors = $this->_parse_properties($str);

        preg_match_all("/(url|local)\s*\([\"\']?([^\"\'\)]+)[\"\']?\)\s*(format\s*\([\"\']?([^\"\'\)]+)[\"\']?\))?/i", $descriptors->src, $src);

        $sources = array();
        $valid_sources = array();

        foreach ($src[0] as $i => $value) {
            $source = array(
                "local" => strtolower($src[1][$i]) === "local",
                "uri" => $src[2][$i],
                "format" => strtolower($src[4][$i]),
                "path" => Helpers::build_url($this->_protocol, $this->_base_host, $this->_base_path, $src[2][$i]),
            );

            if (!$source["local"] && in_array($source["format"], array("", "truetype"))) {
                $valid_sources[] = $source;
            }

            $sources[] = $source;
        }

        // No valid sources
        if (empty($valid_sources)) {
            return;
        }

        $style = array(
            "family" => $descriptors->get_font_family_raw(),
            "weight" => $descriptors->font_weight,
            "style" => $descriptors->font_style,
        );

        $this->getFontMetrics()->registerFont($style, $valid_sources[0]["path"], $this->_dompdf->getHttpContext());
    }
51708
public function version($dir) {
        if ($this->source($dir)) {
            // Check if unbuilt Drupal
            foreach ($this->getMakefiles($dir) as $file) {
                $f = fopen($file, 'r');
                $peek = fread($f, 1000);
                fclose($f);
                foreach (explode(PHP_EOL, $peek) as $line) {
                    preg_match("/core\s*(:|=)\s*\"?(\d.\w?)\"?$/", $line, $output_array);
                    if (!empty($output_array)) {
                        return ($output_array[2] == self::DRUPAL7) ? self::DRUPAL7 : self::DRUPAL8;
                    }
                }
            }
        } elseif ($this->built($dir)) {
            return (file_exists($dir . '/core/composer.json')) ? self::DRUPAL8 : self::DRUPAL7;
        }
        return null;
    }
250988
private function getAppVersion($dir)
    {
        $version = null;

        /** @var SplFileInfo $composerFile */
        $composerFile = new SplFileInfo($dir . '/composer.json', '', '');
        if (!$composerFile->isFile()) {
            return $version;
        }

        $composerJson = json_decode($composerFile->getContents(), true);
        if (!array_key_exists('version', $composerJson)) {
            return $version;
        }

        return $composerJson['version'];
    }
1252713
def show_ver(**kwargs):
    '''
    
    '''
    command = 'show version'
    info = ''
    info = show(command, **kwargs)
    if isinstance(info, list):
        info = info[0]
    return info
242558
public function getURL($version)
    {
        $file = false;
        $os = $this->getOS();
        $cdn_url = $this->getCdnUrl($version);

        if ($os === 'windows') {
            $file = 'phantomjs-' . $version . '-windows.zip';
        }

        if ($os === 'linux') {
            $bitsize = $this->getBitSize();

            if ($bitsize === '32') {
                $file = 'phantomjs-' . $version . '-linux-i686.tar.bz2';
            }

            if ($bitsize === '64') {
                $file = 'phantomjs-' . $version . '-linux-x86_64.tar.bz2';
            }
        }

        if ($os === 'macosx') {
            $file = 'phantomjs-' . $version . '-macosx.zip';
        }

        # OS unknown
        if ($file === false) {
            throw new \RuntimeException(
                'The Installer could not select a PhantomJS package for this OS.
                Please install PhantomJS manually into the /bin folder of your project.'
            );
        }

        return $cdn_url . $file;
    }
864297
public function getCurrentRemoteVersion(Updater $updater)
    {
        /** Switch remote request errors to HttpRequestExceptions */
        set_error_handler(array($updater, 'throwHttpRequestException'));
        $packageUrl = $this->getApiUrl();
        $package = json_decode(get_contents($packageUrl), true);
        restore_error_handler();

        if (null === $package || json_last_error() !== JSON_ERROR_NONE) {
            throw new JsonParsingException(
                'Error parsing JSON package data'
                . (function_exists('json_last_error_msg') ? ': ' . json_last_error_msg() : '')
            );
        }

        $versions = array_keys($package['packages'][$this->getPackageName()]);
        $versionParser = new VersionParser($versions);
        if ($this->getStability() === self::STABLE) {
            $this->remoteVersion = $versionParser->getMostRecentStable();
        } elseif ($this->getStability() === self::UNSTABLE) {
            $this->remoteVersion = $versionParser->getMostRecentUnstable();
        } else {
            $this->remoteVersion = $versionParser->getMostRecentAll();
        }

        /**
         * Setup remote URL if there's an actual version to download
         */
        if (!empty($this->remoteVersion)) {
            $this->remoteUrl = $this->getDownloadUrl($package);
        }

        return $this->remoteVersion;
    }