woyo-server 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/woyo/server/server.rb +21 -4
- data/lib/woyo/server/version.rb +1 -1
- data/public/server/css/server.css +6 -0
- data/public/server/js/server.js +36 -3
- data/spec/spec_helper.rb +2 -0
- data/spec/woyo/server/1_server_spec.rb +185 -117
- data/spec/woyo/server/runner_spec.rb +1 -1
- data/tmux +4 -4
- data/views/server/actions.haml +6 -0
- data/views/server/item.haml +7 -0
- data/views/server/location.haml +3 -2
- data/views/server/way.haml +2 -3
- data/views/server/world.haml +1 -1
- data/woyo-server.gemspec +2 -0
- metadata +34 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfa37213238187a3f86e96fbfc729b52cdf3570d
|
4
|
+
data.tar.gz: 8103df5e8c3917375468aebacea6e73c58fefb33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92db08cbf485b5422d0d09863cfba099046a006eb336b49ef6ce6ed3154739e4aab9c6599230a83e0b32e96cdc9e0b90b61b20a10b0d1fe5cfc2460f73b205f
|
7
|
+
data.tar.gz: 6cea759a5e366bd90c5f3b5936695bd35f9a90678e55e671d48fa08c90c1749ceb5c33760d5f3156f204b1a8d21e62318591931fc562d43842d010d292e5ed78
|
data/lib/woyo/server/server.rb
CHANGED
@@ -23,6 +23,7 @@ class Server < Sinatra::Application
|
|
23
23
|
|
24
24
|
configure do
|
25
25
|
enable :sessions
|
26
|
+
set :session_secret, SecureRandom.hex(16)
|
26
27
|
set root: '.'
|
27
28
|
set views: Proc.new { File.join(root, "views/server") }
|
28
29
|
set public_folder: Proc.new { File.join(root, "public/server") }
|
@@ -34,7 +35,7 @@ class Server < Sinatra::Application
|
|
34
35
|
end
|
35
36
|
|
36
37
|
get '/' do
|
37
|
-
redirect to 'default.html' if world.
|
38
|
+
redirect to 'default.html' if world.description.nil? && world.start.nil? # && world.name.nil?
|
38
39
|
@world = world
|
39
40
|
session[:location_id] = world.start
|
40
41
|
haml :world
|
@@ -46,14 +47,30 @@ class Server < Sinatra::Application
|
|
46
47
|
end
|
47
48
|
|
48
49
|
get '/go/*' do |way_id|
|
50
|
+
content_type :json
|
49
51
|
way = world.locations[session[:location_id]].ways[way_id.to_sym]
|
50
52
|
session[:location_id] = way.to.id if way.open?
|
51
|
-
content_type :json
|
52
53
|
way.go.to_json
|
53
54
|
end
|
54
55
|
|
55
|
-
get '/do
|
56
|
-
|
56
|
+
get '/do/*/*/*' do |owner_type,owner_id,action_id|
|
57
|
+
content_type :json
|
58
|
+
initial_location_id = session[:location_id]
|
59
|
+
location = world.locations[initial_location_id]
|
60
|
+
if location.children.include? owner_type.to_sym
|
61
|
+
owner = location.send( owner_type, owner_id.to_sym )
|
62
|
+
result = owner.action( action_id.to_sym ).execute
|
63
|
+
# extract client-related info from execution hash
|
64
|
+
if result[:execution].kind_of?( Hash )
|
65
|
+
result[:changes] = result[:execution][:changes] ? Array(result[:execution][:changes]) : []
|
66
|
+
if result[:execution][:location]
|
67
|
+
session[:location_id] = result[:execution][:location]
|
68
|
+
result[:changes] << :location
|
69
|
+
end
|
70
|
+
end
|
71
|
+
result.delete :execution # execution info is for server only, do not pass to client
|
72
|
+
result.to_json
|
73
|
+
end
|
57
74
|
end
|
58
75
|
|
59
76
|
end
|
data/lib/woyo/server/version.rb
CHANGED
data/public/server/js/server.js
CHANGED
@@ -20,12 +20,13 @@ $(document).ready( function() {
|
|
20
20
|
go_url = $go_link.attr("href");
|
21
21
|
$.get( go_url, function(json) {
|
22
22
|
if ( json.going.length > 0 ) {
|
23
|
-
|
24
|
-
|
23
|
+
$go_link
|
24
|
+
.siblings(".going")
|
25
25
|
.text(json.going)
|
26
26
|
.slideDown(woyo.time.go_slide)
|
27
27
|
.animate({opacity: 1}, woyo.time.go_fade)
|
28
|
-
.delay(woyo.time.go_delay)
|
28
|
+
.delay(woyo.time.go_delay)
|
29
|
+
.queue( function(next) {
|
29
30
|
if ( json.go == true ) {
|
30
31
|
$("body").fadeOut(woyo.time.page_out, function() {
|
31
32
|
window.location.reload(true);
|
@@ -43,5 +44,37 @@ $(document).ready( function() {
|
|
43
44
|
});
|
44
45
|
return false;
|
45
46
|
});
|
47
|
+
|
48
|
+
$("a.do").click( function() {
|
49
|
+
owner = $("#" + $(this).parent().attr("owner_element"));
|
50
|
+
do_url = $(this).attr("href");
|
51
|
+
$.get( do_url, function(json) {
|
52
|
+
// todo: handle multiple texts in describe array not just a string
|
53
|
+
if ( json.describe.length > 0 ) {
|
54
|
+
owner
|
55
|
+
.children(".describe-actions")
|
56
|
+
.text(json.describe)
|
57
|
+
.slideDown(woyo.time.go_slide)
|
58
|
+
.animate({opacity: 1}, woyo.time.go_fade)
|
59
|
+
.delay(woyo.time.go_delay)
|
60
|
+
.queue( function(next) {
|
61
|
+
if ( json.changes.length > 0 ) {
|
62
|
+
$("body").fadeOut(woyo.time.page_out, function() {
|
63
|
+
window.location.reload(true);
|
64
|
+
});
|
65
|
+
};
|
66
|
+
next();
|
67
|
+
});
|
68
|
+
} else {
|
69
|
+
if ( json.changes.length > 0 ) {
|
70
|
+
$("body").fadeOut(woyo.time.page_out, function() {
|
71
|
+
window.location.reload(true);
|
72
|
+
});
|
73
|
+
};
|
74
|
+
};
|
75
|
+
});
|
76
|
+
return false;
|
77
|
+
});
|
78
|
+
|
46
79
|
});
|
47
80
|
|
data/spec/spec_helper.rb
CHANGED
@@ -12,7 +12,7 @@ describe Woyo::Server, :type => :feature do
|
|
12
12
|
# worlds
|
13
13
|
@small_world = Woyo::World.new do
|
14
14
|
name "Small World"
|
15
|
-
description "It's a small world after all"
|
15
|
+
description "It's a small world after all."
|
16
16
|
location :small
|
17
17
|
end
|
18
18
|
@home_world = Woyo::World.new do
|
@@ -27,35 +27,50 @@ describe Woyo::Server, :type => :feature do
|
|
27
27
|
end
|
28
28
|
way :down do
|
29
29
|
name 'Stairs'
|
30
|
-
description 'Rickety stairs lead down into darkness. A dank smell emanates from the darkness below'
|
30
|
+
description 'Rickety stairs lead down into darkness. A dank smell emanates from the darkness below.'
|
31
31
|
to :cellar
|
32
32
|
end
|
33
|
+
item :table do
|
34
|
+
description 'A sturdy table.'
|
35
|
+
end
|
36
|
+
item :chair do
|
37
|
+
description 'A comfortable chair.'
|
38
|
+
end
|
39
|
+
item :lamp do
|
40
|
+
description 'A small lamp sits in darkness upon the table.'
|
41
|
+
attribute light: false
|
42
|
+
action :switch do
|
43
|
+
execute do
|
44
|
+
light !light
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
33
48
|
end
|
34
49
|
location :garden do
|
35
50
|
name 'Garden'
|
36
|
-
description 'A peaceful green oasis of life in the midst of a gray city'
|
51
|
+
description 'A peaceful green oasis of life in the midst of a gray city.'
|
37
52
|
way :in do
|
38
53
|
name 'Door'
|
39
|
-
description 'Door leads inside a cute cottage'
|
54
|
+
description 'Door leads inside a cute cottage.'
|
40
55
|
to :home
|
41
56
|
end
|
42
57
|
way :down do
|
43
58
|
name 'Bulkhead'
|
44
|
-
description 'Rusty bulkhead door and stairs'
|
59
|
+
description 'Rusty bulkhead door and stairs.'
|
45
60
|
to :cellar
|
46
61
|
end
|
47
62
|
end
|
48
63
|
location :cellar do
|
49
64
|
name 'Cellar'
|
50
|
-
description 'Dark and damp, full of shadows and strange sounds'
|
65
|
+
description 'Dark and damp, full of shadows and strange sounds.'
|
51
66
|
way :out do
|
52
67
|
name 'Bulkhead'
|
53
|
-
description 'Rusty bulkhead stairs and door'
|
68
|
+
description 'Rusty bulkhead stairs and door.'
|
54
69
|
to :garden
|
55
70
|
end
|
56
71
|
way :up do
|
57
72
|
name 'Stairs'
|
58
|
-
description 'Rickety stairs lead up into light'
|
73
|
+
description 'Rickety stairs lead up into light.'
|
59
74
|
to :home
|
60
75
|
end
|
61
76
|
end
|
@@ -143,8 +158,8 @@ describe Woyo::Server, :type => :feature do
|
|
143
158
|
visit '/'
|
144
159
|
status_code.should eq 200
|
145
160
|
page.should have_selector '.world .name', text: "Small World"
|
146
|
-
page.should have_selector '.world .description', text: "It's a small world after all"
|
147
|
-
page.should have_selector '.world .
|
161
|
+
page.should have_selector '.world .description', text: "It's a small world after all."
|
162
|
+
page.should have_selector '.world .no_start'
|
148
163
|
page.should_not have_selector '.world .start'
|
149
164
|
end
|
150
165
|
|
@@ -154,9 +169,9 @@ describe Woyo::Server, :type => :feature do
|
|
154
169
|
visit '/'
|
155
170
|
status_code.should eq 200
|
156
171
|
page.should have_selector '.world .name', text: "Small World"
|
157
|
-
page.should have_selector '.world .description', text: "It's a small world after all"
|
172
|
+
page.should have_selector '.world .description', text: "It's a small world after all."
|
158
173
|
page.should have_selector '.world .start a[href="/location"]', text: "Start"
|
159
|
-
page.should_not have_selector '.world .
|
174
|
+
page.should_not have_selector '.world .no_start'
|
160
175
|
end
|
161
176
|
|
162
177
|
end
|
@@ -175,145 +190,198 @@ describe Woyo::Server, :type => :feature do
|
|
175
190
|
Woyo::Server.set :world, @home_world
|
176
191
|
visit '/'
|
177
192
|
click_on 'start'
|
193
|
+
# save_page
|
178
194
|
status_code.should eq 200
|
179
|
-
page.should have_selector '.location#
|
180
|
-
page.should have_selector '.location#
|
181
|
-
page.should have_selector '.
|
182
|
-
page.should have_selector '.way#
|
183
|
-
page.should have_selector '.
|
184
|
-
page.should have_selector '.
|
185
|
-
page.should have_selector '.
|
186
|
-
page.should have_selector '.
|
187
|
-
page.should have_selector '.way#way_down .description', text: 'Rickety stairs lead down'
|
195
|
+
page.should have_selector '.location#location-home .name', text: 'Home'
|
196
|
+
page.should have_selector '.location#location-home .description', text: 'Where the heart is.'
|
197
|
+
page.should have_selector '.way#way-out .description', text: 'A sturdy wooden door, '
|
198
|
+
page.should have_selector '.way#way-down .description', text: 'Rickety stairs lead down into darkness.'
|
199
|
+
page.should have_selector '.item#item-table .description', text: 'A sturdy table.'
|
200
|
+
page.should have_selector '.item#item-chair .description', text: 'A comfortable chair.'
|
201
|
+
page.should have_selector '.item#item-lamp .description', text: 'A small lamp sits in darkness upon the table.'
|
202
|
+
page.should have_selector '.action#action-item-lamp-switch .name', text: 'switch'
|
188
203
|
end
|
189
204
|
|
190
|
-
|
205
|
+
context 'items' do
|
191
206
|
|
192
|
-
|
207
|
+
end
|
193
208
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
209
|
+
context 'actions' do
|
210
|
+
|
211
|
+
before :all do
|
212
|
+
@actions_world = Woyo::World.new do
|
213
|
+
start :home
|
214
|
+
location :home do
|
215
|
+
item :lamp do
|
216
|
+
description on: "Lamp is on.",
|
217
|
+
off: "Lamp is off."
|
218
|
+
exclusion :light, :off, :on
|
219
|
+
action :switch do
|
220
|
+
description 'Turns the lamp on or off.'
|
221
|
+
exclusion :result, :off, :on
|
222
|
+
describe on: 'The lamp turns on.',
|
223
|
+
off: 'The lamp turns off.'
|
224
|
+
execution do |this|
|
225
|
+
this.on on # sync switch with lamp
|
226
|
+
this.on this.off # toggle switch
|
227
|
+
on off # toggle lamp
|
228
|
+
{ changes: :lamp }
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
211
232
|
end
|
212
233
|
end
|
234
|
+
Woyo::Server.set :world, @actions_world
|
213
235
|
end
|
214
|
-
Woyo::Server.set :world, @ways_world
|
215
|
-
end
|
216
|
-
|
217
|
-
context 'are described' do
|
218
236
|
|
219
237
|
before :each do
|
220
238
|
visit '/'
|
221
239
|
click_on 'start'
|
222
|
-
status_code.should eq 200
|
223
240
|
end
|
224
241
|
|
225
|
-
it '
|
226
|
-
page.should have_selector '.
|
227
|
-
page.should have_selector '.way#way_door .name', text: 'Door'
|
228
|
-
page.should have_selector '.way#way_door .description', text: 'A sturdy wooden door'
|
242
|
+
it 'have a name' do
|
243
|
+
page.should have_selector '.action#action-item-lamp-switch .name', text: 'switch'
|
229
244
|
end
|
230
245
|
|
231
|
-
it '
|
232
|
-
page.should have_selector '.
|
233
|
-
page.should have_selector '.way#way_stairs .name', text: 'Stairs'
|
234
|
-
page.should have_selector '.way#way_stairs .description', text: 'Broken stairs lead down into darkness.'
|
246
|
+
it 'have a link' do
|
247
|
+
page.should have_selector '.action#action-item-lamp-switch a#do-item-lamp-switch'
|
235
248
|
end
|
236
249
|
|
237
|
-
|
250
|
+
it 'clicking link causes changes', :js => true do
|
251
|
+
sleep 3
|
252
|
+
page.should have_selector '.item#item-lamp .description', text: 'Lamp is off.'
|
253
|
+
click_on 'do-item-lamp-switch'
|
254
|
+
sleep 3
|
255
|
+
page.should have_selector '.item#item-lamp .describe-actions', text: 'The lamp turns on.'
|
256
|
+
sleep 3
|
257
|
+
page.should have_selector '.item#item-lamp .description', text: 'Lamp is on.'
|
258
|
+
end
|
238
259
|
|
239
|
-
|
260
|
+
end
|
240
261
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
262
|
+
context 'ways' do
|
263
|
+
|
264
|
+
before :all do
|
265
|
+
@ways_world = Woyo::World.new do
|
266
|
+
start :home
|
267
|
+
location :home do
|
268
|
+
way :door do
|
269
|
+
description open: 'A sturdy wooden door.', closed: 'Never closed'
|
270
|
+
going open: 'The door opens, leading to a sunlit garden.', closed: 'Never closed'
|
271
|
+
to :garden
|
272
|
+
end
|
273
|
+
way :stairs do
|
274
|
+
description closed: 'Broken stairs lead down into darkness.', open: 'Never open'
|
275
|
+
going closed: 'The broken stairs are impassable.', open: 'Never open'
|
276
|
+
end
|
277
|
+
way :window do
|
278
|
+
description 'A nice view.'
|
279
|
+
going 'Makes no difference.'
|
280
|
+
to :yard
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
Woyo::Server.set :world, @ways_world
|
251
285
|
end
|
252
286
|
|
253
|
-
|
254
|
-
window = @ways_world.locations[:home].ways[:window]
|
255
|
-
window.close!
|
256
|
-
window.should be_closed
|
257
|
-
visit '/'
|
258
|
-
click_on 'start'
|
259
|
-
status_code.should eq 200
|
260
|
-
page.should have_selector '.way#way_window a#go_window'
|
261
|
-
page.should have_selector '.way#way_window .name', text: 'Window'
|
262
|
-
page.should have_selector '.way#way_window .description', text: 'A nice view.'
|
263
|
-
end
|
287
|
+
context 'are described' do
|
264
288
|
|
265
|
-
|
289
|
+
before :each do
|
290
|
+
visit '/'
|
291
|
+
click_on 'start'
|
292
|
+
status_code.should eq 200
|
293
|
+
end
|
266
294
|
|
267
|
-
|
295
|
+
it 'open' do
|
296
|
+
page.should have_selector '.way#way-door a#go-door'
|
297
|
+
page.should have_selector '.way#way-door .description', text: 'A sturdy wooden door.'
|
298
|
+
end
|
268
299
|
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
end
|
300
|
+
it 'closed' do
|
301
|
+
page.should have_selector '.way#way-stairs a#go-stairs'
|
302
|
+
page.should have_selector '.way#way-stairs .description', text: 'Broken stairs lead down into darkness.'
|
303
|
+
end
|
274
304
|
|
275
|
-
it 'open' do
|
276
|
-
page.should have_selector '.way#way_door a#go_door'
|
277
|
-
click_link 'go_door'
|
278
|
-
page.should have_selector '.way#way_door .going', text: 'The door opens, leading to a sunlit garden'
|
279
|
-
sleep 3
|
280
|
-
page.should have_selector '.location#location_garden .name', text: 'Garden'
|
281
305
|
end
|
282
306
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
307
|
+
context 'are described with default' do
|
308
|
+
|
309
|
+
it 'open' do
|
310
|
+
window = @ways_world.locations[:home].ways[:window]
|
311
|
+
window.open!
|
312
|
+
window.should be_open
|
313
|
+
visit '/'
|
314
|
+
click_on 'start'
|
315
|
+
status_code.should eq 200
|
316
|
+
page.should have_selector '.way#way-window a#go-window'
|
317
|
+
page.should have_selector '.way#way-window .description', text: 'A nice view.'
|
318
|
+
end
|
319
|
+
|
320
|
+
it 'closed' do
|
321
|
+
window = @ways_world.locations[:home].ways[:window]
|
322
|
+
window.close!
|
323
|
+
window.should be_closed
|
324
|
+
visit '/'
|
325
|
+
click_on 'start'
|
326
|
+
status_code.should eq 200
|
327
|
+
page.should have_selector '.way#way-window a#go-window'
|
328
|
+
page.should have_selector '.way#way-window .description', text: 'A nice view.'
|
329
|
+
end
|
330
|
+
|
288
331
|
end
|
289
332
|
|
290
|
-
|
333
|
+
context 'are described going', :js => true do
|
291
334
|
|
292
|
-
|
335
|
+
before :each do
|
336
|
+
visit '/'
|
337
|
+
page.find('body', visible: true)
|
338
|
+
click_on 'start'
|
339
|
+
end
|
340
|
+
|
341
|
+
it 'open' do
|
342
|
+
page.should have_selector '.way#way-door a#go-door'
|
343
|
+
click_link 'go-door'
|
344
|
+
page.should have_selector '.way#way-door .going', text: 'The door opens, leading to a sunlit garden.'
|
345
|
+
sleep 3
|
346
|
+
page.should have_selector '.location#location-garden .name', text: 'Garden'
|
347
|
+
end
|
348
|
+
|
349
|
+
it 'closed' do
|
350
|
+
page.should have_selector '.way#way-stairs a#go-stairs'
|
351
|
+
click_link 'go-stairs'
|
352
|
+
page.should have_selector '.way#way-stairs .going', text: 'The broken stairs are impassable.'
|
353
|
+
page.should have_selector '.location#location-home .name', text: 'Home'
|
354
|
+
end
|
293
355
|
|
294
|
-
it 'open' do
|
295
|
-
window = @ways_world.locations[:home].ways[:window]
|
296
|
-
window.open!
|
297
|
-
window.should be_open
|
298
|
-
visit '/'
|
299
|
-
click_on 'start'
|
300
|
-
page.should have_selector '.way#way_window a#go_window'
|
301
|
-
click_link 'go_window'
|
302
|
-
page.should have_selector '.way#way_window .going', text: 'Makes no difference.'
|
303
|
-
sleep 3
|
304
|
-
page.should have_selector '.location#location_yard .name', text: 'Yard'
|
305
356
|
end
|
306
357
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
358
|
+
context 'are described going with default', :js => true do
|
359
|
+
|
360
|
+
it 'open' do
|
361
|
+
window = @ways_world.locations[:home].ways[:window]
|
362
|
+
window.open!
|
363
|
+
window.should be_open
|
364
|
+
visit '/'
|
365
|
+
click_on 'start'
|
366
|
+
page.should have_selector '.way#way-window a#go-window'
|
367
|
+
click_link 'go-window'
|
368
|
+
page.should have_selector '.way#way-window .going', text: 'Makes no difference.'
|
369
|
+
sleep 3
|
370
|
+
page.should have_selector '.location#location-yard .name', text: 'Yard'
|
371
|
+
end
|
372
|
+
|
373
|
+
it 'closed' do
|
374
|
+
window = @ways_world.locations[:home].ways[:window]
|
375
|
+
window.close!
|
376
|
+
window.should be_closed
|
377
|
+
visit '/'
|
378
|
+
click_on 'start'
|
379
|
+
page.should have_selector '.way#way-window a#go-window'
|
380
|
+
click_link 'go-window'
|
381
|
+
page.should have_selector '.way#way-window .going', text: 'Makes no difference.'
|
382
|
+
page.should have_selector '.location#location-home .name', text: 'Home'
|
383
|
+
end
|
384
|
+
|
317
385
|
end
|
318
386
|
|
319
387
|
end
|
@@ -20,7 +20,7 @@ describe Woyo::Runner do
|
|
20
20
|
'world' => %w( . .. .gitkeep ),
|
21
21
|
'views' => %w( . .. app server ),
|
22
22
|
'views/app' => %w( . .. .gitkeep ),
|
23
|
-
'views/server' => %w( . .. layout.haml location.haml way.haml world.haml ),
|
23
|
+
'views/server' => %w( . .. actions.haml item.haml layout.haml location.haml way.haml world.haml ),
|
24
24
|
'public' => %w( . .. app server ),
|
25
25
|
'public/app' => %w( . .. html images js css ),
|
26
26
|
'public/server' => %w( . .. css default.html foundation-5.2.2 jquery-2.1.1 js ),
|
data/tmux
CHANGED
@@ -12,10 +12,10 @@ tmux send-keys -t vim "vim ." C-m
|
|
12
12
|
|
13
13
|
tmux new-window -n rspec -d
|
14
14
|
tmux send-keys -t rspec "cd ." C-m
|
15
|
-
tmux send-keys -t rspec "rs" C-m
|
15
|
+
tmux send-keys -t rspec "rs --tag ~js" C-m
|
16
16
|
|
17
|
-
tmux new-window -n
|
18
|
-
tmux send-keys -t
|
19
|
-
tmux send-keys -t
|
17
|
+
tmux new-window -n pry -d
|
18
|
+
tmux send-keys -t pry "cd ." C-m
|
19
|
+
tmux send-keys -t pry "bundle exec pry -r 'woyo/server'" C-m
|
20
20
|
tmux swap-window -s vim -t shell
|
21
21
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
%ul.actions
|
2
|
+
- owner_type = owner.class.name.split('::').last.downcase
|
3
|
+
- owner.actions.names.each do |action|
|
4
|
+
%li.action{ :id => "action-#{owner_type}-#{owner.id}-#{action}", :owner_element => "#{owner_type}-#{owner.id}" }
|
5
|
+
%a.do{ :id => "do-#{owner_type}-#{owner.id}-#{action}", :href => "/do/#{owner_type}/#{owner.id}/#{action}" }
|
6
|
+
%span.name= action
|
data/views/server/location.haml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
.row
|
2
2
|
.large-12.columns
|
3
|
-
.location{ :id => "
|
3
|
+
.location{ :id => "location-#{@location.id}" }
|
4
4
|
%h1.name= @location.name
|
5
5
|
%p.description= @location.description
|
6
|
-
= partial :way,
|
6
|
+
= partial :way, collection: @location.ways.values
|
7
|
+
= partial :item, collection: @location.items.values
|
7
8
|
|
data/views/server/way.haml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
.row
|
2
2
|
.large-12.columns
|
3
|
-
.way{ :id => "
|
4
|
-
%a.go{ :id => "
|
5
|
-
%h3.name= way.name
|
3
|
+
.way{ :id => "way-#{way.id}" }
|
4
|
+
%a.go{ :id => "go-#{way.id}", :href => "/go/#{way.id}" }
|
6
5
|
%p.description= way.description
|
7
6
|
%p.going
|
data/views/server/world.haml
CHANGED
data/woyo-server.gemspec
CHANGED
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "pry"
|
24
|
+
spec.add_development_dependency "pry-byebug"
|
23
25
|
spec.add_development_dependency "rack-test", "~> 0.6.2"
|
24
26
|
spec.add_development_dependency "rspec"
|
25
27
|
spec.add_development_dependency "capybara"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woyo-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerard Fowley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: rack-test
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +128,14 @@ dependencies:
|
|
100
128
|
requirements:
|
101
129
|
- - ">="
|
102
130
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.0.
|
131
|
+
version: 0.0.8
|
104
132
|
type: :runtime
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
136
|
- - ">="
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.0.
|
138
|
+
version: 0.0.8
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: sinatra
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -230,6 +258,8 @@ files:
|
|
230
258
|
- tmux
|
231
259
|
- todo.txt
|
232
260
|
- views/app/.gitkeep
|
261
|
+
- views/server/actions.haml
|
262
|
+
- views/server/item.haml
|
233
263
|
- views/server/layout.haml
|
234
264
|
- views/server/location.haml
|
235
265
|
- views/server/way.haml
|