> +
> +   @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+)*");

Tried something like `"0\\.(\\d+)|(\\d+)\\.\\d+"`, and although it works, the 
matched group is 1 or 2, depending on which part of the regexp matches, so we 
can't always return group 1. An alternative would be to use two patterns and 
don't use the OR inside the regexp, but in that case I think the current 
implementation would be better. Thoughts?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/18/files#r6307877

Reply via email to