Class: Pod::X::Sandbox::Workspace
- Inherits:
-
Sandbox
- Object
- Sandbox
- Pod::X::Sandbox::Workspace
- Includes:
- Protocol
- Defined in:
- lib/cocoapods-x/extension/sandbox/workspace.rb
Defined Under Namespace
Classes: Repo
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
- #all_pods ⇒ Object
-
#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.
14 15 16 17 18 19 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 14 def initialize super File.join(File.('~'), '.cocoapods/x') @repos = Pod::X::Sandbox::Repos::new root @template = Pod::X::Sandbox::Template::new root @projects = Pod::X::Sandbox::Projects::new root end |
Instance Attribute Details
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
12 13 14 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 12 def projects @projects end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
12 13 14 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 12 def repos @repos end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
12 13 14 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 12 def template @template end |
Instance Method Details
#all_pods ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 44 def all_pods all_pods = Array::new for url in Dir.glob(@repos::root + '*/*') do pod_url = Pathname(url) if pod_url.directory? domain_url = Pathname(pod_url.dirname) branch = git_branch(pod_url) all_pods << Repo::new(pod_url.basename.to_s, domain_url.basename.to_s, nil, pod_url.to_s, branch) end end for url in Dir.glob(@projects::root + '*/repos/*/*') do pod_url = Pathname(url) if pod_url.directory? domain_url = Pathname(pod_url.dirname) project_url = Pathname(Pathname(domain_url.dirname).dirname) branch = git_branch(pod_url) all_pods " end\n end\n all_pods\nend\n"::new(pod_url.basename.to_s, domain_url.basename.to_s, project_url.basename.to_s, pod_url.to_s, branch) |
#install! ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 21 def install! @repos.install! @template.install! @projects.install! unless source_file.exist? cp! [@template::source_file, source_file] end end |
#source_file ⇒ Object
40 41 42 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 40 def source_file root + 'sources' end |
#update! ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/cocoapods-x/extension/sandbox/workspace.rb', line 31 def update! @repos.update! @template.update! @projects.update! rm! ['-rf', source_file] cp! [@template::source_file, source_file] end |