https://github.com/rvm/gem-wrappers
Create gem wrappers for easy use of gems in cron and other system locations.
https://github.com/rvm/gem-wrappers
Last synced: 9 months ago
JSON representation
Create gem wrappers for easy use of gems in cron and other system locations.
- Host: GitHub
- URL: https://github.com/rvm/gem-wrappers
- Owner: rvm
- License: other
- Created: 2013-12-06T16:32:10.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-09-22T11:26:43.000Z (over 8 years ago)
- Last Synced: 2025-04-19T21:29:46.302Z (9 months ago)
- Language: Ruby
- Size: 69.3 KB
- Stars: 14
- Watchers: 18
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Gem wrappers
[](http://rubygems.org/gems/gem-wrappers)
[](https://codeclimate.com/github/rvm/gem-wrappers)
[](https://coveralls.io/r/rvm/gem-wrappers?branch=master)
[](https://travis-ci.org/rvm/gem-wrappers)
[](https://gemnasium.com/rvm/gem-wrappers)
[](http://rubydoc.info/gems/gem-wrappers/frames)
Create gem wrappers for easy use of gems in cron and other system locations.
## Installation
This gem should be available in RVM `1.25+`, to install manually:
```bash
gem install gem-wrappers
```
## Configuration / Defaults
In `~/.gemrc` you can overwrite this defaults:
```ruby
wrappers_path: GEM_HOME/wrappers
wrappers_environment_file: GEM_HOME/environment
wrappers_path_take: 1
```
It is not yet possible to put variables in the configuration,
only relative and full paths will work, open a ticket if you need variables.
## Generating wrappers
By default wrappers are installed when a gem is installed,
to rerun the process for all gems in `GEM_HOME` use:
```bash
gem wrappers regenerate
```
wrappers will be generated in `$GEM_HOME/wrappers/`.
### Example
Install popular http server `unicorn`:
```bash
gem install gem-wrappers # assuming it was not installed already
gem install unicorn
```
The `unicorn` wrapper is located in `$GEM_HOME/wrappers`:
```bash
gem wrappers show unicorn
```
```ssh
/home/mpapis/.rvm/gems/ruby-2.1.0-preview2/wrappers/unicorn
```
This script will make sure proper environment is available.
## Generating scripts wrappers
It is possible to generate wrappers for custom scripts:
```bash
gem wrappers /path/to/script
```
a wrapper `$GEM_HOME/wrappers/script` will be generated.
## Showing current configuration
To see paths that are used by gem run:
```bash
gem wrappers
```
## Environment file
User can provide his own `environment` file,
in case it is not available during generating wrappers it will be created using this template:
```erb
export PATH="<%= path.join(":") %>:$PATH"
export GEM_PATH="<%= gem_path.join(":") %>"
export GEM_HOME="<%= gem_home %>"
```
The `path` elements are calculated using this algorithm:
```ruby
ENV['PATH'].split(":").take(Gem.path.size + path_take)
```