def register_from_pack(self, pack_dir):
        """
        Register all the rules from the provided pack.

        :return: Number of rules registered, Number of rules overridden
        :rtype: ``tuple``
        """
        pack_dir = pack_dir[:-1] if pack_dir.endswith("/") else pack_dir
        _, pack = os.path.split(pack_dir)
        rules_dir = self._pack_loader.get_content_from_pack(
            pack_dir=pack_dir, content_type="rules"
        )

        # Register pack first
        self.register_pack(pack_name=pack, pack_dir=pack_dir)

        registered_count = 0
        overridden_count = 0
        if not rules_dir:
            return registered_count, overridden_count

        LOG.debug("Registering rules from pack %s:, dir: %s", pack, rules_dir)

        try:
            rules = self._get_rules_from_pack(rules_dir=rules_dir)
            registered_count, overridden_count = self._register_rules_from_pack(
                pack=pack, rules=rules
            )
        except Exception as e:
            if self._fail_on_failure:
                raise e

            LOG.exception("Failed registering all rules from pack: %s", rules_dir)

        return registered_count, overridden_count

        Register all the rules from the provided pack.

        :return: Number of rules registered, Number of rules overridden
        :rtype: ``tuple``
        
st2common/st2common/bootstrap/rulesregistrar.py