Class: Space::Model::Project
- Inherits:
-
Object
- Object
- Space::Model::Project
- Includes:
- Events
- Defined in:
- lib/space/model/project.rb,
lib/space/model/project/tmux.rb,
lib/space/model/project/bundler.rb,
lib/space/model/project/bundler/config.rb
Defined Under Namespace
Modules: Tmux Classes: Bundler
Instance Attribute Summary collapse
-
#bundler ⇒ Object
readonly
Returns the value of attribute bundler.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#repos ⇒ Object
readonly
Returns the value of attribute repos.
Instance Method Summary collapse
-
#initialize(name) ⇒ Project
constructor
A new instance of Project.
- #local_repos ⇒ Object
- #names ⇒ Object
- #number(name) ⇒ Object
- #refresh ⇒ Object
Methods included from Events
events, notify, #notify, sources, subscribe, subscriptions
Constructor Details
Instance Attribute Details
#bundler ⇒ Object (readonly)
Returns the value of attribute bundler.
9 10 11 |
# File 'lib/space/model/project.rb', line 9 def bundler @bundler end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/space/model/project.rb', line 9 def config @config end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/space/model/project.rb', line 9 def name @name end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
9 10 11 |
# File 'lib/space/model/project.rb', line 9 def repos @repos end |
Instance Method Details
#local_repos ⇒ Object
18 19 20 21 22 23 |
# File 'lib/space/model/project.rb', line 18 def local_repos bundler.config.keys.map do |key| key =~ /^local\.(.+)$/ $1 if repos.names.include?($1) end.compact end |
#names ⇒ Object
25 26 27 |
# File 'lib/space/model/project.rb', line 25 def names @names ||= Tmux.windows || repos.names end |
#number(name) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/space/model/project.rb', line 29 def number(name) if number = names.index(name) number + 1 else names << name number(name) end end |
#refresh ⇒ Object
38 39 40 |
# File 'lib/space/model/project.rb', line 38 def refresh [bundler, repos].each(&:refresh) end |