Sha256: 56267e2444ecb36b7270930958fea38b1cb4f7bb797651c2fa71a7695806f856

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require_relative "jmeter_perf/version"
lib = File.dirname(File.absolute_path(__FILE__))

Dir.glob(File.join(lib, "jmeter_perf/report/*.rb")).each do |file|
  require_relative file
end

Dir.glob(File.join(lib, "jmeter_perf/helpers/*.rb")).each do |file|
  require_relative file
end

Dir.glob(File.join(lib, "jmeter_perf/dsl/*.rb")).each do |file|
  require_relative file
end

Dir.glob(File.join(lib, "jmeter_perf/extend/**/*.rb")).each do |file|
  require_relative file
end

Dir.glob(File.join(lib, "jmeter_perf/plugins/*.rb")).each do |file|
  require_relative file
end

require_relative "jmeter_perf/dsl"

module JmeterPerf
  def self.test(params = {}, &)
    JmeterPerf.dsl_eval(JmeterPerf::ExtendedDSL.new(params), &)
  end

  def self.dsl_eval(dsl, &block)
    block_context = eval("self", block.binding, __FILE__, __LINE__)
    proxy_context = JmeterPerf::FallbackContextProxy.new(dsl, block_context)
    begin
      block_context.instance_variables.each { |ivar| proxy_context.instance_variable_set(ivar, block_context.instance_variable_get(ivar)) }
      proxy_context.instance_eval(&block)
    ensure
      block_context.instance_variables.each { |ivar| block_context.instance_variable_set(ivar, proxy_context.instance_variable_get(ivar)) }
    end
    dsl
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf.rb
jmeter_perf-0.0.2 lib/jmeter_perf.rb