diff --git a/lib/vedeu/dsl/interface.rb b/lib/vedeu/dsl/interface.rb index 88b3d709b..4b92658e4 100644 --- a/lib/vedeu/dsl/interface.rb +++ b/lib/vedeu/dsl/interface.rb @@ -65,7 +65,7 @@ def add_buffers!(name) # # @return [Vedeu::Cursors::Cursor] def add_cursor!(name) - Vedeu::Cursors::Cursor.new(name: name).store + Vedeu::Cursors::Cursor.store(name: name) end # Registers interface name in focus list unless already @@ -130,7 +130,7 @@ def initialize(model, client = nil) def cursor(value = true) boolean = value ? true : false - Vedeu::Cursors::Cursor.new(name: model.name, visible: boolean).store + Vedeu::Cursors::Cursor.store(name: model.name, visible: boolean) end # Set the cursor to visible for the interface. diff --git a/lib/vedeu/models/focus.rb b/lib/vedeu/models/focus.rb index 29055558d..3f10cbd79 100644 --- a/lib/vedeu/models/focus.rb +++ b/lib/vedeu/models/focus.rb @@ -170,7 +170,7 @@ def prev_visible_item # # @return [Array] def refresh - Vedeu.trigger(:_refresh_, current) + Vedeu.trigger(:_refresh_view_, current) end # Returns a collection of the names of all the registered diff --git a/lib/vedeu/output/presentation/style.rb b/lib/vedeu/output/presentation/style.rb index 0c61b25e5..a7315408d 100644 --- a/lib/vedeu/output/presentation/style.rb +++ b/lib/vedeu/output/presentation/style.rb @@ -27,13 +27,9 @@ class Style # @param value [Object|NilClass] # @return [Object] def self.coerce(value) - if value.is_a?(self) - value + return value if value.is_a?(self) - else - new(value) - - end + new(value) end # Return a new instance of Vedeu::Presentation::Style. diff --git a/lib/vedeu/output/refresh/refresh.rb b/lib/vedeu/output/refresh/refresh.rb index b566639b5..aaa290900 100644 --- a/lib/vedeu/output/refresh/refresh.rb +++ b/lib/vedeu/output/refresh/refresh.rb @@ -23,7 +23,7 @@ def initialize; end def all Vedeu.timer('Refreshing all') do Vedeu.interfaces.zindexed.each do |interface| - Vedeu.trigger(:_refresh_, interface.name) + Vedeu.trigger(:_refresh_view_, interface.name) end end end diff --git a/test/lib/vedeu/cursors/refresh_test.rb b/test/lib/vedeu/cursors/refresh_test.rb index 026b63710..c4160c566 100644 --- a/test/lib/vedeu/cursors/refresh_test.rb +++ b/test/lib/vedeu/cursors/refresh_test.rb @@ -26,9 +26,9 @@ module Cursors y 1 yn 3 end - Vedeu::Cursors::Cursor.new(name: 'refresh_cursor', - ox: ox, - oy: oy).store + Vedeu::Cursors::Cursor.store(name: 'refresh_cursor', + ox: ox, + oy: oy) Vedeu::Terminal.stubs(:output).returns(expected) diff --git a/test/lib/vedeu/cursors/repository_test.rb b/test/lib/vedeu/cursors/repository_test.rb index 2526fb139..2777c5f2f 100644 --- a/test/lib/vedeu/cursors/repository_test.rb +++ b/test/lib/vedeu/cursors/repository_test.rb @@ -18,7 +18,7 @@ module Cursors Vedeu::Models::Focus.reset Vedeu.cursors.reset Vedeu::Models::Focus.add('Vedeu.cursor') - Vedeu::Cursors::Cursor.new(name: 'Vedeu.cursor').store + Vedeu::Cursors::Cursor.store(name: 'Vedeu.cursor') end it { subject.must_be_instance_of(Vedeu::Cursors::Cursor) } diff --git a/test/lib/vedeu/output/refresh/refresh_test.rb b/test/lib/vedeu/output/refresh/refresh_test.rb index a7681dce2..da3909505 100644 --- a/test/lib/vedeu/output/refresh/refresh_test.rb +++ b/test/lib/vedeu/output/refresh/refresh_test.rb @@ -31,7 +31,8 @@ module Output before { Vedeu.interfaces.stubs(:zindexed).returns(interfaces) } it { - Vedeu.expects(:trigger).with(:_refresh_, 'Vedeu::Output::Refresh') + Vedeu.expects(:trigger).with(:_refresh_view_, + 'Vedeu::Output::Refresh') subject }