class MetaModel::Config
Stores the global configuration of MetaModel
.
Constants
- DEFAULTS
Attributes
@return [Bool] Whether CocoaPods should provide detailed output about the
performed actions.
@return [Bool] Whether CocoaPods should provide detailed output about the
performed actions.
Public Class Methods
@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
@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
# File lib/metamodel/config.rb, line 118 def metafile @metafile ||= Metafile.from_file(metafile_path) if metafile_path end
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
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
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
Returns the path of the MetaModel.xcodeproj.
@return [String]
# File lib/metamodel/config.rb, line 81 def metamodel_xcode_project "./metamodel/MetaModel.xcodeproj" end
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