method

new

ruby latest stable - Class: Bundler::Thor::Actions::InjectIntoFile

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

new(base, destination, data, config)
public

No documentation available.

# File lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb, line 34
      def initialize(base, destination, data, config)
        super(base, destination, {:verbose => true}.merge(config))

        @behavior, @flag = if @config.key?(:after)
          [:after, @config.delete(:after)]
        else
          [:before, @config.delete(:before)]
        end

        @replacement = data.is_a?(Proc) ? data.call : data
        @flag = Regexp.escape(@flag) unless @flag.is_a?(Regexp)
      end