Sha256: 83d9f8ff0565f09e7233ac2ed9d097bd950f62d44a7434415be378f59f325328
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require 'readline' module Space class App class << self attr_reader :instance def run(name) @instance = new(name) instance.run end def name instance.name end def config instance.config end end include Readline attr_accessor :screen, :name, :config, :repos, :bundle, :path def initialize(name) @screen = Screen.new(self) @name = name @config = Config.load(name) @bundle = Bundle.new(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.3 | lib/space/app.rb |