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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 752ce505aa9161ab73ffa1828d2656e7d228e563
4
- data.tar.gz: 6ef2ae0f07e4592fc728e0f3a27ae016449c9d3c
3
+ metadata.gz: fa6730f62c2c9c1b461273f805b2c21d11e7c9fc
4
+ data.tar.gz: 62b2fee0824727e72a4ed67a72ccae3216e3b083
5
5
  SHA512:
6
- metadata.gz: ecd08f03b1f50b0d48b0fe17ae67fb0c4c0f825147ef88269637c217ce26f6b6201756d9f839ed3e7846c77f5a2761db10082e6634d986141c3fc1fd84b0a1a9
7
- data.tar.gz: c9e0bd148723ea02f859800d1ec3f2387df7745afaaefa296efa31aa615b2d4745cee1b6dbfc412251f9407a393976dc32ea2df5ceeda0fcaf99c0c1a86b1272
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
- say "Generating man pages for #{gem.full_name}..."
28
- RDoc::RDoc.new.document [
29
- "-q",
30
- "-f", "mdoc",
31
- "--section", "#{mandb_section(gem)}",
32
- "-o", "#{output_directory}",
33
- *Dir.glob(gem.lib_dirs_glob),
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 output_directory
52
- File.join(Dir.home, ".man")
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.gsub(".", "-")}"
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
@@ -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.1"
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler