Class: MetaModel::Config
- Inherits:
-
Object
- Object
- MetaModel::Config
- Defined in:
- lib/metamodel/config.rb
Overview
Stores the global configuration of MetaModel.
Defined Under Namespace
Modules: Mixin
Constant Summary collapse
- DEFAULTS =
{ :verbose => true, :silent => false, :skip_build => false, }
Initialization collapse
Paths collapse
-
#installation_root ⇒ Pathname
(also: #project_root)
The root of the MetaModel installation where the meta folder is located.
Singleton collapse
-
.instance ⇒ Config
The current config instance creating one if needed.
Instance Attribute Summary collapse
-
#skip_build ⇒ Object
(also: #skip_build?)
Returns the value of attribute skip_build.
UI collapse
-
#verbose? ⇒ Bool
Whether CocoaPods should provide detailed output about the performed actions.
Paths collapse
- #metafile ⇒ Object
-
#metafile_in_dir(dir) ⇒ Pathname, Nil
Returns the path of the Metafile in the given dir if any exists.
-
#metafile_path ⇒ Pathname, Nil
Returns the path of the Metafile.
-
#metamodel_template_uri ⇒ String
Returns the path of the metamodel template uri.
-
#metamodel_xcode_project ⇒ String
Returns the path of the MetaModel.xcodeproj.
-
#metefile_exist? ⇒ Bool
Returns whether or not metafile is in current project.
Class Attribute Details
.instance ⇒ Config
Returns the current config instance creating one if needed.
130 131 132 |
# File 'lib/metamodel/config.rb', line 130 def self.instance @instance ||= new end |
Instance Attribute Details
#installation_root ⇒ Pathname Also known as: project_root
Returns the root of the MetaModel installation where the meta folder is located.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# 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 (current_path) @installation_root = current_path break else current_path = current_path.parent end end @installation_root ||= Pathname.pwd end @installation_root end |
#skip_build ⇒ Object Also known as: skip_build?
Returns the value of attribute skip_build.
16 17 18 |
# File 'lib/metamodel/config.rb', line 16 def skip_build @skip_build end |
#verbose ⇒ Object
27 28 29 |
# File 'lib/metamodel/config.rb', line 27 def verbose @verbose end |
Instance Method Details
#metafile ⇒ Object
118 119 120 |
# File 'lib/metamodel/config.rb', line 118 def @metafile ||= Metafile.from_file() if end |
#metafile_in_dir(dir) ⇒ Pathname, Nil
Returns the path of the Metafile in the given dir if any exists.
110 111 112 113 114 115 116 |
# File 'lib/metamodel/config.rb', line 110 def (dir) candidate = dir + 'Metafile' if candidate.exist? return candidate end nil end |
#metafile_path ⇒ Pathname, Nil
Returns the path of the Metafile.
98 99 100 |
# File 'lib/metamodel/config.rb', line 98 def @metafile_in_dir ||= installation_root + 'Metafile' end |
#metamodel_template_uri ⇒ String
Returns the path of the metamodel template uri.
73 74 75 |
# File 'lib/metamodel/config.rb', line 73 def "[email protected]:MModel/MetaModel-Template.git" end |
#metamodel_xcode_project ⇒ String
Returns the path of the MetaModel.xcodeproj.
81 82 83 |
# File 'lib/metamodel/config.rb', line 81 def "./metamodel/MetaModel.xcodeproj" end |
#metefile_exist? ⇒ Bool
Returns whether or not metafile is in current project.
89 90 91 |
# File 'lib/metamodel/config.rb', line 89 def metefile_exist? Pathname.new().exist? end |
#verbose? ⇒ Bool
Returns Whether CocoaPods should provide detailed output about the performed actions.
28 29 30 |
# File 'lib/metamodel/config.rb', line 28 def verbose @verbose end |