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
19 20 21 22 23 |
# File 'lib/gitenv/actions/copy.rb', line 19 def once @options[:overwrite] = false @options[:backup] = false self end |
#overwrite(*args) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/gitenv/actions/copy.rb', line 11 def overwrite *args = args.last.is_a?(Hash) ? args.pop : {} overwrite = args.empty? ? true : args.shift @options[:overwrite] = overwrite @options[:backup] = [:backup] if .key?(:backup) self end |