Sha256: bc5e41b52ba8b3250c08aa9da6ae53f3a2336c3dce3c2d2d9246567122b2fbda
Contents?: true
Size: 1.55 KB
Versions: 1
Compression:
Stored size: 1.55 KB
Contents
# encoding: UTF-8 =begin Copyright GodObject Team <dev@godobject.net>, 2012-2016 This file is part of FilePermissions. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. =end module GodObject module FilePermissions # Mixin containing helper methods # # @private module HelperMixin # @return [Array<Symbol>] possible output String formats STRING_FORMAT = Set[:long, :short].freeze protected # Ensures that input is Pathname # # @param [Pathname, String] path a path # @param [:forbid_nil, :allow_nil] nil_handling if set to :allow_nil, # a nil path will be passed-through. Raises an exception otherwise # @return [Pathname] the path as Pathname object def to_pathname(path, nil_handling = :forbid_nil) return nil if path.nil? if nil_handling == :allow_nil path.is_a?(Pathname) ? path : Pathname.new(path) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
file_permissions-0.1.0 | lib/god_object/file_permissions/helper_mixin.rb |