class Cucumber::Wire::Plugin

Attributes

config[R]
registry[R]

Public Class Methods

new(config, registry) click to toggle source
# File lib/cucumber/wire/plugin.rb, line 11
def initialize(config, registry)
  @config = config
  @registry = registry
end

Public Instance Methods

create_connection(wire_file) click to toggle source
# File lib/cucumber/wire/plugin.rb, line 23
def create_connection(wire_file)
  Connection.new(Configuration.from_file(wire_file))
end
install() click to toggle source
# File lib/cucumber/wire/plugin.rb, line 16
def install
  connections = Connections.new(wire_files.map { |f| create_connection(f) }, config, registry)
  config.filters << Filters::ActivateSteps.new(StepMatchSearch.new(connections.method(:step_matches), @config), @config)
  config.filters << AddHooksFilter.new(connections) unless @config.dry_run?
  config.register_snippet_generator Snippet::Generator.new(connections)
end
wire_files() click to toggle source
# File lib/cucumber/wire/plugin.rb, line 27
def wire_files
  # TODO: change Cucumber's config object to allow us to get this information
  config.send(:require_dirs).map { |dir| Dir.glob("#{dir}/**/*.wire") }.flatten
end