Class: Renamr::PointAction
Overview
All points besides extention 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.
11 12 13 14 15 |
# File 'lib/renamr/point.rb', line 11 def initialize(dir) raise 'dir cannot be nil.' if dir.nil? @dir = dir end |
Instance Method Details
#do(src) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/renamr/point.rb', line 17 def do(src) if File.file?(File.join(@dir, src)) p2m(File.basename(src, '.*')) << File.extname(src) else p2m(src) end end |