smalruby-editor 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smalruby-editor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/application.js +1 -1
- data/app/assets/javascripts/blocks/control.js.coffee.erb +14 -4
- data/app/assets/javascripts/blocks/events.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +24 -18
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +1 -1
- data/app/assets/javascripts/fix_blockly.js +12 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +1 -1
- data/app/assets/javascripts/smalruby.js.coffee +12 -0
- data/app/assets/javascripts/views/main_menu_view.js.coffee +5 -1
- data/app/assets/javascripts/views/reset_modal_view.js.coffee +11 -0
- data/app/assets/stylesheets/toolbox.css.scss.erb +29 -19
- data/app/controllers/source_codes_controller.rb +26 -20
- data/app/helpers/application_helper.rb +3 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn_xy.rb +2 -1
- data/app/views/editor/_block_tab.html.haml +0 -1
- data/app/views/editor/_character_modal.html.haml +1 -1
- data/app/views/editor/_load_modal.html.haml +1 -1
- data/app/views/editor/_reset_modal.html.haml +15 -0
- data/app/views/editor/_signin_modal.html.haml +1 -1
- data/app/views/editor/_toolbox.html.haml +264 -257
- data/app/views/editor/index.html.haml +4 -2
- data/lib/smalruby_editor/version.rb +3 -3
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js → application-c8991557a0789ac1bc9220f409e7f1c1.js} +175 -110
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js.gz → application-c8991557a0789ac1bc9220f409e7f1c1.js.gz} +0 -0
- data/public/assets/{application-e9d089df8f23954c49647ab7af8481dc.css → application-d4fe6c0f970efe8eab9267fd08718d96.css} +182 -104
- data/public/assets/application-d4fe6c0f970efe8eab9267fd08718d96.css.gz +0 -0
- data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
- data/smalruby-editor.gemspec +1 -1
- data/spec/acceptance/base.feature +59 -0
- data/spec/acceptance/block_mode/blocks/control/await.feature +49 -2
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +67 -6
- data/spec/acceptance/block_mode/blocks/control/break.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/next.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/redo.feature +0 -3
- data/spec/acceptance/standalone/signin.feature +12 -10
- data/spec/steps/base_steps.rb +13 -0
- data/spec/steps/global_variable.rb +11 -0
- metadata +10 -8
- data/public/assets/application-e9d089df8f23954c49647ab7af8481dc.css.gz +0 -0
@@ -1,85 +1,132 @@
|
|
1
1
|
%xml{:id => 'toolbox', :style => 'display: none'}
|
2
2
|
- category = 'motion'
|
3
|
-
%category{:name => '
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
%category{:name => '動き'}
|
4
|
+
%category{:name => '移動'}
|
5
|
+
-# ( )歩動かす
|
6
|
+
%block{:type => "#{category}_move"}
|
7
|
+
= toolbox_number_value('STEP', 10)
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
-# x座標を( )、y座標を( )にする
|
10
|
+
%block{:type => "#{category}_set_x_y"}
|
11
|
+
= toolbox_number_value('X')
|
12
|
+
= toolbox_number_value('Y')
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
-# マウスポインターへ行く
|
15
|
+
%block{:type => "#{category}_go_to_mouse"}
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
-# [▼]へ行く
|
18
|
+
%block{:type => "#{category}_go_to_character"}
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
-# ( )秒でx座標を( )、y座標を( )に変える
|
21
|
+
-#%block{:type => "#{category}_glide_to_x_y"}
|
22
|
+
-# = toolbox_number_value('SEC', 1)
|
23
|
+
-# = toolbox_number_value('X')
|
24
|
+
-# = toolbox_number_value('Y')
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
-# x座標を( )ずつ変える
|
27
|
+
%block{:type => "#{category}_change_x_by"}
|
28
|
+
= toolbox_number_value('X', 10)
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
-# x座標を( )にする
|
31
|
+
%block{:type => "#{category}_set_x"}
|
32
|
+
= toolbox_number_value('X', 0)
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
-# y座標を( )ずつ変える
|
35
|
+
%block{:type => "#{category}_change_y_by"}
|
36
|
+
= toolbox_number_value('Y', 10)
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
-# y座標を( )にする
|
39
|
+
%block{:type => "#{category}_set_y"}
|
40
|
+
= toolbox_number_value('Y', 0)
|
40
41
|
|
41
|
-
|
42
|
-
|
42
|
+
-# 変数:x座標
|
43
|
+
%block{:type => "#{category}_self_x"}
|
43
44
|
|
44
|
-
|
45
|
-
|
45
|
+
-# 変数:y座標
|
46
|
+
%block{:type => "#{category}_self_y"}
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
%category{:name => '回転'}
|
49
|
+
-# もし端に着いたら、跳ね返る
|
50
|
+
%block{:type => "#{category}_turn_if_reach_wall"}
|
50
51
|
|
51
|
-
|
52
|
-
|
52
|
+
-# 条件:端に着いた
|
53
|
+
%block{:type => "#{category}_reach_wall"}
|
53
54
|
|
54
|
-
|
55
|
-
|
55
|
+
-# 跳ね返る
|
56
|
+
%block{:type => "#{category}_turn"}
|
56
57
|
|
57
|
-
|
58
|
-
|
58
|
+
-# [▼水平(X)]方向に跳ね返る
|
59
|
+
%block{:type => "#{category}_turn_xy"}
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
-# 時計回りに( )度回す
|
62
|
+
%block{:type => "#{category}_rotate_right"}
|
63
|
+
= toolbox_number_value('ANGLE', 15)
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
-# 反時計回りに( )度回す
|
66
|
+
%block{:type => "#{category}_rotate_left"}
|
67
|
+
= toolbox_number_value('ANGLE', 15)
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
-# ( )度に向ける
|
70
|
+
%block{:type => "#{category}_set_angle"}
|
71
|
+
= toolbox_number_value('ANGLE', 90)
|
71
72
|
|
72
|
-
|
73
|
-
|
73
|
+
-# マウスポインターへ向ける
|
74
|
+
%block{:type => "#{category}_point_towards_mouse"}
|
74
75
|
|
75
|
-
|
76
|
-
|
76
|
+
-# [▼]へ向ける
|
77
|
+
%block{:type => "#{category}_point_towards_character"}
|
77
78
|
|
78
|
-
|
79
|
-
|
79
|
+
-# 回転方法を[▼]にする
|
80
|
+
%block{:type => "#{category}_set_rotation_style"}
|
80
81
|
|
81
|
-
|
82
|
-
|
82
|
+
-# 変数:向き
|
83
|
+
%block{:type => "#{category}_self_angle"}
|
84
|
+
|
85
|
+
- category = 'hardware'
|
86
|
+
%category{:name => 'アクチュエータ'}
|
87
|
+
-#- subcategory = 'servo'
|
88
|
+
-# サーボ[▼ピン]を( )度(5~180)にする
|
89
|
+
-#%block{:type => "#{category}_#{subcategory}_set_position"}
|
90
|
+
= toolbox_number_value('POS', 90)
|
91
|
+
|
92
|
+
- subcategory = 'two_wheel_drive_car'
|
93
|
+
-# 2WD車[▼ピン]を( )秒[▼コマンド]
|
94
|
+
%block{:type => "#{category}_#{subcategory}_run"}
|
95
|
+
%field{:name => 'PIN'}<
|
96
|
+
D6
|
97
|
+
= toolbox_number_value('SEC', 1)
|
98
|
+
%value{:name => 'COMMAND'}
|
99
|
+
%block{:type => "#{category}_#{subcategory}_commands"}
|
100
|
+
|
101
|
+
-# [▼コマンド]
|
102
|
+
%block{:type => "#{category}_#{subcategory}_commands"}
|
103
|
+
%field{:name => 'COMMAND'}<
|
104
|
+
forward
|
105
|
+
|
106
|
+
-# 2WD車[▼ピン]を進める
|
107
|
+
%block{:type => "#{category}_#{subcategory}_forward"}
|
108
|
+
%field{:name => 'PIN'}<
|
109
|
+
D6
|
110
|
+
|
111
|
+
-# 2WD車[▼ピン]をバックさせる
|
112
|
+
%block{:type => "#{category}_#{subcategory}_backward"}
|
113
|
+
%field{:name => 'PIN'}<
|
114
|
+
D6
|
115
|
+
|
116
|
+
-# 2WD車[▼ピン]を左に曲げる
|
117
|
+
%block{:type => "#{category}_#{subcategory}_turn_left"}
|
118
|
+
%field{:name => 'PIN'}<
|
119
|
+
D6
|
120
|
+
|
121
|
+
-# 2WD車[▼ピン]を右に曲げる
|
122
|
+
%block{:type => "#{category}_#{subcategory}_turn_right"}
|
123
|
+
%field{:name => 'PIN'}<
|
124
|
+
D6
|
125
|
+
|
126
|
+
-# 2WD車[▼ピン]を止める
|
127
|
+
%block{:type => "#{category}_#{subcategory}_stop"}
|
128
|
+
%field{:name => 'PIN'}<
|
129
|
+
D6
|
83
130
|
|
84
131
|
- category = 'looks'
|
85
132
|
%category{:name => '見た目'}
|
@@ -124,6 +171,36 @@
|
|
124
171
|
-# [▼プリセット画像]
|
125
172
|
-#%block{:type => "#{category}_preset_images"}
|
126
173
|
|
174
|
+
- category = 'hardware'
|
175
|
+
- subcategory = 'led'
|
176
|
+
-# LED[▼ピン]をオンにする
|
177
|
+
%block{:type => "#{category}_#{subcategory}_on"}
|
178
|
+
|
179
|
+
-# LED[▼ピン]をオフにする
|
180
|
+
%block{:type => "#{category}_#{subcategory}_off"}
|
181
|
+
|
182
|
+
-#- subcategory = 'rgb_led'
|
183
|
+
-# RGB LED[▼アノード]コモン[▼ピン]を[カラー]にする
|
184
|
+
-#%block{:type => "#{category}_#{subcategory}_on"}
|
185
|
+
|
186
|
+
-# RGB LED[▼アノード]コモン[▼ピン]をオフにする
|
187
|
+
-#%block{:type => "#{category}_#{subcategory}_off"}
|
188
|
+
|
189
|
+
-#- subcategory = 'seven_segment_display'
|
190
|
+
-# 7セグディスプレイに[▼0-9]を表示する
|
191
|
+
-#%block{:type => "#{category}_#{subcategory}_show"}
|
192
|
+
|
193
|
+
-# 7セグディスプレイをオフにする
|
194
|
+
-#%block{:type => "#{category}_#{subcategory}_off"}
|
195
|
+
|
196
|
+
-#- subcategory = 'lcd'
|
197
|
+
-# LCDに( )を表示する
|
198
|
+
-#%block{:type => "#{category}_#{subcategory}_puts"}
|
199
|
+
= toolbox_text_value('TEXT', 'Hello')
|
200
|
+
|
201
|
+
-# LCDをクリアする
|
202
|
+
-#%block{:type => "#{category}_#{subcategory}_clear"}
|
203
|
+
|
127
204
|
- category = 'sound'
|
128
205
|
%category{:name => '音'}
|
129
206
|
-# [▼プリセット音声]の音を鳴らす
|
@@ -148,8 +225,11 @@
|
|
148
225
|
-# ペンの色を[カラー]にする
|
149
226
|
%block{:type => "#{category}_set_pen_color"}
|
150
227
|
|
228
|
+
%category{:name => 'データ'}
|
229
|
+
%category{:name => '変数', :custom => 'VARIABLE'}
|
230
|
+
|
151
231
|
- category = 'events'
|
152
|
-
%category{:name => '
|
232
|
+
%category{:name => 'イベント(~のとき)'}
|
153
233
|
-# まずは
|
154
234
|
%block{:type => "#{category}_on_start"}
|
155
235
|
|
@@ -163,44 +243,55 @@
|
|
163
243
|
-# [▼キャラクター]にぶつかったとき
|
164
244
|
%block{:type => "#{category}_on_hit"}
|
165
245
|
|
246
|
+
- category = 'hardware'
|
247
|
+
-# センサー[▼PIN]が変化したとき
|
248
|
+
%block{:type => "#{category}_on_sensor_change"}
|
249
|
+
|
250
|
+
-# ボタン[▼]を押したとき
|
251
|
+
-#%block{:type => "#{category}_on_button_down"}
|
252
|
+
|
253
|
+
-# ボタン[▼]を離したとき
|
254
|
+
-#%block{:type => "#{category}_on_button_up"}
|
255
|
+
|
166
256
|
- category = 'control'
|
167
|
-
%category{:name => '
|
168
|
-
|
169
|
-
|
257
|
+
%category{:name => '制御'}
|
258
|
+
%category{:name => '繰り返し'}
|
259
|
+
-# ずっと
|
260
|
+
%block{:type => "#{category}_loop"}
|
170
261
|
|
171
|
-
|
172
|
-
|
173
|
-
|
262
|
+
-# ( )回繰り返す
|
263
|
+
%block{:type => "#{category}_times"}
|
264
|
+
= toolbox_number_value('COUNT', 10)
|
174
265
|
|
175
|
-
|
176
|
-
|
266
|
+
-# < >まで繰り返す
|
267
|
+
%block{:type => "#{category}_until"}
|
177
268
|
|
178
|
-
|
179
|
-
|
269
|
+
-# 繰り返しから脱出する
|
270
|
+
%block{:type => "#{category}_break"}
|
180
271
|
|
181
|
-
|
182
|
-
|
272
|
+
-# 次の繰り返しにジャンプする
|
273
|
+
%block{:type => "#{category}_next"}
|
183
274
|
|
184
|
-
|
185
|
-
|
275
|
+
-# 現在の繰り返しをやり直す
|
276
|
+
%block{:type => "#{category}_redo"}
|
186
277
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
278
|
+
%category{:name => '待つ'}
|
279
|
+
-# ( )秒待つ
|
280
|
+
%block{:type => "#{category}_sleep"}
|
281
|
+
= toolbox_number_value('SEC', 1)
|
191
282
|
|
192
|
-
|
193
|
-
|
283
|
+
-# < >まで待つ
|
284
|
+
%block{:type => "#{category}_await_until"}
|
194
285
|
|
195
|
-
|
196
|
-
|
286
|
+
-# ほんの少し待つ
|
287
|
+
%block{:type => "#{category}_await"}
|
197
288
|
|
198
|
-
|
199
|
-
|
200
|
-
|
289
|
+
%category{:name => 'もし~なら'}
|
290
|
+
-# もし< >なら
|
291
|
+
%block{:type => "#{category}_if"}
|
201
292
|
|
202
|
-
|
203
|
-
|
293
|
+
-# もし< >なら~でなければ
|
294
|
+
%block{:type => "#{category}_if_else"}
|
204
295
|
|
205
296
|
- category = 'sensing'
|
206
297
|
%category{:name => '調べる'}
|
@@ -242,202 +333,118 @@
|
|
242
333
|
-# 変数:2000年からの日数
|
243
334
|
-#%block{:type => "#{category}_days_since_2000"}
|
244
335
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
%block{:type => "#{category}_add"}
|
249
|
-
|
250
|
-
-# 変数:( ) - ( )
|
251
|
-
%block{:type => "#{category}_minus"}
|
252
|
-
|
253
|
-
-# 変数:( ) * ( )
|
254
|
-
%block{:type => "#{category}_multiply"}
|
255
|
-
|
256
|
-
-# 変数:( ) / ( )
|
257
|
-
%block{:type => "#{category}_divide"}
|
258
|
-
|
259
|
-
-# 変数:( )から( )までの乱数
|
260
|
-
%block{:type => "#{category}_rand"}
|
261
|
-
= toolbox_number_value('A', 1)
|
262
|
-
= toolbox_number_value('B', 10)
|
263
|
-
|
264
|
-
-# 変数:( )を( )で割った余り
|
265
|
-
%block{:type => "#{category}_modulo"}
|
266
|
-
= toolbox_number_value('A', 5)
|
267
|
-
= toolbox_number_value('B', 2)
|
268
|
-
|
269
|
-
-# 変数:( )を丸める
|
270
|
-
%block{:type => "#{category}_round"}
|
271
|
-
= toolbox_number_value('A', 0.5)
|
272
|
-
|
273
|
-
-# 変数:( )の[▼数学関数]
|
274
|
-
%block{:type => "#{category}_math_method"}
|
275
|
-
= toolbox_number_value('NUM', 9)
|
276
|
-
%field{:name => 'METHOD'}<
|
277
|
-
Math.sqrt(%num%)
|
336
|
+
- category = 'hardware'
|
337
|
+
-# センサー[▼PIN]
|
338
|
+
%block{:type => "#{category}_sensor_value"}
|
278
339
|
|
279
|
-
-#
|
280
|
-
|
281
|
-
%field{:name => 'NUM'}<
|
282
|
-
0
|
340
|
+
-# 条件:ボタン[▼]を押している
|
341
|
+
-#%block{:type => "#{category}_button_down"}
|
283
342
|
|
284
|
-
|
285
|
-
|
286
|
-
%block{:type => "#{category}_index_of"}
|
287
|
-
= toolbox_text_value('A', 'あいうえお')
|
288
|
-
= toolbox_number_value('INDEX', 1)
|
343
|
+
-# 条件:ボタン[▼]を離している
|
344
|
+
-#%block{:type => "#{category}_button_up"}
|
289
345
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
%block{:type => 'text'}
|
296
|
-
%field{:name => 'TEXT'}<
|
297
|
-
文章
|
346
|
+
- category = 'operators'
|
347
|
+
%category{:name => '演算'}
|
348
|
+
%category{:name => '計算'}
|
349
|
+
-# 変数:( ) + ( )
|
350
|
+
%block{:type => "#{category}_add"}
|
298
351
|
|
299
|
-
|
300
|
-
|
301
|
-
%block{:type => "#{category}_compare_gt"}
|
352
|
+
-# 変数:( ) - ( )
|
353
|
+
%block{:type => "#{category}_minus"}
|
302
354
|
|
303
|
-
|
304
|
-
|
355
|
+
-# 変数:( ) * ( )
|
356
|
+
%block{:type => "#{category}_multiply"}
|
305
357
|
|
306
|
-
|
307
|
-
|
358
|
+
-# 変数:( ) / ( )
|
359
|
+
%block{:type => "#{category}_divide"}
|
308
360
|
|
309
|
-
|
310
|
-
|
361
|
+
-# 変数:( )から( )までの乱数
|
362
|
+
%block{:type => "#{category}_rand"}
|
363
|
+
= toolbox_number_value('A', 1)
|
364
|
+
= toolbox_number_value('B', 10)
|
311
365
|
|
312
|
-
|
313
|
-
|
366
|
+
-# 変数:( )を( )で割った余り
|
367
|
+
%block{:type => "#{category}_modulo"}
|
368
|
+
= toolbox_number_value('A', 5)
|
369
|
+
= toolbox_number_value('B', 2)
|
314
370
|
|
315
|
-
|
316
|
-
|
371
|
+
-# 変数:( )を丸める
|
372
|
+
%block{:type => "#{category}_round"}
|
373
|
+
= toolbox_number_value('A', 0.5)
|
317
374
|
|
318
|
-
|
319
|
-
|
375
|
+
-# 変数:( )の[▼数学関数]
|
376
|
+
%block{:type => "#{category}_math_method"}
|
377
|
+
= toolbox_number_value('NUM', 9)
|
378
|
+
%field{:name => 'METHOD'}<
|
379
|
+
Math.sqrt(%num%)
|
320
380
|
|
321
|
-
|
322
|
-
|
381
|
+
-# 数値
|
382
|
+
%block{:type => 'math_number'}
|
383
|
+
%field{:name => 'NUM'}<
|
384
|
+
0
|
323
385
|
|
324
|
-
|
325
|
-
|
386
|
+
%category{:name => '文字'}
|
387
|
+
-# 変数:( )の( )番目
|
388
|
+
%block{:type => "#{category}_index_of"}
|
389
|
+
= toolbox_text_value('A', 'あいうえお')
|
390
|
+
= toolbox_number_value('INDEX', 1)
|
326
391
|
|
327
|
-
|
328
|
-
|
392
|
+
-# 変数:( )の長さ
|
393
|
+
%block{:type => "#{category}_length"}
|
394
|
+
= toolbox_text_value('A', 'あいうえお')
|
329
395
|
|
330
|
-
|
396
|
+
-# テキスト
|
397
|
+
%block{:type => 'text'}
|
398
|
+
%field{:name => 'TEXT'}<
|
399
|
+
文章
|
331
400
|
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
%block{:type => "#{category}_statement"}
|
401
|
+
%category{:name => '条件'}
|
402
|
+
-# 条件:( ) < ( )
|
403
|
+
%block{:type => "#{category}_compare_gt"}
|
336
404
|
|
337
|
-
|
338
|
-
|
405
|
+
-# 条件:( ) <= ( )
|
406
|
+
%block{:type => "#{category}_compare_gte"}
|
339
407
|
|
340
|
-
|
341
|
-
|
408
|
+
-# 条件:( ) = ( )
|
409
|
+
%block{:type => "#{category}_compare_eq"}
|
342
410
|
|
343
|
-
|
344
|
-
|
411
|
+
-# 条件:( ) >= ( )
|
412
|
+
%block{:type => "#{category}_compare_lte"}
|
345
413
|
|
346
|
-
|
347
|
-
|
348
|
-
%category{:name => '準備'}
|
349
|
-
-# ハードウェアを準備する
|
350
|
-
%block{:type => "#{category}_init_hardware"}
|
414
|
+
-# 条件:( ) > ( )
|
415
|
+
%block{:type => "#{category}_compare_lt"}
|
351
416
|
|
352
|
-
|
353
|
-
%
|
354
|
-
-# LED[▼ピン]をオンにする
|
355
|
-
%block{:type => "#{category}_led_on"}
|
417
|
+
-# 条件:< > かつ < >
|
418
|
+
%block{:type => "#{category}_and"}
|
356
419
|
|
357
|
-
|
358
|
-
|
420
|
+
-# 条件:< > または < >
|
421
|
+
%block{:type => "#{category}_or"}
|
359
422
|
|
360
|
-
|
361
|
-
|
423
|
+
-# 条件:< > ではない
|
424
|
+
%block{:type => "#{category}_negate"}
|
362
425
|
|
363
|
-
|
364
|
-
|
426
|
+
-# 条件:真
|
427
|
+
%block{:type => "#{category}_true"}
|
365
428
|
|
366
|
-
|
367
|
-
|
429
|
+
-# 条件:偽
|
430
|
+
%block{:type => "#{category}_false"}
|
368
431
|
|
369
|
-
|
370
|
-
|
432
|
+
%category{:name => 'その他'}
|
433
|
+
- category = 'ruby'
|
434
|
+
%category{:name => 'Ruby'}
|
435
|
+
-# 文
|
436
|
+
%block{:type => "#{category}_statement"}
|
371
437
|
|
372
|
-
|
373
|
-
|
374
|
-
%block{:type => "#{category}_lcd_puts"}
|
375
|
-
= toolbox_text_value('TEXT', 'Hello')
|
438
|
+
-# 式
|
439
|
+
%block{:type => "#{category}_expression"}
|
376
440
|
|
377
|
-
|
378
|
-
|
441
|
+
-# コメント
|
442
|
+
%block{:type => "#{category}_comment"}
|
379
443
|
|
380
|
-
|
381
|
-
|
382
|
-
%block{:type => "#{category}_servo_set_position"}
|
383
|
-
= toolbox_number_value('POS', 90)
|
444
|
+
-# p
|
445
|
+
%block{:type => "#{category}_p"}
|
384
446
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
%field{:name => 'PIN'}<
|
390
|
-
D6
|
391
|
-
= toolbox_number_value('SEC', 1)
|
392
|
-
%value{:name => 'COMMAND'}
|
393
|
-
%block{:type => "#{category}_#{subcategory}_commands"}
|
394
|
-
|
395
|
-
-# [▼コマンド]
|
396
|
-
%block{:type => "#{category}_#{subcategory}_commands"}
|
397
|
-
%field{:name => 'COMMAND'}<
|
398
|
-
forward
|
399
|
-
|
400
|
-
-# 2WD車[▼ピン]を進める
|
401
|
-
%block{:type => "#{category}_#{subcategory}_forward"}
|
402
|
-
%field{:name => 'PIN'}<
|
403
|
-
D6
|
404
|
-
|
405
|
-
-# 2WD車[▼ピン]をバックさせる
|
406
|
-
%block{:type => "#{category}_#{subcategory}_backward"}
|
407
|
-
%field{:name => 'PIN'}<
|
408
|
-
D6
|
409
|
-
|
410
|
-
-# 2WD車[▼ピン]を左に曲げる
|
411
|
-
%block{:type => "#{category}_#{subcategory}_turn_left"}
|
412
|
-
%field{:name => 'PIN'}<
|
413
|
-
D6
|
414
|
-
|
415
|
-
-# 2WD車[▼ピン]を右に曲げる
|
416
|
-
%block{:type => "#{category}_#{subcategory}_turn_right"}
|
417
|
-
%field{:name => 'PIN'}<
|
418
|
-
D6
|
419
|
-
|
420
|
-
-# 2WD車[▼ピン]を止める
|
421
|
-
%block{:type => "#{category}_#{subcategory}_stop"}
|
422
|
-
%field{:name => 'PIN'}<
|
423
|
-
D6
|
424
|
-
|
425
|
-
%category{:name => 'センサー'}
|
426
|
-
-# センサー[▼PIN]
|
427
|
-
%block{:type => "#{category}_sensor_value"}
|
428
|
-
|
429
|
-
-# センサー[▼PIN]が変化したとき
|
430
|
-
%block{:type => "#{category}_on_sensor_change"}
|
431
|
-
|
432
|
-
-#%category{:name => 'ボタン'}
|
433
|
-
-# 条件:ボタン[▼]を押している
|
434
|
-
%block{:type => "#{category}_button_down"}
|
435
|
-
|
436
|
-
-# 条件:ボタン[▼]を離している
|
437
|
-
%block{:type => "#{category}_button_up"}
|
438
|
-
|
439
|
-
-# ボタン[▼]を押したとき
|
440
|
-
%block{:type => "#{category}_on_button_down"}
|
441
|
-
|
442
|
-
-# ボタン[▼]を離したとき
|
443
|
-
%block{:type => "#{category}_on_button_up"}
|
447
|
+
- category = 'hardware'
|
448
|
+
%category{:name => 'ハードウェア'}
|
449
|
+
-# ハードウェアを準備する
|
450
|
+
%block{:type => "#{category}_init_hardware"}
|
@@ -16,8 +16,8 @@
|
|
16
16
|
= link_to '', source_codes_download_path, id: 'download-link', style: 'display: none', 'data-method' => 'delete'
|
17
17
|
|
18
18
|
- if standalone?
|
19
|
-
%button#run-button{:class => "btn btn-
|
20
|
-
%i.icon-
|
19
|
+
%button#run-button{:class => "btn btn-success"}<
|
20
|
+
%i.icon-flag
|
21
21
|
実行
|
22
22
|
- else
|
23
23
|
%button#download-button{:class => "btn btn-primary"}<
|
@@ -122,6 +122,8 @@
|
|
122
122
|
#text-editor
|
123
123
|
|
124
124
|
= render 'signin_modal'
|
125
|
+
= render 'load_modal'
|
126
|
+
= render 'reset_modal'
|
125
127
|
|
126
128
|
- if raspberrypi?
|
127
129
|
%script{type: "text/javascript"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module SmalrubyEditor
|
2
|
-
VERSION = '0.1.
|
3
|
-
end
|
1
|
+
module SmalrubyEditor
|
2
|
+
VERSION = '0.1.20'
|
3
|
+
end
|