class MetaModel::Config

Stores the global configuration of MetaModel.

Constants

DEFAULTS

Attributes

instance[W]
installation_root[W]
skip_build[RW]
skip_build?[RW]
verbose[RW]

@return [Bool] Whether CocoaPods should provide detailed output about the

performed actions.
verbose?[RW]

@return [Bool] Whether CocoaPods should provide detailed output about the

performed actions.

Public Class Methods

instance() click to toggle source

@return [Config] the current config instance creating one if needed.

# File lib/metamodel/config.rb, line 130
def self.instance
  @instance ||= new
end

Public Instance Methods

installation_root() click to toggle source

@return [Pathname] the root of the MetaModel installation where the

meta folder is located.
# File lib/metamodel/config.rb, line 49
def installation_root
  current_dir = ActiveSupport::Multibyte::Unicode.normalize(Dir.pwd)
  current_path = Pathname.new(current_dir)
  unless @installation_root
    until current_path.root?
      if metafile_in_dir(current_path)
        @installation_root = current_path
        break
      else
        current_path = current_path.parent
      end
    end
    @installation_root ||= Pathname.pwd
  end
  @installation_root
end
Also aliased as: project_root
metafile() click to toggle source
# File lib/metamodel/config.rb, line 118
def metafile
  @metafile ||= Metafile.from_file(metafile_path) if metafile_path
end
metafile_in_dir(dir) click to toggle source

Returns the path of the Metafile in the given dir if any exists.

@param [Pathname] dir

The directory where to look for the meta.

@return [Pathname] The path of the metafile. @return [Nil] If not meta was found in the given dir

# File lib/metamodel/config.rb, line 110
def metafile_in_dir(dir)
  candidate = dir + 'Metafile'
  if candidate.exist?
    return candidate
  end
  nil
end
metafile_path() click to toggle source

Returns the path of the Metafile.

@return [Pathname] @return [Nil]

# File lib/metamodel/config.rb, line 98
def metafile_path
  @metafile_in_dir ||= installation_root + 'Metafile'
end
metamodel_template_uri() click to toggle source

Returns the path of the metamodel template uri.

@return [String]

# File lib/metamodel/config.rb, line 73
def metamodel_template_uri
  "git@github.com:MModel/MetaModel-Template.git"
end
metamodel_xcode_project() click to toggle source

Returns the path of the MetaModel.xcodeproj.

@return [String]

# File lib/metamodel/config.rb, line 81
def metamodel_xcode_project
  "./metamodel/MetaModel.xcodeproj"
end
metefile_exist?() click to toggle source

Returns whether or not metafile is in current project.

@return [Bool]

# File lib/metamodel/config.rb, line 89
def metefile_exist?
  Pathname.new(metafile_path).exist?
end
project_root()
Alias for: installation_root