Flowdock
method

new

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: InjectIntoFile
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?
new(base, destination, data, config) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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
Register or log in to add new notes.