Method: Version50#root

Defined in:
lib/version50.rb

#rootObject

get the path of the project root, as determined by the location of the .version50 file



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/version50.rb', line 269

def root
    # search upward for a file called ".version50"
    path = Pathname.new(Dir.pwd)
    while path.to_s != '/'
        # check if file exists in this directory
        if path.children(false).select { |e| e.to_s == '.version50' }.length > 0
            return path.to_s
        end

        # continue to traverse upwards
        path = path.parent
    end

    # .version50 file not found
    return false
end