Sha256: ae16ae6f7a90b2e02cf989dab668b1990b5efc95b31294da5df37b975cfb7ae8

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# Adding support for more adapters

Currently there is only support for a small number of tools, in ruby, but adding support for _any_ language is easy, and will only take a couple of minutes.

You may use the example below to implement your own adapter:

```ruby
require_relative 'base'

module EatYourVegetables
  module Tools # Create your tool in this namespace
    class MyTool < Base # Inherit from the base tool
      attr_writer :config_file # Add attr_writers for configurable values
      protected
      # Will get called when running the tool to determine
      # the location of the config file (across branches)
      def config_file # You need to implement this method
        @config_file || '.mytoolignore.yml' # Default value
      end

      # Will get called with the contents of the config_file, for the valid branches.
      # Should return an array of files excluded by the content
      def excluded_files(content) # You need to implement this method
        content.split("\n")
      end
    end
  end
end

```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eat_your_vegetables-0.1.2 docs/ADDING_ADAPTERS.md