Class: RakeVersion::Copier
- Inherits:
-
Object
- Object
- RakeVersion::Copier
- Defined in:
- lib/rake-version/copier.rb
Instance Method Summary collapse
- #copy(version, context) ⇒ Object
-
#initialize(*args) ⇒ Copier
constructor
A new instance of Copier.
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 = check_version_pattern(option(:version)) || /\d+\.\d+\.\d+/ @replace_all = !!option(: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 |