Class: Space::Models::Project::Bundler

Inherits:
Object
  • Object
show all
Includes:
Events, Shell
Defined in:
lib/space/models/project/bundler.rb

Instance Attribute Summary collapse

Attributes included from Events

#buffer

Attributes included from Shell

#path

Instance Method Summary collapse

Methods included from Events

#buffering, #buffering?, #notify, #observers, #subscribe

Methods included from Shell

all, #commands, included, refresh, #refresh, #result

Methods included from Shell::Watcher

suspend, suspended?

Constructor Details

#initialize(project) ⇒ Bundler

Returns a new instance of Bundler.



15
16
17
18
# File 'lib/space/models/project/bundler.rb', line 15

def initialize(project)
  @project = project
  super()
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



13
14
15
# File 'lib/space/models/project/bundler.rb', line 13

def project
  @project
end

Instance Method Details

#configObject



20
21
22
23
24
25
26
# File 'lib/space/models/project/bundler.rb', line 20

def config
  lines  = result(:config).split("\n")[2..-1] || []
  values = lines.map_slice(3) do |name, value, _|
    [name, value =~ /: "(.*)"/ && $1]
  end
  Hash[*values.compact.flatten]
end