Skip to content

Commit

Permalink
Move all bindings inline with classes which honour them.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlaking committed Oct 10, 2015
1 parent 927ca23 commit dc17160
Show file tree
Hide file tree
Showing 77 changed files with 540 additions and 1,315 deletions.
14 changes: 6 additions & 8 deletions lib/vedeu/all.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
require 'vedeu/version'

require 'vedeu/common'
require 'vedeu/configuration/api'
require 'vedeu/configuration/configuration'
require 'vedeu/repositories/all'
require 'vedeu/events/all'
require 'vedeu/esc/all'
require 'vedeu/logging/all'
require 'vedeu/options'

require 'vedeu/error'
require 'vedeu/common'
require 'vedeu/runtime/all'

require 'vedeu/configuration/api'
require 'vedeu/configuration/configuration'

require 'vedeu/terminal/all'
require 'vedeu/repositories/all'

require 'vedeu/models/toggleable'

Expand All @@ -37,7 +36,6 @@
require 'vedeu/cursors/all'
require 'vedeu/distributed/all'
require 'vedeu/editor/all'
require 'vedeu/events/all'
require 'vedeu/geometry/all'
require 'vedeu/groups/all'
require 'vedeu/input/all'
Expand Down
56 changes: 43 additions & 13 deletions lib/vedeu/bindings/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,49 @@ module Vedeu
#
module Bindings

extend self

# Setup events for running Vedeu. This method is called by Vedeu.
#
# @return [TrueClass]
def setup!
cleanup!
command!
drb_input!

true
end

private

# See {file:docs/events/system.md#\_cleanup_}
def cleanup!
Vedeu.bind(:_cleanup_) do
Vedeu.trigger(:_drb_stop_)
Vedeu.trigger(:cleanup)
end
end

# See {file:docs/events/system.md#\_command_}
def command!
Vedeu.bind(:_command_) { |command| Vedeu.trigger(:command, command) }
end

# See {file:docs/events/drb.md#\_drb_input_}
def drb_input!
Vedeu.bind(:_drb_input_) do |data, type|
Vedeu.log(type: :drb, message: "Sending input (#{type})".freeze)

case type
when :command then Vedeu.trigger(:_command_, data)
when :keypress then Vedeu.trigger(:_keypress_, data)
else Vedeu.trigger(:_keypress_, data)
end
end
end

end # Bindings

end # Vedeu
Vedeu::Bindings.setup!

require 'vedeu/bindings/application'
require 'vedeu/bindings/cursors'
require 'vedeu/bindings/document'
require 'vedeu/bindings/drb'
require 'vedeu/bindings/menus'
require 'vedeu/bindings/movement'
require 'vedeu/bindings/focus'
require 'vedeu/bindings/refresh'
require 'vedeu/bindings/system'
require 'vedeu/bindings/view'
require 'vedeu/bindings/visibility'
require 'vedeu/bindings/bindings'
end # Vedeu
41 changes: 0 additions & 41 deletions lib/vedeu/bindings/application.rb

This file was deleted.

46 changes: 0 additions & 46 deletions lib/vedeu/bindings/bindings.rb

This file was deleted.

101 changes: 0 additions & 101 deletions lib/vedeu/bindings/cursors.rb

This file was deleted.

97 changes: 0 additions & 97 deletions lib/vedeu/bindings/document.rb

This file was deleted.

Loading

0 comments on commit dc17160

Please sign in to comment.