Class: Pod::Extension::Sandbox::Workspace
- Inherits:
-
Sandbox
- Object
- Sandbox
- Pod::Extension::Sandbox::Workspace
- Includes:
- Protocol
- Defined in:
- lib/cocoapods-extension/sandbox/workspace.rb
Instance Attribute Summary collapse
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
-
#repos ⇒ Object
readonly
Returns the value of attribute repos.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize ⇒ Workspace
constructor
A new instance of Workspace.
- #install! ⇒ Object
- #source_file ⇒ Object
- #update! ⇒ Object
Constructor Details
#initialize ⇒ Workspace
Returns a new instance of Workspace.
13 14 15 16 17 18 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 13 def initialize super File.join(File.('~'), '.cocoapods/extension') @repos = Pod::Extension::Sandbox::Repos::new root @template = Pod::Extension::Sandbox::Template::new root @projects = Pod::Extension::Sandbox::Projects::new root end |
Instance Attribute Details
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
11 12 13 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11 def projects @projects end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
11 12 13 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11 def repos @repos end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
11 12 13 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11 def template @template end |
Instance Method Details
#install! ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 20 def install! @repos.install! @template.install! @projects.install! unless source_file.exist? cp! [@template::source_file, source_file] end end |
#source_file ⇒ Object
39 40 41 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 39 def source_file root + 'source' end |
#update! ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 30 def update! @repos.update! @template.update! @projects.update! rm! ['-rf', source_file] cp! [@template::source_file, source_file] end |