rubygems-gman 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubygems/commands/gman_command.rb +31 -11
- data/rubygems-gman.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa6730f62c2c9c1b461273f805b2c21d11e7c9fc
|
4
|
+
data.tar.gz: 62b2fee0824727e72a4ed67a72ccae3216e3b083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8478044505571ec3fac70f6ca0a30eac377a1819526fdf96897051b60e27bf0aaca6f10d54f1e0b2c41eddba32f9a9393c62a1a4d0b5b31f1fc64e4ba921feef
|
7
|
+
data.tar.gz: f70c0bd0a724d908e3277404c564d27f0c5e5246dbd646410499ed4fbe477b084bc18c5e26c21e6dee8191b9bff7d3e8d17b91a04f5a8cf5f44d3f2d1e9c2106
|
@@ -24,14 +24,14 @@ class Gem::Commands::GmanCommand < Gem::Command
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def document(gem)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
27
|
+
inside_gem_directory gem do
|
28
|
+
if files(gem).empty?
|
29
|
+
say "No source files found for #{gem.full_name}."
|
30
|
+
else
|
31
|
+
say "Generating man pages for #{gem.full_name}..."
|
32
|
+
run_rdoc(gem)
|
33
|
+
end
|
34
|
+
end
|
35
35
|
rescue => exception
|
36
36
|
say "Failed to generate man pages for #{gem.full_name} (#{exception})."
|
37
37
|
end
|
@@ -48,11 +48,31 @@ class Gem::Commands::GmanCommand < Gem::Command
|
|
48
48
|
Gem::Specification.each { |gem| document gem }
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
52
|
-
|
51
|
+
def inside_gem_directory(gem, &block)
|
52
|
+
Dir.chdir gem.full_gem_path, &block
|
53
|
+
end
|
54
|
+
|
55
|
+
def files(gem)
|
56
|
+
(gem.source_paths + gem.extra_rdoc_files).select do |path|
|
57
|
+
File.exists?(path)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def run_rdoc(gem)
|
62
|
+
RDoc::RDoc.new.document [
|
63
|
+
"-q",
|
64
|
+
"-f", "mdoc",
|
65
|
+
"--section", "#{mandb_section(gem)}",
|
66
|
+
"-o", "#{output_directory}",
|
67
|
+
*files(gem),
|
68
|
+
]
|
53
69
|
end
|
54
70
|
|
55
71
|
def mandb_section(gem)
|
56
|
-
"3-rubygems-#{gem.name}-#{gem.version.to_s
|
72
|
+
"3-rubygems-#{gem.name}-#{gem.version.to_s}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def output_directory
|
76
|
+
File.join(Dir.home, ".man")
|
57
77
|
end
|
58
78
|
end
|
data/rubygems-gman.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "rubygems-gman"
|
6
|
-
spec.version = "0.0.
|
6
|
+
spec.version = "0.0.2"
|
7
7
|
spec.authors = ["Calle Erlandsson"]
|
8
8
|
spec.email = ["calle@thoughtbot.com", "hello@thoughtbot.com"]
|
9
9
|
spec.summary = "Generate and install man pages for installed gems."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-gman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calle Erlandsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|