Class: Hobo::Lib::Seed::Replacer

Inherits:
Object
  • Object
show all
Defined in:
lib/hobo/lib/seed/replacer.rb

Constant Summary collapse

EXCLUDES =

Matching files/directories to be excluded from replacements

["\\.git/", "^./bin", "^./lib", "^./spec"]

Instance Method Summary collapse

Instance Method Details

#replace(path, tokens) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/hobo/lib/seed/replacer.rb', line 8

def replace(path, tokens)
  if tokens.instance_of? Hash
    tokens = flat_hash(tokens)
  elsif !tokens.instance_of? Array
    raise "Invalid token list (expected Array or Hash)"
  end

  return search_replace(path, tokens)
end