class Danger::DangerfileLocalOnlyPlugin

Handles interacting with local only plugin inside a Dangerfile. It is support plugin for dry_run command and does not expose any methods. But you can still use other plugins like git

@example Check that added lines contains agreed form of words

git.diff.each do |chunk|
  chunk.patch.lines.grep(/^\+/).each do |added_line|
    if added_line.gsub!(/(?<cancel>cancel)(?<rest>[^l[[:space:]][[:punct:]]]+)/i, '>>\k<cancel>-l-\k<rest><<')
      fail "Single 'L' for cancellation-alike words in '#{added_line}'"
    end
  end
end

@see danger/danger @tags core, local_only

Public Class Methods

instance_name() click to toggle source

The instance name used in the Dangerfile @return [String]

# File lib/danger/danger_core/plugins/dangerfile_local_only_plugin.rb, line 39
def self.instance_name
  "local_repo"
end
new(dangerfile) click to toggle source

So that this init can fail.

Calls superclass method
# File lib/danger/danger_core/plugins/dangerfile_local_only_plugin.rb, line 24
def self.new(dangerfile)
  return nil if dangerfile.env.request_source.class != Danger::RequestSources::LocalOnly

  super
end
new(dangerfile) click to toggle source
Calls superclass method
# File lib/danger/danger_core/plugins/dangerfile_local_only_plugin.rb, line 30
def initialize(dangerfile)
  super(dangerfile)

  @local_repo = dangerfile.env.request_source
end