Module: KatanaStamp
- Defined in:
- lib/katana_stamp.rb,
lib/katana_stamp/version.rb,
lib/katana_stamp/stamp_file.rb
Defined Under Namespace
Classes: StampFile
Constant Summary collapse
- DIR_PATTERS =
[ "app/**/*.rb", "lib/**/*.rb" ]
- VERSION =
"1.1.0"
Class Method Summary collapse
-
.run!(options = {}) ⇒ Object
Stamps all files matching DIR_PATTERNS and the
--include-pathsoption unless they have already been stamped.
Class Method Details
.run!(options = {}) ⇒ Object
Stamps all files matching DIR_PATTERNS and the --include-paths option unless they have already been stamped
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/katana_stamp.rb', line 9 def run!(={}) [:exclude_paths] ||= [] [:include_paths].each do |path| DIR_PATTERS << path end if [:include_paths] DIR_PATTERS.each do |main_dir| Dir.glob(main_dir).each do |path| # skip to the next file if this file matches exclude_paths next if [:exclude_paths].detect { |pattern| File.fnmatch(pattern, path) } StampFile.new(path, ).stamp! end end true # return true (success) end |