ruby docs: improve the example

- missing cd command
- invoke bundler through nix-shell, so it doesn't need to be on $PATH
  Note: running bundix through nix-shell won't work ATM, as the shell sets
  SSL_CERT_FILE=/no-cert-file.crt which prevents fetching throug https.
- use version from gemset to simplify updating
- don't break line in meta.description
This commit is contained in:
Vladimír Čunát 2016-03-19 11:47:55 +01:00
parent 88a62b3aea
commit b405e82edb

View File

@ -12,25 +12,26 @@
<screen> <screen>
<![CDATA[$ cd pkgs/servers/monitoring <![CDATA[$ cd pkgs/servers/monitoring
$ mkdir sensu $ mkdir sensu
$ cd sensu
$ cat > Gemfile $ cat > Gemfile
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'sensu' gem 'sensu'
$ bundler package --path /tmp/vendor/bundle $ nix-shell -p bundler --command "bundler package --path /tmp/vendor/bundle"
$ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix $ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix
$ cat > default.nix $ cat > default.nix
{ lib, bundlerEnv, ruby }: { lib, bundlerEnv, ruby }:
bundlerEnv { bundlerEnv rec {
name = "sensu-0.17.1"; name = "sensu-${version}";
version = (import gemset).sensu.version;
inherit ruby; inherit ruby;
gemfile = ./Gemfile; gemfile = ./Gemfile;
lockfile = ./Gemfile.lock; lockfile = ./Gemfile.lock;
gemset = ./gemset.nix; gemset = ./gemset.nix;
meta = with lib; { meta = with lib; {
description = "A monitoring framework that aims to be simple, malleable, description = "A monitoring framework that aims to be simple, malleable, and scalable";
and scalable";
homepage = http://sensuapp.org/; homepage = http://sensuapp.org/;
license = with licenses; mit; license = with licenses; mit;
maintainers = with maintainers; [ theuni ]; maintainers = with maintainers; [ theuni ];