lib/space/app.rb in space-0.0.2 vs lib/space/app.rb in space-0.0.3

- old
+ new

@@ -1,25 +1,34 @@ require 'readline' module Space class App class << self - attr_reader :config + attr_reader :instance def run(name) - @config = Config.load(name) - new(config.name || name).run + @instance = new(name) + instance.run end + + def name + instance.name + end + + def config + instance.config + end end include Readline - attr_accessor :screen, :name, :repos, :bundle, :path + attr_accessor :screen, :name, :config, :repos, :bundle, :path def initialize(name) @screen = Screen.new(self) @name = name - @bundle = Bundle.new(self.class.config.paths.first) + @config = Config.load(name) + @bundle = Bundle.new(config.paths.first) @path = File.expand_path('.') end def prompt # "#{repos.name} >".strip + ' '