{% set version = '0.2.0' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-tidypredict
  version: {{ version|replace("-", "_") }}

source:
  fn: tidypredict_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/tidypredict_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/tidypredict/tidypredict_{{ version }}.tar.gz
  sha256: 73040bd951f630fcfb3787c2365c803e088a78615600b7713a860ca1d4ef09c3

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-dplyr >=0.7
    - r-purrr
    - r-rlang
    - r-tibble
    - r-tidyr
  run:
    - r-base
    - r-dplyr >=0.7
    - r-purrr
    - r-rlang
    - r-tibble
    - r-tidyr

test:
  commands:
    - $R -e "library('tidypredict')"           # [not win]
    - "\"%R%\" -e \"library('tidypredict')\""  # [win]

about:
  home: http://tidypredict.netlify.com/
  license: GPL-3
  summary: 'It parses a fitted ''R'' model object, and returns a formula in ''Tidy Eval'' code
    that calculates the predictions. It works with several databases back-ends because
    it leverages ''dplyr'' and ''dbplyr'' for the final ''SQL'' translation of the algorithm.
    It currently supports lm(), glm(), randomForest() and ranger() models. '
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
