kame-remocon 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kame/remocon/opal/application.rb +5 -2
- data/lib/kame/remocon/opal/turtle.rb +2 -2
- data/lib/kame/remocon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a4def5c10963a31c4877cc84793e595e848639ad7579029734ca78fe55c339
|
4
|
+
data.tar.gz: 5e91dc326e154597aa1cd40ed2b6f4708f2e097908f32d62df19c26d78e0fded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d5ca897eb8795b933c5b49e7268329d22d7464453b1bcda359f1e450f3f2004c84a07288e25e9fee30c64b3d8292a6c6ff186e5945c11639e79aef0294b9ef5
|
7
|
+
data.tar.gz: ff303e4f041c77ce9496aa43efbbfb188b079350416a762126e668c98973e3ea5c527aaaa9a090be1177fcc0275a64104fe7d13852e852a8108c7f776a3dcac3
|
@@ -40,7 +40,7 @@ class AppView
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def mounted(canvas)
|
43
|
-
@turtle = Turtle.new(canvas
|
43
|
+
@turtle = Turtle.new(canvas)
|
44
44
|
@turtle.exec @program
|
45
45
|
|
46
46
|
if Config.ws_enabled?
|
@@ -52,7 +52,8 @@ class AppView
|
|
52
52
|
|
53
53
|
def exec
|
54
54
|
@program = @refs[:program].value
|
55
|
-
@
|
55
|
+
wait = @refs[:wait][:checked] ? 0.3 : 0
|
56
|
+
@turtle.exec @program, wait
|
56
57
|
end
|
57
58
|
|
58
59
|
def render
|
@@ -61,6 +62,8 @@ class AppView
|
|
61
62
|
h2(nil, 'タートルグラフィックスに挑戦!!')
|
62
63
|
CanvasView.el(onMounted: -> canvas { mounted(canvas) })
|
63
64
|
textarea({style: {width: "400px", height: "200px"}, ref: :program}, program)
|
65
|
+
input({type: :checkbox, checked: true, id: :wait, ref: :wait})
|
66
|
+
label({for: :wait}, "描く過程を表示する")
|
64
67
|
button({onClick: -> { exec() }, name: "exec"}, "Exec")
|
65
68
|
end
|
66
69
|
end
|
@@ -64,12 +64,12 @@ class Turtle
|
|
64
64
|
@context.set_transform(1, 0, 0, 1, 0, 0)
|
65
65
|
end
|
66
66
|
|
67
|
-
def exec(program)
|
67
|
+
def exec(program, wait=0)
|
68
68
|
clear
|
69
69
|
reset
|
70
70
|
commander = Commander.new
|
71
71
|
commander.instance_eval program
|
72
|
-
exec_commands(commander.commands)
|
72
|
+
exec_commands(commander.commands, wait: wait)
|
73
73
|
end
|
74
74
|
|
75
75
|
def exec_commands(commands, wait: nil)
|
data/lib/kame/remocon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kame-remocon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- youchan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|