joyce 0.2.0 → 0.2.1

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: b2a9903f9ac071ca39c832c634b96899148838f3
4
- data.tar.gz: 5f3eee295b0ed1cb36ff5f082512201d77537d96
3
+ metadata.gz: 60ec74ff063b3e763564765de9410f810050d2b3
4
+ data.tar.gz: c1796900f78a0588eb10face710a15baf8ec974b
5
5
  SHA512:
6
- metadata.gz: 3590192fcfbdae2da8ba8dbb2b6d40d36709749cf19ef68483ca6ae43f5ce41f7a3fb2381fed8f13dde66ae191f0c62e8e81aa41b4aec8bf4dfedca5cf065bcb
7
- data.tar.gz: 3768eeaf9eec4f8df74d7983fc244e603455c690dcea390ff027a07fbc14eb2a3d79244f364b0b35b2120f77bd0d99103c0d8b7b10e7129b5d9559762e169c1d
6
+ metadata.gz: 1318ca2c5993560d7392551515acd2e651e012e22e967827852ab64b7d4a7685f42a67bacc4c96b968aff9c10539d071ecb639dbb81bcb22d0e3c751a9894b18
7
+ data.tar.gz: d52eab14b3164c7fe2419c6a708d6f4016be0826e05f75cb21d6e6b5ea95925b83c78cde2130b38b4e8c0c037cbc99eef73c2add070a1f50c36e98dcc114a1ad
data/lib/joyce.rb CHANGED
@@ -8,35 +8,13 @@ include ActionView::Helpers::DateHelper
8
8
 
9
9
  require 'joyce/version'
10
10
  require 'joyce/application'
11
+ require 'joyce/application_view'
11
12
 
12
13
  module Joyce
14
+ # TODO move to joyce config?
13
15
  EVENT_STREAM = :joyce_event_stream
14
16
  COMMAND_QUEUE = :joyce_command_queue
15
17
 
16
- class ApplicationView
17
- attr_reader :application
18
-
19
- def initialize(application)
20
- @application ||= application
21
- end
22
-
23
- def render
24
- # ...
25
- end
26
-
27
- def window
28
- @application.window
29
- end
30
-
31
- def font
32
- @font ||= Gosu::Font.new(20)
33
- end
34
-
35
- def mouse_position
36
- window.mouse_position
37
- end
38
- end
39
-
40
18
  class ApplicationWindow < Gosu::Window
41
19
  attr_accessor :width, :height
42
20
  attr_reader :app
@@ -7,7 +7,7 @@ module Joyce
7
7
  @headless = headless
8
8
  end
9
9
 
10
- def setup
10
+ def setup(*)
11
11
  # ...
12
12
  end
13
13
 
@@ -19,9 +19,9 @@ module Joyce
19
19
  # ...
20
20
  end
21
21
 
22
- def launch
22
+ def launch(*setup_args)
23
23
  sim.conduct!
24
- setup
24
+ setup(*setup_args)
25
25
  window.show
26
26
  self
27
27
  end
@@ -66,9 +66,9 @@ module Joyce
66
66
  self
67
67
  end
68
68
 
69
- def kickstart!(headless: false)
69
+ def kickstart!(headless: false, setup: {})
70
70
  app = new(headless: headless)
71
- app.launch
71
+ app.launch(setup)
72
72
  app
73
73
  end
74
74
  end
@@ -0,0 +1,25 @@
1
+ module Joyce
2
+ class ApplicationView
3
+ attr_reader :application
4
+
5
+ def initialize(application)
6
+ @application ||= application
7
+ end
8
+
9
+ def render
10
+ # ...
11
+ end
12
+
13
+ def window
14
+ @application.window
15
+ end
16
+
17
+ def font
18
+ @font ||= Gosu::Font.new(20)
19
+ end
20
+
21
+ def mouse_position
22
+ window.mouse_position
23
+ end
24
+ end
25
+ end
data/lib/joyce/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Joyce
2
2
  # joyce version
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joyce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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-04-23 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
@@ -170,7 +170,6 @@ files:
170
170
  - README.md
171
171
  - Rakefile
172
172
  - bin/joyce
173
- - dump.rdb
174
173
  - example/Gemfile
175
174
  - example/Gemfile.lock
176
175
  - example/Rakefile
@@ -186,6 +185,7 @@ files:
186
185
  - joyce.gemspec
187
186
  - lib/joyce.rb
188
187
  - lib/joyce/application.rb
188
+ - lib/joyce/application_view.rb
189
189
  - lib/joyce/tasks/build.rb
190
190
  - lib/joyce/version.rb
191
191
  - spec/joyce_spec.rb
data/dump.rdb DELETED
@@ -1 +0,0 @@
1
- REDIS0006�ܳC�Z��V