bri 0.4.2 → 0.4.3

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
  SHA256:
3
- metadata.gz: 2a207a768943836bb63dea1964e177e4eef7dbfa7e07c26b76fa3cf254c1db86
4
- data.tar.gz: 6bb5e69bdb8bd7050e179cf51d49084facd31b8a900b06ddcacc030503718fee
3
+ metadata.gz: b20f64d2f12c1afba4d051de9aa6a091167743eefdc88410dddec663795e271f
4
+ data.tar.gz: 6c34a20f61319303f3877cdda56d757fc29a83ee8b89c8b2a9c4529b8f02d372
5
5
  SHA512:
6
- metadata.gz: 4388dd1a1a040b7f51d49ddc67131d3f0865e39a3120e9816373490bddb408aa26b40b32a946b3246dacdb98113503165a9cdee368d248d07602dccd6bb685cc
7
- data.tar.gz: 68b5edcf218e9c63545e253ce697851d0653f9c50104656962552566e8674ffe9848eff6c42e4dfbfe55b6b2ab6d9aa53323a48d43d8ba29a948fefce2cb7abf
6
+ metadata.gz: 6732a87a376c437b97f84f06617baea7b7e2f23ac208d1124adad119ff52beb65081208ec3d11a863a72718e43a5aeacb15a73fc76aad63ef0c2ab84e44e9c40
7
+ data.tar.gz: bc7d3406f8cca348c58f1435e88174d46f159243ff09661b9ddc0114bdc967d6954e1be263602692af4af98f24e3bf2285a8f69fb9d04311fc54f9ec7753b13b
data/Changelog CHANGED
@@ -1,3 +1,9 @@
1
+ 0.4.3
2
+ - If multiple documentations are found that are all class documentations,
3
+ display all of these. This is useful in cases that gems extend core
4
+ classes e.g. ActiveSupport.
5
+ - Reduce the amount of vertical whitespace caused by rendering empty rdoc nodes
6
+
1
7
  0.4.2
2
8
  - Fix broken --list-names option
3
9
  - Fix broken multiple choice display
@@ -39,6 +39,13 @@ Bri is a Beautiful RI formatter.
39
39
  # the given search term, and finally looking for the term
40
40
  # anywhere in the method name
41
41
 
42
+ = Note on ri docs generated by rvm
43
+
44
+ If you're using `rvm docs generate` and can't see the listing of
45
+ methods in class documentations, this is due to rvm marking all methods
46
+ as private during generation. A workaround for now is to generate the ri
47
+ documentation with `rdoc --ri`.
48
+
42
49
  = Caveats
43
50
  I'm reviving this project that has been left rotting for nearly 8 years.
44
51
  Due to bitrot, changes in rdoc internals and trying to understand my code
data/bin/bri CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'bri'
3
3
  require 'optparse'
4
+ require 'byebug'
4
5
 
5
6
  @options = {
6
7
  :list_classes => false,
data/lib/bri.rb CHANGED
@@ -18,6 +18,8 @@ module Bri
18
18
  "No matching results found"
19
19
  elsif results.size == 1
20
20
  results.first.to_s
21
+ elsif results.all? { |r| r.is_a?(Bri::Match::Class) }
22
+ results.map(&:to_s)
21
23
  else
22
24
  qualified_methods = results.map(&:full_name).sort
23
25
  ERB.new( Bri::Templates::MULTIPLE_CHOICES, nil, '<>' ).result( binding )
@@ -8,7 +8,7 @@ module Bri
8
8
 
9
9
  private
10
10
  def build_description( source )
11
- source.map { |element| Bri::Renderer.render( element ) }
11
+ source.map { |element| Bri::Renderer.render( element ) }.compact
12
12
  end
13
13
  end
14
14
  end
@@ -54,9 +54,14 @@ module Bri
54
54
 
55
55
  else
56
56
  text = extract_text( element, width, alignment_width )
57
- styled_text = replace_markup( text )
58
- wrapped_text = wrap_to_width( styled_text, width )
59
- indent( wrapped_text )
57
+
58
+ if text == "\n"
59
+ nil
60
+ else
61
+ styled_text = replace_markup( text )
62
+ wrapped_text = wrap_to_width( styled_text, width )
63
+ indent( wrapped_text )
64
+ end
60
65
  end
61
66
  end
62
67
 
@@ -3,9 +3,9 @@ module Bri
3
3
  class Class < Base
4
4
  def search( type = :fully_qualified )
5
5
  # NOTE: classes are only searched as fully qualified for the time being
6
- # FIXME: What do we do if more than one store defines the same class?
7
- store = Bri::Mall.instance.stores.detect { |s| s.module_names.include?( @term ) }
8
- @matches << Bri::Match::Class.new( store.load_class( @term ), store ) if store
6
+ Bri::Mall.instance.stores.select { |s| s.module_names.include?( @term ) }.each do |store|
7
+ @matches << Bri::Match::Class.new( store.load_class( @term ), store )
8
+ end
9
9
  end
10
10
  end
11
11
  end
@@ -47,7 +47,7 @@ describe Bri::Match::Class do
47
47
 
48
48
  describe "#description_paragraphs" do
49
49
  it "should be empty for an undocumented class" do
50
- empty_class.description_paragraphs.should == [ '' ]
50
+ empty_class.description_paragraphs.should == []
51
51
  end
52
52
 
53
53
  it "should contain rendered text for a documented class" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Riedel