Module: SVN::DSL

Defined in:
lib/svn_dsl.rb

Instance Method Summary collapse

Instance Method Details

#for_event(*searches, &proc) ⇒ Object Also known as: for_events



18
19
20
21
22
# File 'lib/svn_dsl.rb', line 18

def for_event(*searches, &proc)
  if(searches.include? SVN_EVENT)
    yield(EVENT_STATS) if block_given?
  end
end

#for_path(*searches, &proc) ⇒ Object Also known as: for_paths



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/svn_dsl.rb', line 4

def for_path (*searches, &proc)
  # searches = [search] if !search.kind_of?(Array)
  searches = searches.map{|search| Regexp.glob(search)}
  file_paths = EVENT_STATS.files.map{|f| f.path}
  
  searches.each do |search|
    if(file_paths.grep(search).length > 0)
      return yield(EVENT_STATS) if block_given?
    end
  end
end