Method: PDK::Util.module_root

Defined in:
lib/pdk/util.rb

.module_rootString?

Returns path to the root of the module being worked on.

Returns:

  • (String, nil)

    Fully qualified base path to module, or nil if the current working dir does not appear to be within a module.



122
123
124
125
126
127
128
129
130
131
# File 'lib/pdk/util.rb', line 122

def module_root
   = find_upwards('metadata.json')
  if 
    File.dirname()
  elsif in_module_root?
    Dir.pwd
  else
    nil
  end
end