Sha256: 8698df4462b8cbb2a05922f95879371fa046e6ad37ceb354a79734b523b5b1bc

Contents?: true

Size: 794 Bytes

Versions: 13

Compression:

Stored size: 794 Bytes

Contents

class YARD::Handlers::Ruby::Legacy::StepTransformHandler < YARD::Handlers::Ruby::Legacy::Base
  STEP_TRANSFORM_MATCH = /^(Transform\s*(\/.+\/)\s+do(?:\s*\|.+\|)?\s*)$/ unless defined?(STEP_TRANSFORM_MATCH)
  handles STEP_TRANSFORM_MATCH

  @@unique_name = 0

  def process
    transform = statement.tokens.to_s[STEP_TRANSFORM_MATCH,2]
    @@unique_name = @@unique_name + 1

    instance = StepTransformObject.new(YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE, "transform_#{@@unique_name}") do |o|
      o.source = "Transform #{transform} do #{statement.block.to_s}\nend"
      o.value = transform
      o.keyword = "Transform"
    end

    obj = register instance
    parse_block :owner => obj

  rescue YARD::Handlers::NamespaceMissingError
  end

end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
yard-nrser-cucumber-0.1.3 lib/yard/handlers/legacy/step_transform_handler.rb
yard-nrser-cucumber-0.1.2 lib/yard/handlers/legacy/step_transform_handler.rb
yard-nrser-cucumber-0.1.1 lib/yard/handlers/legacy/step_transform_handler.rb
yard-nrser-cucumber-0.1.0 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-4.0.0 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-3.1.0 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-3.0.0 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber2-2.3.4 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber2-2.3.3 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-2.3.2 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-2.3.1 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-2.3.0 lib/yard/handlers/legacy/step_transform_handler.rb
yard-cucumber-2.2.3 lib/yard/handlers/legacy/step_transform_handler.rb