method

invoke!

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.

invoke!()
public

No documentation available.

# File lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb, line 47
      def invoke!
        say_status :invoke

        content = if @behavior == :after
          '\0' + replacement
        else
          replacement + '\0'
        end

        if exists?
          replace!(/#{flag}/, content, config[:force])
        else
          unless pretend?
            raise Bundler::Thor::Error, "The file #{ destination } does not appear to exist"
          end
        end
      end