Skip to content
Permalink
Browse files

Start on manpages, fill out installation instructions

  • Loading branch information...
matthewd committed Mar 10, 2019
1 parent 8f99018 commit 626518f01e3346c8ab8a00298a0f83d16cfb4813
Showing with 113 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 Gemfile
  3. +8 −0 Gemfile.lock
  4. +9 −3 README.md
  5. +19 −2 Rakefile
  6. +2 −1 gel.gemspec
  7. +1 −0 lib/gel/command.rb
  8. +17 −0 lib/gel/command/shell_setup.rb
  9. +14 −0 man/man1/gel-exec.1.ronn
  10. +14 −0 man/man1/gel-install.1.ronn
  11. +25 −0 man/man1/gel.1.ronn
@@ -6,4 +6,6 @@
/spec/reports/
/tmp/

/man/man?/*.?

/test/fixtures/*.gem
@@ -9,3 +9,5 @@ gem "rake", "~> 12.0"
gem "minitest", "~> 5.0"
gem "mocha"
gem "webmock"

gem "ronn"
@@ -12,13 +12,20 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
hashdiff (0.3.7)
hpricot (0.8.6)
metaclass (0.0.4)
minitest (5.10.3)
mocha (1.8.0)
metaclass (~> 0.0.1)
mustache (1.1.0)
pub_grub (0.5.0.alpha3)
public_suffix (3.0.1)
rake (12.3.0)
rdiscount (2.2.0.1)
ronn (0.7.3)
hpricot (>= 0.8.2)
mustache (>= 0.7.0)
rdiscount (>= 1.5.8)
safe_yaml (1.0.4)
webmock (3.1.1)
addressable (>= 2.3.6)
@@ -33,6 +40,7 @@ DEPENDENCIES
minitest (~> 5.0)
mocha
rake (~> 12.0)
ronn
webmock

BUNDLED WITH
@@ -4,15 +4,21 @@ A modern gem manager.

## Installation

Install it the gem:
Install the gem:

$ gem install gel

TODO: .. and then?
Then, either activate gel in your current shell:

$ eval "$(gel shell-setup)"

Or add it to your `.bashrc` or `.zshrc` to enable it everywhere:

$ echo 'eval "$(gel shell-setup)"' >> ~/.bashrc

## Usage

TODO: Write usage instructions here
Use `gel install`, `gel lock`, and `gel exec` as you would the equivalent `bundle` subcommands.

## Development

@@ -32,6 +32,23 @@ task :fixtures do
end
end

task :test => :fixtures
task test: :fixtures

task :default => :test
MAN_SOURCES = Rake::FileList.new("man/*/*.ronn")
MAN_PAGES = MAN_SOURCES.map { |source| source.delete(".ronn") }

file MAN_PAGES => :man

task :man => MAN_SOURCES do
sh "ronn --roff --manual 'Gel Manual' #{Shellwords.shelljoin MAN_SOURCES}"
end

task build: :man do
Dir.mkdir "pkg" unless Dir.exist?("pkg")

File.read(File.expand_path("lib/gel/version.rb", __dir__)) =~ /VERSION.*\"(.*)\"/
version = $1
sh "gem build -o pkg/gel-#{version}.gem gel.gemspec"
end

task default: :test
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
"public gem pushes."
end

spec.files = `git ls-files -z exe lib *.md *.txt`.split("\x0")
spec.files = `git ls-files -z exe lib *.md *.txt`.split("\x0") +
Dir["man/man?/*.?"]
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
@@ -76,3 +76,4 @@ def self.extract_word(arguments)
require_relative "command/ruby"
require_relative "command/stub"
require_relative "command/config"
require_relative "command/shell_setup"
@@ -0,0 +1,17 @@
# frozen_string_literal: true

class Gel::Command::ShellSetup < Gel::Command
def run(command_line)
require "shellwords"

bin_dir = File.expand_path("~/.local/gel/bin")
unless ENV.fetch("PATH", "").split(File::PATH_SEPARATOR).include?(bin_dir)
puts "PATH=\"#{Shellwords.shellescape bin_dir}#{File::PATH_SEPARATOR}$PATH\""
end

lib_dir = File.expand_path("../compatibility", __dir__)
unless ENV.fetch("RUBYLIB", "").split(File::PATH_SEPARATOR).include?(lib_dir)
puts "RUBYLIB=\"#{Shellwords.shellescape lib_dir}:$RUBYLIB\""
end
end
end
@@ -0,0 +1,14 @@
gel-exec(1) -- run an executable with gel enabled
=================================================

## SYNOPSIS

`gel` `exec` <executable> [<args>]

## DESCRIPTION

Run an executable with the Gemfile activated.

## SEE ALSO

bundle-exec(1)
@@ -0,0 +1,14 @@
gel-install(1) -- install gems
==============================

## SYNOPSIS

`gel install`

## DESCRIPTION

Install gems listed in `Gemfile.lock`.

## SEE ALSO

gemfile(5), gel-lock(1), bundle-install(1)
@@ -0,0 +1,25 @@
gel(1) -- a modern gem manager
==============================

## SYNOPSIS

`gel` [`--version`] [`--help`] <command> [<args>]

## DESCRIPTION

Gel is a minimal package manager for the Ruby programming language.

## GEL COMMANDS

* gel-install(1):
Install all the gems listed in the Gemfile.lock

* gel-lock(1):
Resolve the dependencies listed in Gemfile into a Gemfile.lock

* gel-exec(1):
Run an executable with the Gemfile activated

## SEE ALSO

ruby(1), gem(1), bundle(1)

0 comments on commit 626518f

Please sign in to comment.
You can’t perform that action at this time.