> +
> + @Resource
> + @Named(ChefProperties.CHEF_LOGGER)
> + private Logger logger = Logger.NULL;
> +
> + /** The configured version of the Chef Server API. */
> + private final String apiVersion;
> +
> + @Inject
> + ChefVersionSupplier(@ApiVersion String apiVersion) {
> + this.apiVersion = checkNotNull(apiVersion, "apiVersion must not be
> null");
> + }
> +
> + @Override
> + public Integer get() {
> + Pattern versionPattern = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)*");
If we're only interested in the major version, how about a regex for "0.(x)" or
"(x).y" and then simply always return matching group 1?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/18/files#r6281155