Sha256: fe620b8edb85e20f1c1e9cce21a1265db38dd120558713da36dd06362fe46a83

Contents?: true

Size: 644 Bytes

Versions: 22

Compression:

Stored size: 644 Bytes

Contents

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

      if params[:test_fragment]
        params[:test_fragment].kind_of?(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, &block)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruby-jmeter-3.1.08 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.07 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.06 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.05 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.04 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.03 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.02 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.1.01 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.13 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.12 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.11 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.10 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.9 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.8 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.7 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.6 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.5 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.4 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.3 lib/ruby-jmeter/extend/controllers/module_controller.rb
ruby-jmeter-3.0.2 lib/ruby-jmeter/extend/controllers/module_controller.rb