| Total Complexity | 2 | 
| Total Lines | 36 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | from coala_decorators.decorators import generate_repr  | 
            ||
| 4 | @generate_repr()  | 
            ||
| 5 | class PackageRequirement:  | 
            ||
| 6 | |||
| 7 | """  | 
            ||
| 8 | This class helps keeping track of bear requirements. It should simply  | 
            ||
| 9 | be appended to the REQUIREMENTS tuple inside the Bear class.  | 
            ||
| 10 | |||
| 11 | You can check whether the requirements are fulfilled using the check  | 
            ||
| 12 | method:  | 
            ||
| 13 | |||
| 14 |     >>> PR = PackageRequirement('pip', 'coala_decorators', '0.2.1') | 
            ||
| 15 | >>> PR.check()  | 
            ||
| 16 | Traceback (most recent call last):  | 
            ||
| 17 | ...  | 
            ||
| 18 | NotImplementedError  | 
            ||
| 19 | """  | 
            ||
| 20 | |||
| 21 | def __init__(self, manager: str, package: str, version=""):  | 
            ||
| 22 | """  | 
            ||
| 23 | Constructs a new PackageRequirement.  | 
            ||
| 24 | |||
| 25 | :param manager: A string with the name of the manager (pip, npm, etc).  | 
            ||
| 26 | :param package: A string with the name of the package to be installed.  | 
            ||
| 27 | :param version: A number that contains the version. Leave empty to  | 
            ||
| 28 | install the latest.  | 
            ||
| 29 | """  | 
            ||
| 30 | self.manager = manager  | 
            ||
| 31 | self.package = package  | 
            ||
| 32 | self.version = version  | 
            ||
| 33 | |||
| 34 | def check(self):  | 
            ||
| 35 | """  | 
            ||
| 36 | Check if the requirement is satisfied.  | 
            ||
| 37 | :return: Returns True if satisfied, False if not.  | 
            ||
| 38 | """  | 
            ||
| 39 | raise NotImplementedError  | 
            ||
| 40 |