Class: Gitenv::Copy::Action
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(context, files, options) ⇒ Action
constructor
A new instance of Action.
- #once ⇒ Object
- #overwrite(*args) ⇒ Object
Methods inherited from Action
Constructor Details
Instance Method Details
#once ⇒ Object
23 24 25 26 27 |
# File 'lib/gitenv/actions/copy.rb', line 23 def once @options[:overwrite] = false @options[:backup] = false self end |
#overwrite(*args) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/gitenv/actions/copy.rb', line 15 def overwrite *args = args.last.kind_of?(Hash) ? args.pop : {} overwrite = args.empty? ? true : args.shift @options[:overwrite] = overwrite @options[:backup] = [:backup] if .key?(:backup) self end |