bri 0.4.4 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74b87ae62d01b5be9164734271754be0cc3a1ef68ad3b35bd78b633d829a529a
4
- data.tar.gz: 27fdfe717c1cea3b49525ff5e9c59b462757d1d86db440bd4dc1fd9719f47c70
3
+ metadata.gz: a88edaf5dc38f84306db04f904d1fb32859536587b7fa5ce84f3be687c5d1638
4
+ data.tar.gz: 1d8ace29c2676219311960e6729bc8b0e453ae00fd5a88294f809be65955024f
5
5
  SHA512:
6
- metadata.gz: e0d96c3ae752ec0b5b3fb59ad58da596869fd91665282eeb588ba8c03041b3f26040f331189b9db84a6d55aaf5e5540430dddbd07c925a7dde198ed6939bc7f0
7
- data.tar.gz: 4f3cc64561cb91cc53caf689611c32f6daf8d0482eb2bee3407358fad32fd808e0b70ce613c979b57917c0c2afe4b135f48f46e19de8888a167591d205aadecc
6
+ metadata.gz: 3e7eb14da6bd17fdff9e5db187fe086f9592dcb682c18e082248ab61ef37685fd81e16cbe49198fbf9446cf3eccb1ac5f163ba7da906ef1b67a38329cfdb3eb2
7
+ data.tar.gz: 91fef7322fd718245385929888a5dcf48616c07c247621d4e22f8369b625e77185969af70fff295bc1538c0bcb5b2651a716143d15b54ee8f830f71439bbe317
data/Changelog CHANGED
@@ -1,3 +1,5 @@
1
+ 0.5.0
2
+ - Update rdoc requirement to 6.13
1
3
  0.4.4
2
4
  - No longer display all found class/module documentation found. If core
3
5
  documentation is available, output only that, otherwise falls back to gem
data/bin/bri CHANGED
@@ -25,6 +25,7 @@ def parse_options
25
25
  opts.on( "-l", "--list-names", "List known namespaces/methods" ) { |v| @options[:list_names] = true }
26
26
  opts.on( "-w", "--width [COLUMNS]", "Set the output width", Integer ) { |v| Bri.width = v.to_i - 8 }
27
27
  opts.on( "-a", "--all", "Output all documentation for the term. Prefers core documents otherwise") { |v| @options[:show_all] = true }
28
+ opts.on( "-v", "--version", "0.5.0.beta1")
28
29
  opts.on_tail( "-h", "--help", "This help text" ) { puts opts; exit }
29
30
  end
30
31
  parser.parse!( ARGV )
data/lib/bri/mall.rb CHANGED
@@ -31,8 +31,11 @@ module Bri
31
31
  private
32
32
  def initialize
33
33
  # We want: system, site, home and gem documentation
34
- @stores = RDoc::RI::Paths.each( true, true, true, true ).each_with_object( [] ) do |(path, type), stores|
35
- stores << RDoc::Store.new( path, type ).tap { |store| store.load_cache }
34
+ options = RDoc::Options.new
35
+ @stores = RDoc::RI::Paths.each( true, true, true, true ).
36
+ each_with_object( [] ) do |(path, type), stores|
37
+ stores << RDoc::Store.new( options, path: path, type: type ).
38
+ tap { |store| store.load_cache }
36
39
  end
37
40
  end
38
41
  end
@@ -2,11 +2,16 @@ module Bri
2
2
  module Match
3
3
  class Base
4
4
  def to_s
5
- ERB.new( self.class.const_get( :TEMPLATE ), nil, '<>' ).
5
+ ERB.new( self.class.const_get( :TEMPLATE ), trim_mode: '<>' ).
6
6
  result( binding )
7
7
  end
8
8
 
9
9
  private
10
+ def build_description_from_comment( comment )
11
+ document = comment.instance_variable_get( :@document )
12
+ build_description( document.parts )
13
+ end
14
+
10
15
  def build_description( source )
11
16
  source.map { |element| Bri::Renderer.render( element ) }.compact
12
17
  end
@@ -18,7 +18,8 @@ module Bri
18
18
  @type = rdoc_result.type
19
19
  @name = "#{rdoc_result.full_name}"
20
20
  @name << " < #{rdoc_result.superclass}" if @type == "class" && rdoc_result.superclass
21
- @description_paragraphs = build_description( rdoc_result.comment.parts )
21
+
22
+ @description_paragraphs = build_description_from_comment( rdoc_result.comment )
22
23
  @includes = rdoc_result.includes.map(&:full_name)
23
24
  @extends = rdoc_result.extends.map(&:full_name)
24
25
  @attributes = rdoc_result.attributes.map { |a| "#{a.name} (#{a.rw})" }
@@ -11,7 +11,8 @@ module Bri
11
11
  @call_syntaxes = rdoc_method.arglists.lines( chomp: true ).
12
12
  map { |e| e.prepend( " " ) }.
13
13
  join( "\n" ) + "\n" rescue ''
14
- @description_paragraphs = build_description( rdoc_method.comment.parts )
14
+
15
+ @description_paragraphs = build_description_from_comment( rdoc_method.comment )
15
16
  @origin = store&.friendly_path
16
17
  end
17
18
  end
@@ -9,10 +9,14 @@ describe Bri::Match::Method do
9
9
  double( RDoc::Markup::Document, :parts => [ fake_paragraph ] )
10
10
  end
11
11
 
12
+ let( :fake_comment ) do
13
+ double( RDoc::Comment, :instance_variable_get => fake_description )
14
+ end
15
+
12
16
  let( :rdoc_method ) do
13
17
  double( RDoc::AnyMethod, :full_name => "This::IS::My.full_name",
14
- :arglists => "First\nSecond\nThird",
15
- :comment => fake_description )
18
+ :arglists => "First\nSecond\nThird",
19
+ :comment => fake_comment )
16
20
  end
17
21
 
18
22
  describe "#initialize" do
@@ -4,9 +4,10 @@ describe Bri::Search::ClassMethod do
4
4
  context "the searches" do
5
5
  let( :paragraph ) { RDoc::Markup::Paragraph.new( "Foo Description" ) }
6
6
  let( :document ) { double( RDoc::Markup::Document, :parts => [ paragraph ] ) }
7
+ let( :comment ) { double( RDoc::Comment, :instance_variable_get => document ) }
7
8
  let( :rdoc_method ) { double( RDoc::AnyMethod, :full_name => "Foo",
8
- :arglists => "",
9
- :comment => document ) }
9
+ :arglists => "",
10
+ :comment => comment ) }
10
11
  before( :each ) do
11
12
  store_one = double( RDoc::RI::Store, :load_cache => true,
12
13
  :load_class => true,
@@ -4,9 +4,10 @@ describe Bri::Search::InstanceMethod do
4
4
  context "the searches" do
5
5
  let( :paragraph ) { RDoc::Markup::Paragraph.new( "Foo Description" ) }
6
6
  let( :document ) { double( RDoc::Markup::Document, :parts => [ paragraph ] ) }
7
+ let( :comment ) { double( RDoc::Comment, :instance_variable_get => document ) }
7
8
  let( :rdoc_method ) { double( RDoc::AnyMethod, :full_name => "Foo",
8
- :arglists => "",
9
- :comment => document ) }
9
+ :arglists => "",
10
+ :comment => comment ) }
10
11
  before( :each ) do
11
12
  store_one = double( RDoc::RI::Store, :load_cache => true,
12
13
  :load_class => true,
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Riedel
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
10
  date: 2011-05-20 00:00:00.000000000 Z
@@ -30,28 +29,28 @@ dependencies:
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: 6.1.1
32
+ version: 6.13.0
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 6.1.1
39
+ version: 6.13.0
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: rspec
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 3.8.0
46
+ version: 3.13.0
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: 3.8.0
53
+ version: 3.13.0
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rspec-its
57
56
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +120,6 @@ files:
121
120
  homepage: http://github.com/sriedel/bri
122
121
  licenses: []
123
122
  metadata: {}
124
- post_install_message:
125
123
  rdoc_options:
126
124
  - "--charset=UTF-8"
127
125
  require_paths:
@@ -137,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
135
  - !ruby/object:Gem::Version
138
136
  version: '0'
139
137
  requirements: []
140
- rubygems_version: 3.0.4
141
- signing_key:
138
+ rubygems_version: 3.6.5
142
139
  specification_version: 4
143
140
  summary: Beautified RI in the spirit of fastri/qri. Unlike fastri, bri builds on top
144
141
  of the rdoc 2.x/3.x backend, only output and formatting is handled by bri