Skip to content

Commit

Permalink
Merge pull request #232 from gavinlaking/twerks
Browse files Browse the repository at this point in the history
Fix bug for refreshing individual interfaces.
  • Loading branch information
gavinlaking committed Sep 26, 2015
2 parents e9b96f8 + aa0ac3d commit 91af895
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/vedeu/dsl/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/vedeu/models/focus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions lib/vedeu/output/presentation/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/vedeu/output/refresh/refresh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/lib/vedeu/cursors/refresh_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion test/lib/vedeu/cursors/repository_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
3 changes: 2 additions & 1 deletion test/lib/vedeu/output/refresh/refresh_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 91af895

Please sign in to comment.