Class: RakeVersion::Copier

Inherits:
Object
  • Object
show all
Defined in:
lib/rake-version/copier.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Copier

Returns a new instance of Copier.



7
8
9
10
11
12
13
# File 'lib/rake-version/copier.rb', line 7

def initialize *args
  options = args.last.kind_of?(Hash) ? args.pop : {}

  @file_patterns = args.collect{ |arg| check_file_pattern arg }
  @version_pattern = Version::REGEXP
  @replace_all = !!options[:all]
end

Instance Method Details

#copy(version, context) ⇒ Object



15
16
17
# File 'lib/rake-version/copier.rb', line 15

def copy version, context
  find_all_files(context).each{ |f| copy_version f, version }
end