def chmod(relative_path, permissions, **options)
      mode = ::File.lstat(relative_path).mode
      if permissions.to_s =~ /\d+/
        mode = permissions
      else
        permissions.scan(/[ugoa][+-=][rwx]+/) do |setting|
          who, action = setting[0], setting[1]
          setting[2..setting.size].each_byte do |perm|
            mask = const_get("#{who.upcase}_#{perm.chr.upcase}")
            (action == '+') ? mode |= mask : mode ^= mask
          end
        end
      end
      log_status(:chmod, relative_path, options.fetch(:verbose, true),
                                        options.fetch(:color, :green))
      ::FileUtils.chmod_R(mode, relative_path) unless options[:noop]
    end
def chmod(relative_path, permissions, **options)
      mode = ::File.lstat(relative_path).mode
      if permissions.to_s =~ /\d+/
        mode = permissions
      else
        permissions.scan(/[ugoa][+-=][rwx]+/) do |setting|
          who, action = setting[0], setting[1]
          setting[2..setting.size].each_byte do |perm|
            mask = const_get("#{who.upcase}_#{perm.chr.upcase}")
            (action == '+') ? mode |= mask : mode ^= mask
          end
        end
      end
      log_status(:chmod, relative_path, options.fetch(:verbose, true),
                                        options.fetch(:color, :green))
      ::FileUtils.chmod_R(mode, relative_path) unless options[:noop]
    end
Change file permissions

 @param [String, Pathname] relative_path
 @param [Integer,String] permisssions
 @param [Hash[Symbol]] options
 @option options [Symbol] :noop
 @option options [Symbol] :verbose
 @option options [Symbol] :force

 @example
   chmod('Gemfile', 0755)

 @example
   chmod('Gemilfe', TTY::File::U_R | TTY::File::U_W)

 @example
   chmod('Gemfile', 'u+x,g+x')

 @api public