joyce 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49e7cbd6ffa98685cd62a16615ce984ac887ed13
4
- data.tar.gz: 5394eef40ea80fecd84ad1bd68d0af91aec9c7d2
3
+ metadata.gz: 6bc22d8441975ee3881f678b7c068b51da49649a
4
+ data.tar.gz: c0d79c755b1afac230e47788d3a37b3d9eff6ad7
5
5
  SHA512:
6
- metadata.gz: f0a6459476037c5c25417ec66cd1f2590cef82fb919ff7cc282dcd86d6c0cea4bc4cce54a032b2dc42f4cf9ec17d88c504a945e96de870043d6e0a41901c5cc7
7
- data.tar.gz: 337a91d4aff50aa2ba8d72d016292f1abe059b13a2ed637de6b565641e84b0022e2661674c6ee36be3419ee83e07cf9df3b97a211b34aafdad029af77348b16f
6
+ metadata.gz: 627a09948349844e89bc29eb5520869de74bf4b9d075f5c97bf891b0291c53959704e1561b9e15ca019b92e9512e8a109c3eb88e366e337e6932c68a24abd365
7
+ data.tar.gz: dd7f9527503201fa211cd614b3f91da3a4b59ed691fa0dc35d9f8d6dae401a09f38184f0720c0c70ea10da5844d8f8c2b467e19b0b4e694f6a583d722fd44aa8
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'gosu'
5
+ # gem 'gosu'
6
6
  gem 'metacosm'
7
7
 
8
8
  group :development do
@@ -7,7 +7,7 @@ email: jweissman1986@gmail.com
7
7
  homepage: https://rubygems.org/gems/joyce
8
8
 
9
9
  dependencies:
10
- gosu: ~> 0.10
10
+ # gosu: ~> 0.10
11
11
  metacosm: ~> 0.3
12
12
  actionpack: ~> 4.2
13
13
 
@@ -1,4 +1,4 @@
1
- require 'gosu'
1
+ # require 'gosu'
2
2
  require 'redis' # TODO move require to mc/remote_sim?
3
3
  require 'metacosm'
4
4
  require 'metacosm/remote_simulation'
@@ -15,38 +15,40 @@ module Joyce
15
15
  EVENT_STREAM = :joyce_event_stream
16
16
  COMMAND_QUEUE = :joyce_command_queue
17
17
 
18
- class ApplicationWindow < Gosu::Window
19
- attr_accessor :width, :height
20
- attr_reader :app
18
+ if defined?(Gosu)
19
+ class ApplicationWindow < Gosu::Window
20
+ attr_accessor :width, :height
21
+ attr_reader :app
21
22
 
22
- def initialize(app, width:, height:, fullscreen: true)
23
- @app = app
24
- self.width = width
25
- self.height = height
23
+ def initialize(app, width:, height:, fullscreen: true)
24
+ @app = app
25
+ self.width = width
26
+ self.height = height
26
27
 
27
- super(self.width, self.height, fullscreen)
28
- end
28
+ super(self.width, self.height, fullscreen)
29
+ end
29
30
 
30
- def draw
31
- app.view.render
32
- end
31
+ def draw
32
+ app.view.render
33
+ end
33
34
 
34
- def update
35
- app.tick
36
- end
35
+ def update
36
+ app.tick
37
+ end
37
38
 
38
- def button_down(id)
39
- if id == Gosu::MsLeft
40
- app.click
41
- elsif id == Gosu::KbEscape
42
- close
43
- else
44
- app.press(id)
39
+ def button_down(id)
40
+ if id == Gosu::MsLeft
41
+ app.click
42
+ elsif id == Gosu::KbEscape
43
+ close
44
+ else
45
+ app.press(id)
46
+ end
45
47
  end
46
- end
47
48
 
48
- def mouse_position
49
- [ mouse_x, mouse_y ]
49
+ def mouse_position
50
+ [ mouse_x, mouse_y ]
51
+ end
50
52
  end
51
53
  end
52
54
 
@@ -15,7 +15,11 @@ module Joyce
15
15
  end
16
16
 
17
17
  def font
18
- @font ||= Gosu::Font.new(20)
18
+ @font ||= if defined?(Gosu)
19
+ Gosu::Font.new(20)
20
+ else
21
+ nil # NullFont?
22
+ end
19
23
  end
20
24
 
21
25
  def mouse_position
@@ -1,4 +1,4 @@
1
1
  module Joyce
2
2
  # joyce version
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
@@ -53,7 +53,7 @@ end
53
53
 
54
54
  describe Example::SampleAppView do
55
55
  let(:sample_app) { Example::Application.new(headless: true) }
56
- let(:window) { instance_double(ApplicationWindow) }
56
+ let(:window) { double }
57
57
 
58
58
  subject(:sample_app_view) { sample_app.view }
59
59
  before { sample_app.setup }
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joyce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Weissman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: gosu
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.10'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.10'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: metacosm
29
15
  requirement: !ruby/object:Gem::Requirement