Class: Renamr::PointAction
Overview
All points besides extension are replaced by minus.
Instance Method Summary collapse
- #do(src) ⇒ Object
-
#initialize(dir) ⇒ PointAction
constructor
A new instance of PointAction.
Methods inherited from Action
Constructor Details
#initialize(dir) ⇒ PointAction
Returns a new instance of PointAction.
12 13 14 15 16 17 |
# File 'lib/renamr/point.rb', line 12 def initialize(dir) super() raise 'dir cannot be nil.' if dir.nil? @dir = dir end |
Instance Method Details
#do(src) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/renamr/point.rb', line 19 def do(src) if File.file?(File.join(@dir, src)) p2m(File.basename(src, '.*')) << File.extname(src) else p2m(src) end end |