class TextEditor

Dependency injection container for the misc components required to run the text editor.

Constants

GEMSPEC

Attributes

mode[W]

Public Class Methods

new(args = []) click to toggle source
   # File lib/text_editor.rb
75 def initialize(args = [])
76   @args = args
77 end

Public Instance Methods

bootstrap() click to toggle source
   # File lib/text_editor.rb
79 def bootstrap
80   Configuration::Bootstrap.new(self).configure(@args)
81 end
clipboard() click to toggle source
   # File lib/text_editor.rb
83 def clipboard
84   @clipboard ||= Clipboard.new(self)
85 end
command() click to toggle source
   # File lib/text_editor.rb
87 def command
88   @command ||= Command::Resolver.new(self)
89 end
config() click to toggle source
   # File lib/text_editor.rb
91 def config
92   @config ||= Configuration.new(self)
93 end
flavor() click to toggle source
   # File lib/text_editor.rb
95 def flavor
96   @flavor ||= flavors[config.default_flavor]
97 end
flavors() click to toggle source
    # File lib/text_editor.rb
 99 def flavors
100   @flavors ||= {}
101 end
gemspec() click to toggle source
    # File lib/text_editor.rb
103 def gemspec
104   @gemspec ||= Gem::Specification.load(GEMSPEC)
105 end
keyboard() click to toggle source
    # File lib/text_editor.rb
107 def keyboard
108   @keyboard ||= Keyboard.new(self)
109 end
logger() click to toggle source
    # File lib/text_editor.rb
111 def logger
112   @logger ||= Logger.new(self)
113 end
mode() click to toggle source
    # File lib/text_editor.rb
115 def mode
116   @mode ||= flavor.modes.values.first # FIXME
117 end
os() click to toggle source
    # File lib/text_editor.rb
119 def os
120   @os ||= Configuration::OperatingSystem.new(ruby.host_os)
121 end
reactor() click to toggle source
    # File lib/text_editor.rb
123 def reactor
124   @reactor ||= Reactor.new(self)
125 end
root() click to toggle source
    # File lib/text_editor.rb
127 def root
128   @root ||= Pathname.new(__FILE__).dirname.dirname
129 end
ruby() click to toggle source
    # File lib/text_editor.rb
131 def ruby
132   @ruby ||= OpenStruct.new(RbConfig::CONFIG)
133 end
start() click to toggle source
    # File lib/text_editor.rb
135 def start
136   bootstrap
137   terminal.render { reactor.start }
138 end
terminal() click to toggle source
    # File lib/text_editor.rb
140 def terminal
141   @terminal ||= Terminal.new(self)
142 end
version() click to toggle source
    # File lib/text_editor.rb
148 def version
149   gemspec.version.to_s
150 end
window() click to toggle source
    # File lib/text_editor.rb
144 def window
145   @window ||= Window.new(self)
146 end