markdown_ruby_documentation 0.6.0 → 0.7.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
  SHA1:
3
- metadata.gz: e8c6f0e6b1c0fb7528b57ad280a000931265d2f2
4
- data.tar.gz: 77ffedcd22721423e8467e5ffe01bb75fb80d4b7
3
+ metadata.gz: c248958b8c7d4683bb64446558b9846c182c7b89
4
+ data.tar.gz: cc9fa458990652a3103b9bb9b00b8e6cb86235fb
5
5
  SHA512:
6
- metadata.gz: 29f309277dc2b1bbcf9889b6163a38353de6fd891190c216e230b8224d7847247583971c813edbb33a270ca2b14d25f68564eecd1a6e123f7202618c4d377945
7
- data.tar.gz: 06d6fdc408865c05d96b473468f933428c532d34153da397a6c9c68b3bf9b00d1be619c897a02850afa5a0badbb6de11fea16bda7263e0f7a7f7366b26c338d4
6
+ metadata.gz: e1f2f283abe8ea344d31d0eb9f2ad9a2afb324a5b02a2ac1cf3b0ae8806797dfa093efc78e80468a2ecc755f913b4247b62b0ffd3ed6419566ea96a309496801
7
+ data.tar.gz: 7c515980591c1c681066003eaa1a8b16991fb4eec78442c1718400c4146b1df1b3264fed9affdf4b7e935518fdceb5dfe77ec41fada6f1cf567792606863f11c
data/README.md CHANGED
@@ -105,7 +105,7 @@ Converts case statements and if statements to bulleted markdown
105
105
  * ruby_if_statement_to_md, options: proc(replacement, match)
106
106
  * ruby_case_statement_to_md, options: proc(replacement, match)
107
107
  * ruby_operators_to_english, options: proc(replacement, match)
108
- * methods_as_local_links, options: method_to_class: { method_name => OwningConstant }
108
+ * methods_as_local_links, options: method_to_class: { method_name => OwningConstant }, proc(replacement, match)
109
109
  * question_mark_method_format, options: proc(replacement, match)
110
110
  * remove_end_keyword, options: proc(replacement, match)
111
111
  * constants_with_name_and_value, options: proc(replacement, match, opt={})
@@ -339,14 +339,16 @@ module MarkdownRubyDocumentation
339
339
 
340
340
  def methods_as_local_links(ruby_source,
341
341
  call_on_title: :titleize,
342
- method_to_class: {})
342
+ method_to_class: {},
343
+ proc: false)
343
344
  ruby_source.gsub(MethodLink::RUBY_METHOD_REGEX) do |match|
344
345
  if is_a_method_on_ruby_class?(match)
345
- MethodLink.new(match: match,
346
- ruby_class: ruby_class,
347
- call_on_title: call_on_title,
348
- method_to_class: method_to_class,
349
- link_to_markdown: method(:link_to_markdown)).link
346
+ replacement = MethodLink.new(match: match,
347
+ ruby_class: ruby_class,
348
+ call_on_title: call_on_title,
349
+ method_to_class: method_to_class,
350
+ link_to_markdown: method(:link_to_markdown)).link
351
+ proc ? proc.call(replacement, match) : replacement
350
352
  else
351
353
  match
352
354
  end
@@ -1,3 +1,3 @@
1
1
  module MarkdownRubyDocumentation
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_ruby_documentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler