Sha256: 56e42d75c3ce6d3d987b9ace863331c84718d760fd0f2330fadb8bda6c4bbe95

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

module JmeterPerf
  class ExtendedDSL < DSL
    def module_controller(params, &)
      node = JmeterPerf::ModuleController.new(params)

      if params[:test_fragment]
        params[:test_fragment].is_a?(String) &&
          params[:test_fragment].split("/")
      elsif params[:node_path]
        params[:node_path]
      else
        []
      end.each_with_index do |node_name, index|
        node.doc.at_xpath("//collectionProp") <<
          Nokogiri::XML(<<-EOS.strip_heredoc).children
            <stringProp name="node_#{index}">#{node_name}</stringProp>
          EOS
      end

      attach_node(node, &)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jmeter_perf-0.0.7 lib/jmeter_perf/extend/controllers/module_controller.rb
jmeter_perf-0.0.6 lib/jmeter_perf/extend/controllers/module_controller.rb
jmeter_perf-0.0.2 lib/jmeter_perf/extend/controllers/module_controller.rb