kame-remocon 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 0afcb5b1e212f5c114f7f61b45a74b9eaf430bae2544574fa9c592612bc335d0
4
- data.tar.gz: d96dfddb20e7953a91c1025eb2be9a773cb2f00a942f0ea8389965980fbaf973
3
+ metadata.gz: d8a4def5c10963a31c4877cc84793e595e848639ad7579029734ca78fe55c339
4
+ data.tar.gz: 5e91dc326e154597aa1cd40ed2b6f4708f2e097908f32d62df19c26d78e0fded
5
5
  SHA512:
6
- metadata.gz: a3a8539d32c7a9199f676c78f38ce700a4db224d5c10685075ab13d0d73a6f7fff4cea45e6b180fedf6b949d7591e486b3dbd000db45d6c17e6bbf13a4c92d20
7
- data.tar.gz: f474f1a2fac6d0d706a71ce7a92583dae3ae050a43ffa6bf530324a028f5f24509fd53f3918f00ed31970e255c6dce95c1d65a9e9a90bf88fe8e7e2d8ce01eca
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, wait: 0.3)
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
- @turtle.exec @program
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)
@@ -1,5 +1,5 @@
1
1
  module Kame
2
2
  module Remocon
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
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.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-04 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra