Sha256: 9a8b1d49b0529caeff75e35cc74f5109eee0b5da3f30c4f93359d5ef6cec90c9
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
require 'readline' module Space class App class << self attr_reader :config def run(name) @config = Config.load(name) new(config.name || name).run end end include Readline attr_accessor :screen, :name, :repos, :bundle, :path def initialize(name) @screen = Screen.new(self) @name = name @bundle = Bundle.new(self.class.config.paths.first) @path = File.expand_path('.') end def prompt # "#{repos.name} >".strip + ' ' '> ' end def repos @repos ||= Repos.all end def run screen.render loop do line = readline(prompt, true) break if line.nil? handle(line) unless line.empty? end puts end def handle(line) Action.run(self, line) screen.render end def reset bundle.reset repos.each(&:reset) end def execute(cmd) chdir { system(cmd) } end def chdir(&block) Dir.chdir(path, &block) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
space-0.0.2 | lib/space/app.rb |