open_gem 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
- :major: 1
3
2
  :minor: 3
4
- :patch: 0
3
+ :patch: 1
4
+ :major: 1
@@ -16,10 +16,13 @@ module OpenGem
16
16
 
17
17
  def get_spec(name)
18
18
  dep = Gem::Dependency.new name, options[:version]
19
- specs = Gem.source_index.search(dep).select{|spec| spec.has_rdoc?}
19
+ specs = Gem.source_index.search(dep)
20
+ if block_given?
21
+ specs = specs.select{|spec| yield spec}
22
+ end
20
23
 
21
24
  if specs.length == 0
22
- say "Could not find docs for '#{name}'"
25
+ say "'#{name}' is not available"
23
26
  return nil
24
27
 
25
28
  elsif specs.length == 1 || options[:latest]
@@ -20,7 +20,7 @@ class Gem::Commands::ReadCommand < Gem::Command
20
20
 
21
21
  def execute
22
22
  name = get_one_gem_name
23
- spec = get_spec name
23
+ spec = get_spec(name){|s| s.has_rdoc? }
24
24
  if spec && path = get_path(spec)
25
25
  if File.exists? path
26
26
  read_gem path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Sanderson