{% set version = '0.3.2' %}

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

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

source:
  fn: plumber_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/plumber_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/plumber/plumber_{{ version }}.tar.gz
  sha256: 30a486d2d59e5e0c68fce27142ed4d0391b67d1c20cfa4449d1110981f4a997f

build:
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-httpuv >=1.2.3
    - r-jsonlite >=0.9.16
    - r-r6 >=2.0
    - r-stringi >=0.3.0

  run:
    - r-base
    - r-httpuv >=1.2.3
    - r-jsonlite >=0.9.16
    - r-r6 >=2.0
    - r-stringi >=0.3.0

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

about:
  home: https://github.com/trestletech/plumber
  license: MIT
  license_family: MIT
  summary: Gives the ability to automatically generate and serve an HTTP API from R functions using the annotations in the R documentation around your functions.

extra:
  recipe-maintainers:
    - koverholt
