Skip to content

Commit

Permalink
Add Shoes::App#app for Shoes 3 compatibility
Browse files Browse the repository at this point in the history
Fixes samples/expert-pong-adjusted.rb
  • Loading branch information
wasnotrice committed Jan 2, 2014
1 parent 9bd9cc1 commit f148bb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/shoes/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def initialize(opts={}, &blk)
@__app__.open_gui
end

# Shoes 3 exposes the app object like this, so we keep it for
# compatibility
def app
self
end

# FIXME placeholder for code that calls app.gui. We should be able to get
# rid of this
def gui
Expand Down
5 changes: 5 additions & 0 deletions spec/shoes/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
it { should respond_to :clipboard= }
it { should respond_to :owner }

# For Shoes 3 compatibility
it "exposes self as #app" do
expect(app.app).to eq(app)
end

describe "initialize" do
let(:input_blk) { Proc.new {} }

Expand Down

0 comments on commit f148bb9

Please sign in to comment.