lib/mdoc.rb in markdown_exec-1.8.9 vs lib/mdoc.rb in markdown_exec-2.0.0

- old
+ new

@@ -68,14 +68,14 @@ # Retrieves code blocks that are required by a specified code block. # # @param name [String] The name of the code block to start the retrieval from. # @return [Array<Hash>] An array of code blocks required by the specified code block. # - def collect_block_dependencies(name) - name_block = get_block_by_anyname(name) + def collect_block_dependencies(anyname:) + name_block = get_block_by_anyname(anyname) if name_block.nil? || name_block.keys.empty? - raise "Named code block `#{name}` not found. (@#{__LINE__})" + raise "Named code block `#{anyname}` not found. (@#{__LINE__})" end nickname = name_block[:nickname] || name_block[:oname] dependencies = collect_dependencies(nickname) # &bc 'dependencies.count:',dependencies.count @@ -114,13 +114,13 @@ # Collects recursively required code blocks and returns them as an array of strings. # # @param name [String] The name of the code block to start the collection from. # @return [Array<String>] An array of strings containing the collected code blocks. # - def collect_recursively_required_code(name, block_source:, label_body: true, label_format_above: nil, + def collect_recursively_required_code(anyname:, block_source:, label_body: true, label_format_above: nil, label_format_below: nil) - block_search = collect_block_dependencies(name) + block_search = collect_block_dependencies(anyname: anyname) if block_search[:blocks] blocks = collect_wrapped_blocks(block_search[:blocks]) # &bc 'blocks.count:',blocks.count block_search.merge( @@ -451,15 +451,15 @@ assert_equal({}, result_missing) end ### broken test def test_collect_block_dependencies - result = @doc.collect_block_dependencies('block3')[:blocks] + result = @doc.collect_block_dependencies(anyname: 'block3')[:blocks] expected_result = [@table[0], @table[1], @table[2]] assert_equal expected_result, result assert_raises(RuntimeError) do - @doc.collect_block_dependencies('missing_block') + @doc.collect_block_dependencies(anyname: 'missing_block') end end def test_hide_menu_block_on_name opts = { hide_blocks_by_name: true,