gem-man 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +20 -0
- data/README.md +80 -0
- data/Rakefile +16 -0
- data/lib/rubygems/commands/man_command.rb +113 -0
- data/lib/rubygems/gem/specification.rb +13 -0
- data/lib/rubygems_plugin.rb +4 -0
- data/man/gem-man.1 +102 -0
- data/man/gem-man.1.html +166 -0
- data/man/gem-man.1.ron +80 -0
- metadata +63 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Chris Wanstrath
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
Software), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
gem-man(1) -- view a gem's man page
|
2
|
+
===================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`gem man` <GEM>
|
7
|
+
`gem man` --latest <GEM>
|
8
|
+
`gem man` --exact <GEM>
|
9
|
+
`gem man` --all
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
The `gem man` command can be used to display a man page for an
|
14
|
+
installed RubyGem. The man page must be included with the gem -
|
15
|
+
`gem-man` does no generation or magic.
|
16
|
+
|
17
|
+
For an introduction to man pages, see `man(1)` (or type `man man` in
|
18
|
+
your shell).
|
19
|
+
|
20
|
+
## GEM
|
21
|
+
|
22
|
+
`gem man` expects to be passed the name of an installed gem. If there
|
23
|
+
are multiple man pages found for the gem, you will be asked which
|
24
|
+
you'd like to view. If only a single man page is found it will be
|
25
|
+
displayed.
|
26
|
+
|
27
|
+
Man pages are any files whose extension is a single digit [0-9],
|
28
|
+
e.g. `ron.1`.
|
29
|
+
|
30
|
+
## OPTIONS
|
31
|
+
|
32
|
+
`gem man`'s default mode of operation is to open a man page for a
|
33
|
+
single gem or, if multiple man pages are found, ask which you'd like
|
34
|
+
to open. If there are any ambiguities as to which gem to use, `gem
|
35
|
+
man` will ask which you'd prefer.
|
36
|
+
|
37
|
+
You can specify gems or list available gems using a few options.
|
38
|
+
|
39
|
+
* `-l`, `--latest`:
|
40
|
+
If there are multiple versions of a gem, open the latest.
|
41
|
+
|
42
|
+
* `-v`, `--version`:
|
43
|
+
Specify version of gem to man.
|
44
|
+
|
45
|
+
* `-e`, `--exact`:
|
46
|
+
Only list exact matches.
|
47
|
+
|
48
|
+
* `-a`, `--all`:
|
49
|
+
List all installed gems that have manuals.
|
50
|
+
|
51
|
+
See `gem help man` to view the options at any time.
|
52
|
+
|
53
|
+
## INSTALL
|
54
|
+
|
55
|
+
gem install gem-man
|
56
|
+
|
57
|
+
## BUGS
|
58
|
+
|
59
|
+
Requires the `man(1)` script to be in your path, executable, and to
|
60
|
+
accept a full path to a manual.
|
61
|
+
|
62
|
+
Requires Ruby and RubyGems 1.3.2 (or higher).
|
63
|
+
|
64
|
+
Please report other bugs at <http://github.com/defunkt/gem-man>
|
65
|
+
|
66
|
+
## THANKS
|
67
|
+
|
68
|
+
* adamsanderson for open_gem
|
69
|
+
* rtomayko for ron
|
70
|
+
|
71
|
+
## COPYRIGHT
|
72
|
+
|
73
|
+
gem-man is Copyright (C) 2010 Chris Wanstrath with parts from Adam
|
74
|
+
Sanderson.
|
75
|
+
|
76
|
+
## SEE ALSO
|
77
|
+
|
78
|
+
ron(5), man(1), less(1), roff(7), groff(1),
|
79
|
+
<http://en.wikipedia.org/wiki/Man_page>,
|
80
|
+
<http://github.com/defunkt/gem-man>
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
desc "Build the manual"
|
2
|
+
task :build_man do
|
3
|
+
sh "ron -br5 --organization=DEFUNKT --manual='RubyGems Manual' man/*.ron"
|
4
|
+
end
|
5
|
+
|
6
|
+
desc "Show the manual"
|
7
|
+
task :man => :build_man do
|
8
|
+
exec "man man/gem-man.1"
|
9
|
+
end
|
10
|
+
|
11
|
+
begin
|
12
|
+
require 'mg'
|
13
|
+
MG.new('gem-man.gemspec')
|
14
|
+
rescue Loaderror
|
15
|
+
warn "gem install mg to get gem tasks"
|
16
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# Much of this is stolen from the `open_gem` RubyGem's "read"
|
2
|
+
# command - thanks Adam!
|
3
|
+
#
|
4
|
+
# http://github.com/adamsanderson/open_gem/blob/dfddaa286e/lib/rubygems/commands/read_command.rb
|
5
|
+
class Gem::Commands::ManCommand < Gem::Command
|
6
|
+
include Gem::VersionOption
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super 'man', "Open a gem's manual",
|
10
|
+
:command => nil,
|
11
|
+
:version => Gem::Requirement.default,
|
12
|
+
:latest => false,
|
13
|
+
:all => false
|
14
|
+
|
15
|
+
add_all_gems_option
|
16
|
+
add_latest_version_option
|
17
|
+
add_version_option
|
18
|
+
add_exact_match_option
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_all_gems_option
|
22
|
+
add_option('-a', '--all',
|
23
|
+
'List all installed gems that have manuals.') do |value, options|
|
24
|
+
options[:all] = true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_latest_version_option
|
29
|
+
add_option('-l', '--latest',
|
30
|
+
'If there are multiple versions, open the latest') do |value, options|
|
31
|
+
options[:latest] = true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def add_exact_match_option
|
36
|
+
add_option('-x', '--exact', 'Only list exact matches') do |value, options|
|
37
|
+
options[:exact] = true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def arguments
|
42
|
+
"GEMNAME gem whose manual you wish to read"
|
43
|
+
end
|
44
|
+
|
45
|
+
def execute
|
46
|
+
if options[:all]
|
47
|
+
puts "These gems have man pages:", ''
|
48
|
+
Gem.source_index.gems.each do |name, spec|
|
49
|
+
puts "#{spec.name} #{spec.version}" if spec.has_manpage?
|
50
|
+
end
|
51
|
+
else
|
52
|
+
# Grab our target gem.
|
53
|
+
name = get_one_gem_name
|
54
|
+
|
55
|
+
# Try to read manpages.
|
56
|
+
read_manpage get_spec(name) { |s| s.has_manpage? }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def read_manpage(spec)
|
61
|
+
return if spec.nil?
|
62
|
+
|
63
|
+
paths = spec.manpages
|
64
|
+
|
65
|
+
# man/ron.1 => ron(1)
|
66
|
+
names = paths.map do |path|
|
67
|
+
path.sub(/.*\/(.+)\.(\d+)/, '\1(\2)')
|
68
|
+
end
|
69
|
+
|
70
|
+
if paths.size == 1
|
71
|
+
manpath = paths[0]
|
72
|
+
elsif paths.size > 1
|
73
|
+
name, index = choose_from_list("View which manual?", names)
|
74
|
+
manpath = paths[index]
|
75
|
+
end
|
76
|
+
|
77
|
+
if manpath
|
78
|
+
exec "man #{File.join(gem_path(spec), manpath)}"
|
79
|
+
else
|
80
|
+
abort "no manuals found for #{spec.name}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def gem_path(spec)
|
85
|
+
File.join(spec.installation_path, "gems", spec.full_name)
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_spec(name)
|
89
|
+
dep = Gem::Dependency.new(name, options[:version])
|
90
|
+
specs = Gem.source_index.search(dep)
|
91
|
+
|
92
|
+
if block_given?
|
93
|
+
specs = specs.select { |spec| yield spec}
|
94
|
+
end
|
95
|
+
|
96
|
+
if specs.length == 0
|
97
|
+
# If we have not tried to do a pattern match yet, fall back on it.
|
98
|
+
if !options[:exact] && !name.is_a?(Regexp)
|
99
|
+
pattern = /#{Regexp.escape name}/
|
100
|
+
get_spec(pattern)
|
101
|
+
else
|
102
|
+
say "#{name.inspect} is not available"
|
103
|
+
nil
|
104
|
+
end
|
105
|
+
elsif specs.length == 1 || options[:latest]
|
106
|
+
specs.last
|
107
|
+
else
|
108
|
+
choices = specs.map { |s| "#{s.name} #{s.version}" }
|
109
|
+
c, i = choose_from_list "Open which gem?", choices
|
110
|
+
specs[i] if i
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
data/man/gem-man.1
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
.\" generated with Ron/v0.3
|
2
|
+
.\" http://github.com/rtomayko/ron/
|
3
|
+
.
|
4
|
+
.TH "GEM\-MAN" "1" "March 2010" "DEFUNKT" "RubyGems Manual"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBgem-man\fR \-\- view a gem's man page
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBgem man\fR \fIGEM\fR
|
11
|
+
.
|
12
|
+
.br
|
13
|
+
\fBgem man\fR \-\-latest \fIGEM\fR
|
14
|
+
.
|
15
|
+
.br
|
16
|
+
\fBgem man\fR \-\-exact \fIGEM\fR
|
17
|
+
.
|
18
|
+
.br
|
19
|
+
\fBgem man\fR \-\-list
|
20
|
+
.
|
21
|
+
.br
|
22
|
+
.
|
23
|
+
.SH "DESCRIPTION"
|
24
|
+
The \fBgem man\fR command can be used to display a man page for an
|
25
|
+
installed RubyGem. The man page must be included with the gem \- \fBgem-man\fR does no generation or magic.
|
26
|
+
.
|
27
|
+
.P
|
28
|
+
For an introduction to man pages, see \fBman(1)\fR (or type \fBman man\fR in
|
29
|
+
your shell).
|
30
|
+
.
|
31
|
+
.SH "GEM"
|
32
|
+
\fBgem man\fR expects to be passed the name of an installed gem. If there
|
33
|
+
are multiple man pages found for the gem, you will be asked which
|
34
|
+
you'd like to view. If only a single man page is found it will be
|
35
|
+
displayed.
|
36
|
+
.
|
37
|
+
.P
|
38
|
+
Man pages are any files whose extension is a single digit [0\-9],
|
39
|
+
e.g. \fBron.1\fR.
|
40
|
+
.
|
41
|
+
.SH "OPTIONS"
|
42
|
+
\fBgem man\fR's default mode of operation is to open a man page for a
|
43
|
+
single gem or, if multiple man pages are found, ask which you'd like
|
44
|
+
to open. If there are any ambiguities as to which gem to use, \fBgem
|
45
|
+
man\fR will ask which you'd prefer.
|
46
|
+
.
|
47
|
+
.P
|
48
|
+
You can specify gems or list available gems using a few options.
|
49
|
+
.
|
50
|
+
.TP
|
51
|
+
\fB-l\fR, \fB--latest\fR
|
52
|
+
If there are multiple versions of a gem, open the latest.
|
53
|
+
.
|
54
|
+
.TP
|
55
|
+
\fB-v\fR, \fB--version\fR
|
56
|
+
Specify version of gem to man.
|
57
|
+
.
|
58
|
+
.TP
|
59
|
+
\fB-e\fR, \fB--exact\fR
|
60
|
+
Only list exact matches.
|
61
|
+
.
|
62
|
+
.TP
|
63
|
+
\fB-a\fR, \fB--all\fR
|
64
|
+
List all installed gems that have manuals.
|
65
|
+
.
|
66
|
+
.P
|
67
|
+
See \fBgem help man\fR to view the options at any time.
|
68
|
+
.
|
69
|
+
.SH "INSTALL"
|
70
|
+
.
|
71
|
+
.nf
|
72
|
+
|
73
|
+
\fBgem install gem-man \fR
|
74
|
+
.
|
75
|
+
.fi
|
76
|
+
.
|
77
|
+
.SH "BUGS"
|
78
|
+
Requires the \fBman(1)\fR script to be in your path, executable, and to
|
79
|
+
accept a full path to a manual.
|
80
|
+
.
|
81
|
+
.P
|
82
|
+
Requires Ruby and RubyGems 1.3.2 (or higher).
|
83
|
+
.
|
84
|
+
.P
|
85
|
+
Please report other bugs at \fIhttp://github.com/defunkt/gem\-man\fR
|
86
|
+
.
|
87
|
+
.SH "THANKS"
|
88
|
+
.
|
89
|
+
.IP "\(bu" 4
|
90
|
+
adamsanderson for open_gem
|
91
|
+
.
|
92
|
+
.IP "\(bu" 4
|
93
|
+
rtomayko for ron
|
94
|
+
.
|
95
|
+
.IP "" 0
|
96
|
+
.
|
97
|
+
.SH "COPYRIGHT"
|
98
|
+
gem\-man is Copyright (C) 2010 Chris Wanstrath with parts from Adam
|
99
|
+
Sanderson.
|
100
|
+
.
|
101
|
+
.SH "SEE ALSO"
|
102
|
+
ron(5), man(1), less(1), roff(7), groff(1),\fIhttp://en.wikipedia.org/wiki/Man_page\fR, \fIhttp://github.com/defunkt/gem\-man\fR
|
data/man/gem-man.1.html
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ron/v0.3'>
|
6
|
+
<title>gem-man(1) -- view a gem's man page</title>
|
7
|
+
<style type='text/css'>
|
8
|
+
body {margin:0}
|
9
|
+
#man, #man code, #man pre, #man tt, #man kbd, #man samp {
|
10
|
+
font-family:consolas,monospace;
|
11
|
+
font-size:16px;
|
12
|
+
line-height:1.3;
|
13
|
+
color:#343331;
|
14
|
+
background:#fff; }
|
15
|
+
#man { max-width:89ex; text-align:justify; margin:0 25px 25px 25px }
|
16
|
+
#man h1, #man h2, #man h3 { color:#232221;clear:left }
|
17
|
+
#man h1 { font-size:28px; margin:15px 0 30px 0; text-align:center }
|
18
|
+
#man h2 { font-size:18px; margin-bottom:0; margin-top:10px; line-height:1.3; }
|
19
|
+
#man h3 { font-size:16px; margin:0 0 0 4ex; }
|
20
|
+
#man p, #man ul, #man ol, #man dl, #man pre { margin:0 0 18px 0; }
|
21
|
+
#man pre {
|
22
|
+
color:#333231;
|
23
|
+
background:#edeceb;
|
24
|
+
padding:5px 7px;
|
25
|
+
margin:0px 0 20px 0;
|
26
|
+
border-left:2ex solid #ddd}
|
27
|
+
#man pre + h2, #man pre + h3 {
|
28
|
+
margin-top:22px;
|
29
|
+
}
|
30
|
+
#man h2 + pre, #man h3 + pre {
|
31
|
+
margin-top:5px;
|
32
|
+
}
|
33
|
+
#man > p, #man > ul, #man > ol, #man > dl, #man > pre { margin-left:8ex; }
|
34
|
+
#man dt { margin:0; clear:left }
|
35
|
+
#man dt.flush { float:left; width:8ex }
|
36
|
+
#man dd { margin:0 0 0 9ex }
|
37
|
+
#man code, #man strong, #man b { font-weight:bold; color:#131211; }
|
38
|
+
#man pre code { font-weight:normal; color:#232221; background:inherit }
|
39
|
+
#man em, var, u {
|
40
|
+
font-style:normal; color:#333231; border-bottom:1px solid #999; }
|
41
|
+
#man h1.man-title { display:none; }
|
42
|
+
#man ol.man, #man ol.man li { margin:2px 0 10px 0; padding:0;
|
43
|
+
float:left; width:33%; list-style-type:none;
|
44
|
+
text-transform:uppercase; font-size:18px; color:#999;
|
45
|
+
letter-spacing:1px;}
|
46
|
+
#man ol.man { width:100%; }
|
47
|
+
#man ol.man li.tl { text-align:left }
|
48
|
+
#man ol.man li.tc { text-align:center;letter-spacing:4px }
|
49
|
+
#man ol.man li.tr { text-align:right }
|
50
|
+
#man ol.man a { color:#999 }
|
51
|
+
#man ol.man a:hover { color:#333231 }
|
52
|
+
</style>
|
53
|
+
</head>
|
54
|
+
<body>
|
55
|
+
<div id='man'>
|
56
|
+
|
57
|
+
<h1 class='man-title'>gem-man(1)</h1>
|
58
|
+
|
59
|
+
<ol class='head man'>
|
60
|
+
<li class='tl'>gem-man(1)</li>
|
61
|
+
<li class='tc'>RubyGems Manual</li>
|
62
|
+
<li class='tr'>gem-man(1)</li>
|
63
|
+
</ol>
|
64
|
+
|
65
|
+
<h2 id='NAME'>NAME</h2>
|
66
|
+
<p><code>gem-man</code> -- view a gem's man page</p>
|
67
|
+
<h2>SYNOPSIS</h2>
|
68
|
+
|
69
|
+
<p><code>gem man</code> <var>GEM</var><br>
|
70
|
+
<code>gem man</code> --latest <var>GEM</var><br>
|
71
|
+
<code>gem man</code> --exact <var>GEM</var><br>
|
72
|
+
<code>gem man</code> --list<br>
|
73
|
+
</p>
|
74
|
+
|
75
|
+
<h2>DESCRIPTION</h2>
|
76
|
+
|
77
|
+
<p>The <code>gem man</code> command can be used to display a man page for an
|
78
|
+
installed RubyGem. The man page must be included with the gem -
|
79
|
+
<code>gem-man</code> does no generation or magic.</p>
|
80
|
+
|
81
|
+
<p>For an introduction to man pages, see <code>man(1)</code> (or type <code>man man</code> in
|
82
|
+
your shell).</p>
|
83
|
+
|
84
|
+
<h2>GEM</h2>
|
85
|
+
|
86
|
+
<p><code>gem man</code> expects to be passed the name of an installed gem. If there
|
87
|
+
are multiple man pages found for the gem, you will be asked which
|
88
|
+
you'd like to view. If only a single man page is found it will be
|
89
|
+
displayed.</p>
|
90
|
+
|
91
|
+
<p>Man pages are any files whose extension is a single digit [0-9],
|
92
|
+
e.g. <code>ron.1</code>.</p>
|
93
|
+
|
94
|
+
<h2>OPTIONS</h2>
|
95
|
+
|
96
|
+
<p><code>gem man</code>'s default mode of operation is to open a man page for a
|
97
|
+
single gem or, if multiple man pages are found, ask which you'd like
|
98
|
+
to open. If there are any ambiguities as to which gem to use, <code>gem
|
99
|
+
man</code> will ask which you'd prefer.</p>
|
100
|
+
|
101
|
+
<p>You can specify gems or list available gems using a few options.</p>
|
102
|
+
|
103
|
+
<dl>
|
104
|
+
<dt>
|
105
|
+
<code>-l</code>, <code>--latest</code>
|
106
|
+
</dt>
|
107
|
+
<dd><p>If there are multiple versions of a gem, open the latest.</p></dd>
|
108
|
+
<dt>
|
109
|
+
<code>-v</code>, <code>--version</code>
|
110
|
+
</dt>
|
111
|
+
<dd><p>Specify version of gem to man.</p></dd>
|
112
|
+
<dt>
|
113
|
+
<code>-e</code>, <code>--exact</code>
|
114
|
+
</dt>
|
115
|
+
<dd><p>Only list exact matches.</p></dd>
|
116
|
+
<dt>
|
117
|
+
<code>-a</code>, <code>--all</code>
|
118
|
+
</dt>
|
119
|
+
<dd><p>List all installed gems that have manuals.</p></dd>
|
120
|
+
</dl>
|
121
|
+
|
122
|
+
|
123
|
+
<p>See <code>gem help man</code> to view the options at any time.</p>
|
124
|
+
|
125
|
+
<h2>INSTALL</h2>
|
126
|
+
|
127
|
+
<pre><code>gem install gem-man
|
128
|
+
</code></pre>
|
129
|
+
|
130
|
+
<h2>BUGS</h2>
|
131
|
+
|
132
|
+
<p>Requires the <code>man(1)</code> script to be in your path, executable, and to
|
133
|
+
accept a full path to a manual.</p>
|
134
|
+
|
135
|
+
<p>Requires Ruby and RubyGems 1.3.2 (or higher).</p>
|
136
|
+
|
137
|
+
<p>Please report other bugs at <a href="http://github.com/defunkt/gem-man">http://github.com/defunkt/gem-man</a></p>
|
138
|
+
|
139
|
+
<h2>THANKS</h2>
|
140
|
+
|
141
|
+
<ul>
|
142
|
+
<li>adamsanderson for open_gem</li>
|
143
|
+
<li>rtomayko for ron</li>
|
144
|
+
</ul>
|
145
|
+
|
146
|
+
|
147
|
+
<h2>COPYRIGHT</h2>
|
148
|
+
|
149
|
+
<p>gem-man is Copyright (C) 2010 Chris Wanstrath with parts from Adam
|
150
|
+
Sanderson.</p>
|
151
|
+
|
152
|
+
<h2>SEE ALSO</h2>
|
153
|
+
|
154
|
+
<p>ron(5), man(1), less(1), roff(7), groff(1),
|
155
|
+
<a href="http://en.wikipedia.org/wiki/Man_page">http://en.wikipedia.org/wiki/Man_page</a>,
|
156
|
+
<a href="http://github.com/defunkt/gem-man">http://github.com/defunkt/gem-man</a></p>
|
157
|
+
|
158
|
+
<ol class='foot man'>
|
159
|
+
<li class='tl'>DEFUNKT</li>
|
160
|
+
<li class='tc'>March 2010</li>
|
161
|
+
<li class='tr'>gem-man(1)</li>
|
162
|
+
</ol>
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</body>
|
166
|
+
</html>
|
data/man/gem-man.1.ron
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
gem-man(1) -- view a gem's man page
|
2
|
+
===================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`gem man` <GEM>
|
7
|
+
`gem man` --latest <GEM>
|
8
|
+
`gem man` --exact <GEM>
|
9
|
+
`gem man` --all
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
The `gem man` command can be used to display a man page for an
|
14
|
+
installed RubyGem. The man page must be included with the gem -
|
15
|
+
`gem-man` does no generation or magic.
|
16
|
+
|
17
|
+
For an introduction to man pages, see `man(1)` (or type `man man` in
|
18
|
+
your shell).
|
19
|
+
|
20
|
+
## GEM
|
21
|
+
|
22
|
+
`gem man` expects to be passed the name of an installed gem. If there
|
23
|
+
are multiple man pages found for the gem, you will be asked which
|
24
|
+
you'd like to view. If only a single man page is found it will be
|
25
|
+
displayed.
|
26
|
+
|
27
|
+
Man pages are any files whose extension is a single digit [0-9],
|
28
|
+
e.g. `ron.1`.
|
29
|
+
|
30
|
+
## OPTIONS
|
31
|
+
|
32
|
+
`gem man`'s default mode of operation is to open a man page for a
|
33
|
+
single gem or, if multiple man pages are found, ask which you'd like
|
34
|
+
to open. If there are any ambiguities as to which gem to use, `gem
|
35
|
+
man` will ask which you'd prefer.
|
36
|
+
|
37
|
+
You can specify gems or list available gems using a few options.
|
38
|
+
|
39
|
+
* `-l`, `--latest`:
|
40
|
+
If there are multiple versions of a gem, open the latest.
|
41
|
+
|
42
|
+
* `-v`, `--version`:
|
43
|
+
Specify version of gem to man.
|
44
|
+
|
45
|
+
* `-e`, `--exact`:
|
46
|
+
Only list exact matches.
|
47
|
+
|
48
|
+
* `-a`, `--all`:
|
49
|
+
List all installed gems that have manuals.
|
50
|
+
|
51
|
+
See `gem help man` to view the options at any time.
|
52
|
+
|
53
|
+
## INSTALL
|
54
|
+
|
55
|
+
gem install gem-man
|
56
|
+
|
57
|
+
## BUGS
|
58
|
+
|
59
|
+
Requires the `man(1)` script to be in your path, executable, and to
|
60
|
+
accept a full path to a manual.
|
61
|
+
|
62
|
+
Requires Ruby and RubyGems 1.3.2 (or higher).
|
63
|
+
|
64
|
+
Please report other bugs at <http://github.com/defunkt/gem-man>
|
65
|
+
|
66
|
+
## THANKS
|
67
|
+
|
68
|
+
* adamsanderson for open_gem
|
69
|
+
* rtomayko for ron
|
70
|
+
|
71
|
+
## COPYRIGHT
|
72
|
+
|
73
|
+
gem-man is Copyright (C) 2010 Chris Wanstrath with parts from Adam
|
74
|
+
Sanderson.
|
75
|
+
|
76
|
+
## SEE ALSO
|
77
|
+
|
78
|
+
ron(5), man(1), less(1), roff(7), groff(1),
|
79
|
+
<http://en.wikipedia.org/wiki/Man_page>,
|
80
|
+
<http://github.com/defunkt/gem-man>
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gem-man
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Wanstrath
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-03-06 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: " The `gem man` command can be used to display a man page for an\n installed RubyGem. The man page must be included with the gem -\n `gem-man` does no generation or magic.\n\n For an introduction to man pages, see `man(1)` (or type `man man` in\n your shell).\n"
|
17
|
+
email: chris@ozmm.org
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- LICENSE
|
28
|
+
- lib/rubygems/commands/man_command.rb
|
29
|
+
- lib/rubygems/gem/specification.rb
|
30
|
+
- lib/rubygems_plugin.rb
|
31
|
+
- man/gem-man.1
|
32
|
+
- man/gem-man.1.html
|
33
|
+
- man/gem-man.1.ron
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/defunkt/gem-man
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
requirements: []
|
56
|
+
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.3.5
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: View a gem's man page.
|
62
|
+
test_files: []
|
63
|
+
|