You can use Puppet's "features" utility with a cofnine for this which does two things, a) prevents the provider running when this isn't available, and b) lets users install the foreman_api gem during a run.

1. create `lib/puppet/feature/foreman_api.rb` along the lines of: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/feature/zlib.rb
2. add `confine :feature => :foreman_api` along the lines of: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/augeas/augeas.rb#L27