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

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

source:
  fn: collateral_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/collateral_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/collateral/collateral_{{ version }}.tar.gz
  sha256: d5491d4e314e74df67a351ee82527289e6742bdfa418deab6342a381eafe2ec4

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-crayon
    - r-pillar
    - r-purrr
  run:
    - r-base
    - r-crayon
    - r-pillar
    - r-purrr

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

about:
  home: https://rensa.co/collateral/index.html, https://github.com/rensa/collateral
  license: GPL-3
  summary: The purrr package allows you to capture the side effects (errors, warning, messages
    and other output) of functions using safely() and quietly(). Using collateral, you
    can quickly see which elements of a list (or list-column) returned results, which
    threw errors and which returned warnings or other output.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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