solargraph 0.37.1 → 0.37.2

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: f830526bc708218047c91c766887acc1c2e8be3d3bfb84d0dfa48e518367e768
4
- data.tar.gz: 27bcecb0e88b0059dd224dc8cee3a6c1c17c64d02bfdbe1342ed775acfc0212f
3
+ metadata.gz: 6c6e8cd33eaba452660f445e5edf77658e1a3bf0e7604b753b6632e06ce4af00
4
+ data.tar.gz: bf6d0596a144b1bee2968e87f451b02a60cafa35c9871a0abe8b0f29a1c360cc
5
5
  SHA512:
6
- metadata.gz: 27dc873bc5e79b7cb2e0d87adb04cdc53b5068082a679ebca0a9d0c87dd7d30285897f03e3658d3064ba7898d2d456dfbac570f9112d45fbdfea1db5ae9d8e1d
7
- data.tar.gz: 2a114fe815f3f6f0bf64f282d72f7b4a5b3215675f294c1465f4377196fd7fdead1f23021a665db71210752c69fd6249a42a0d86c9991d9ed0fa9ffe0d6d4ceb
6
+ metadata.gz: 5f28aa0e7914a6d8f04bb25ea99f81cbb795a1d1bb76121397aa291e0db1132e108fd71ed814d4b65807ed985dbf60b4909a20e976cca0ed80c66e6770224b7c
7
+ data.tar.gz: 79cc5e511a24c736f7564233f9c0bdc0593b738c739c9fc7897bca7e3b2e2361d0f520ccea009514acc4f2dcd4d60b05778487af2c4d18367a0222abe40b1e65
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rdoc'
4
3
  require 'reverse_markdown'
5
- require 'yard'
6
4
 
7
5
  module Solargraph
8
6
  module Pin
@@ -12,11 +10,16 @@ module Solargraph
12
10
  # @return [String]
13
11
  def documentation
14
12
  @documentation ||= begin
15
- text = normalize_indentation(docstring.to_s)
16
- markup = YARD::Templates::Helpers::Markup::RDocMarkup.new(text)
17
- html = markup.to_html
18
- ReverseMarkdown.convert(html, github_flavored: true)
19
- .lines.map(&:rstrip).join("\n")
13
+ indented = false
14
+ normalize_indentation(docstring.to_s).gsub(/\t/, ' ').lines.map { |l|
15
+ if l =~ /^ [^\s]/ || (l.start_with?(' ') && indented)
16
+ indented = true
17
+ " #{l}"
18
+ else
19
+ indented = false
20
+ l # (was `unhtml l`)
21
+ end
22
+ }.join
20
23
  end
21
24
  end
22
25
 
@@ -36,6 +39,15 @@ module Solargraph
36
39
  return line unless spaces.odd?
37
40
  line[1..-1]
38
41
  end
42
+
43
+ # @todo This was tested as a simple way to convert some of the more
44
+ # common markup in documentation to Markdown. We should still look
45
+ # for a solution, but it'll have to be more robust than this.
46
+ def unhtml text
47
+ text.gsub(/\<\/?(code|tt)\>/, '`')
48
+ .gsub(/\<\/?(em|i)\>/, '*')
49
+ .gsub(/\<\/?(strong|b)\>/, '**')
50
+ end
39
51
  end
40
52
  end
41
53
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.37.1'
4
+ VERSION = '0.37.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solargraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.1
4
+ version: 0.37.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2019-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport