lib/geny/actions/files.rb in geny-2.5.0 vs lib/geny/actions/files.rb in geny-2.5.1
- old
+ new
@@ -118,31 +118,21 @@
# Change the permissions of a file
# @see TTY::File.chmod
#
# @example
# files.chmod("bin/test", "+x")
- def chmod(path, mode, *args)
- TTY::File.chmod(path, coerce_mode(mode), *args)
+ def chmod(path, mode, *args, **opts)
+ TTY::File.chmod(path, mode, *args, **opts)
end
# @see #insert
def insert_before(path, pattern, content, **opts)
insert(path, content, before: pattern, **opts)
end
# @see #insert
def insert_after(path, pattern, content, **opts)
insert(path, content, after: pattern, **opts)
- end
-
- private
-
- def coerce_mode(mode)
- if mode.respond_to?(:match?) && mode.match?(/^[+-]/)
- "a#{mode}"
- else
- mode
- end
end
end
end
end