smalruby-editor 0.1.6-x86-mingw32 → 0.1.7-x86-mingw32

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.

Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/blocks/hardware.js.coffee.erb +40 -3
  3. data/app/assets/stylesheets/toolbox.css.scss.erb +1 -6
  4. data/app/controllers/source_codes_controller.rb +5 -1
  5. data/app/models/concerns/ruby_to_block/block/base.rb +251 -0
  6. data/app/models/concerns/ruby_to_block/block/character.rb +42 -0
  7. data/app/models/concerns/ruby_to_block/block/character_event.rb +27 -0
  8. data/app/models/concerns/ruby_to_block/block/character_method_call.rb +29 -0
  9. data/app/models/concerns/ruby_to_block/block/character_new.rb +7 -0
  10. data/app/models/concerns/ruby_to_block/block/character_operation.rb +80 -0
  11. data/app/models/concerns/ruby_to_block/block/control_if.rb +45 -0
  12. data/app/models/concerns/ruby_to_block/block/control_loop.rb +19 -0
  13. data/app/models/concerns/ruby_to_block/block/control_sleep.rb +18 -0
  14. data/app/models/concerns/ruby_to_block/block/do.rb +24 -0
  15. data/app/models/concerns/ruby_to_block/block/else.rb +12 -0
  16. data/app/models/concerns/ruby_to_block/block/end.rb +26 -0
  17. data/app/models/concerns/ruby_to_block/block/events_on_click.rb +14 -0
  18. data/app/models/concerns/ruby_to_block/block/events_on_key_push_or_down.rb +17 -0
  19. data/app/models/concerns/ruby_to_block/block/events_on_start.rb +14 -0
  20. data/app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb +14 -0
  21. data/app/models/concerns/ruby_to_block/block/hardware_led_off.rb +16 -0
  22. data/app/models/concerns/ruby_to_block/block/hardware_led_on.rb +16 -0
  23. data/app/models/concerns/ruby_to_block/block/hardware_on_sensor_change.rb +17 -0
  24. data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_off.rb +18 -0
  25. data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_on.rb +23 -0
  26. data/app/models/concerns/ruby_to_block/block/hardware_sensor_value.rb +23 -0
  27. data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb +26 -0
  28. data/app/models/concerns/ruby_to_block/block/looks_hide.rb +8 -0
  29. data/app/models/concerns/ruby_to_block/block/looks_say.rb +20 -0
  30. data/app/models/concerns/ruby_to_block/block/looks_show.rb +8 -0
  31. data/app/models/concerns/ruby_to_block/block/looks_vanish.rb +8 -0
  32. data/app/models/concerns/ruby_to_block/block/math_number.rb +14 -0
  33. data/app/models/concerns/ruby_to_block/block/motion_change_x_by.rb +20 -0
  34. data/app/models/concerns/ruby_to_block/block/motion_change_y_by.rb +20 -0
  35. data/app/models/concerns/ruby_to_block/block/motion_move.rb +15 -0
  36. data/app/models/concerns/ruby_to_block/block/motion_point_towards_character.rb +24 -0
  37. data/app/models/concerns/ruby_to_block/block/motion_point_towards_mouse.rb +9 -0
  38. data/app/models/concerns/ruby_to_block/block/motion_reach_wall.rb +24 -0
  39. data/app/models/concerns/ruby_to_block/block/motion_rotate_left.rb +20 -0
  40. data/app/models/concerns/ruby_to_block/block/motion_rotate_right.rb +20 -0
  41. data/app/models/concerns/ruby_to_block/block/motion_self_angle.rb +23 -0
  42. data/app/models/concerns/ruby_to_block/block/motion_self_x.rb +23 -0
  43. data/app/models/concerns/ruby_to_block/block/motion_self_y.rb +23 -0
  44. data/app/models/concerns/ruby_to_block/block/motion_set_angle.rb +15 -0
  45. data/app/models/concerns/ruby_to_block/block/motion_set_x.rb +38 -0
  46. data/app/models/concerns/ruby_to_block/block/motion_set_y.rb +15 -0
  47. data/app/models/concerns/ruby_to_block/block/motion_turn.rb +8 -0
  48. data/app/models/concerns/ruby_to_block/block/motion_turn_if_reach_wall.rb +8 -0
  49. data/app/models/concerns/ruby_to_block/block/null.rb +17 -0
  50. data/app/models/concerns/ruby_to_block/block/operators_compare.rb +36 -0
  51. data/app/models/concerns/ruby_to_block/block/operators_false.rb +8 -0
  52. data/app/models/concerns/ruby_to_block/block/operators_true.rb +8 -0
  53. data/app/models/concerns/ruby_to_block/block/require_smalruby.rb +7 -0
  54. data/app/models/concerns/ruby_to_block/block/ruby_comment.rb +16 -0
  55. data/app/models/concerns/ruby_to_block/block/ruby_expression.rb +14 -0
  56. data/app/models/concerns/ruby_to_block/block/ruby_statement.rb +23 -0
  57. data/app/models/concerns/ruby_to_block/block/sensing_hit.rb +23 -0
  58. data/app/models/concerns/ruby_to_block/block/sound_play.rb +15 -0
  59. data/app/models/concerns/ruby_to_block/block/sound_preset_sounds.rb +31 -0
  60. data/app/models/concerns/ruby_to_block/block/text.rb +15 -0
  61. data/app/models/concerns/ruby_to_block/block/value.rb +12 -0
  62. data/app/models/concerns/ruby_to_block/block.rb +97 -0
  63. data/app/models/concerns/ruby_to_block/context.rb +97 -0
  64. data/app/models/concerns/ruby_to_block/formatter.rb +26 -0
  65. data/app/models/concerns/ruby_to_block.rb +17 -360
  66. data/app/models/source_code.rb +3 -1
  67. data/app/views/editor/_toolbox.html.haml +16 -0
  68. data/lib/smalruby_editor/version.rb +3 -3
  69. data/public/assets/{application-64a390efe879c386a5950515064f062d.css → application-28b7bed56c5389dfa372e972c75b6676.css} +17 -10
  70. data/public/assets/application-28b7bed56c5389dfa372e972c75b6676.css.gz +0 -0
  71. data/public/assets/{application-8bfffad1222d4e198f3c7ccc1cbd774f.js → application-4f747690ebc8ec4815ae36021fdb2c44.js} +135 -0
  72. data/public/assets/{application-8bfffad1222d4e198f3c7ccc1cbd774f.js.gz → application-4f747690ebc8ec4815ae36021fdb2c44.js.gz} +0 -0
  73. data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
  74. data/smalruby-editor.gemspec +1 -1
  75. data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature +69 -0
  76. data/spec/acceptance/ruby_mode/translate.feature +1 -1
  77. data/spec/controllers/source_codes_controller_spec.rb +14 -11
  78. data/spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb +175 -0
  79. data/spec/models/concerns/ruby_to_block/block/control_if_spec.rb +75 -0
  80. data/spec/models/concerns/ruby_to_block/block/control_loop_spec.rb +68 -0
  81. data/spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb +120 -0
  82. data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +120 -0
  83. data/spec/models/concerns/ruby_to_block/block/looks_say_spec.rb +79 -0
  84. data/spec/models/concerns/ruby_to_block/block/looks_spec.rb +74 -0
  85. data/spec/models/concerns/ruby_to_block/block/motion_move_spec.rb +63 -0
  86. data/spec/models/concerns/ruby_to_block/block/motion_reach_wall_spec.rb +67 -0
  87. data/spec/models/concerns/ruby_to_block/block/motion_spec.rb +392 -0
  88. data/spec/models/concerns/ruby_to_block/block/motion_turn_spec.rb +54 -0
  89. data/spec/models/concerns/ruby_to_block/block/require_smalruby_spec.rb +39 -0
  90. data/spec/models/concerns/ruby_to_block/block/ruby_comment_spec.rb +55 -0
  91. data/spec/models/concerns/ruby_to_block/block/ruby_statement_spec.rb +113 -0
  92. data/spec/models/concerns/ruby_to_block/block/shared/block_examples.rb +44 -0
  93. data/spec/models/concerns/ruby_to_block/block/sound_spec.rb +46 -0
  94. data/spec/models/concerns/ruby_to_block/block_spec.rb +49 -0
  95. data/spec/models/concerns/ruby_to_block_spec.rb +421 -217
  96. data/spec/support/ruby_to_block.rb +10 -0
  97. metadata +108 -10
  98. data/public/assets/application-64a390efe879c386a5950515064f062d.css.gz +0 -0
@@ -0,0 +1,10 @@
1
+ def compact_source_code(source_code)
2
+ s = source_code.lines.map(&:strip).reject(&:empty?).join(';')
3
+ max_length = 240
4
+ if s.length > max_length
5
+ center = s.length / 2
6
+ "...#{s[(center - max_length / 2)...(center + max_length / 2)]}..."
7
+ else
8
+ s
9
+ end
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-27 00:00:00.000000000 Z
11
+ date: 2014-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: smalruby
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - '>='
185
+ - - ~>
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: 0.0.15
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - '>='
192
+ - - ~>
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: 0.0.15
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: bundler
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -289,6 +289,66 @@ files:
289
289
  - app/models/.keep
290
290
  - app/models/concerns/.keep
291
291
  - app/models/concerns/ruby_to_block.rb
292
+ - app/models/concerns/ruby_to_block/block.rb
293
+ - app/models/concerns/ruby_to_block/block/base.rb
294
+ - app/models/concerns/ruby_to_block/block/character.rb
295
+ - app/models/concerns/ruby_to_block/block/character_event.rb
296
+ - app/models/concerns/ruby_to_block/block/character_method_call.rb
297
+ - app/models/concerns/ruby_to_block/block/character_new.rb
298
+ - app/models/concerns/ruby_to_block/block/character_operation.rb
299
+ - app/models/concerns/ruby_to_block/block/control_if.rb
300
+ - app/models/concerns/ruby_to_block/block/control_loop.rb
301
+ - app/models/concerns/ruby_to_block/block/control_sleep.rb
302
+ - app/models/concerns/ruby_to_block/block/do.rb
303
+ - app/models/concerns/ruby_to_block/block/else.rb
304
+ - app/models/concerns/ruby_to_block/block/end.rb
305
+ - app/models/concerns/ruby_to_block/block/events_on_click.rb
306
+ - app/models/concerns/ruby_to_block/block/events_on_key_push_or_down.rb
307
+ - app/models/concerns/ruby_to_block/block/events_on_start.rb
308
+ - app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb
309
+ - app/models/concerns/ruby_to_block/block/hardware_led_off.rb
310
+ - app/models/concerns/ruby_to_block/block/hardware_led_on.rb
311
+ - app/models/concerns/ruby_to_block/block/hardware_on_sensor_change.rb
312
+ - app/models/concerns/ruby_to_block/block/hardware_rgb_led_off.rb
313
+ - app/models/concerns/ruby_to_block/block/hardware_rgb_led_on.rb
314
+ - app/models/concerns/ruby_to_block/block/hardware_sensor_value.rb
315
+ - app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb
316
+ - app/models/concerns/ruby_to_block/block/looks_hide.rb
317
+ - app/models/concerns/ruby_to_block/block/looks_say.rb
318
+ - app/models/concerns/ruby_to_block/block/looks_show.rb
319
+ - app/models/concerns/ruby_to_block/block/looks_vanish.rb
320
+ - app/models/concerns/ruby_to_block/block/math_number.rb
321
+ - app/models/concerns/ruby_to_block/block/motion_change_x_by.rb
322
+ - app/models/concerns/ruby_to_block/block/motion_change_y_by.rb
323
+ - app/models/concerns/ruby_to_block/block/motion_move.rb
324
+ - app/models/concerns/ruby_to_block/block/motion_point_towards_character.rb
325
+ - app/models/concerns/ruby_to_block/block/motion_point_towards_mouse.rb
326
+ - app/models/concerns/ruby_to_block/block/motion_reach_wall.rb
327
+ - app/models/concerns/ruby_to_block/block/motion_rotate_left.rb
328
+ - app/models/concerns/ruby_to_block/block/motion_rotate_right.rb
329
+ - app/models/concerns/ruby_to_block/block/motion_self_angle.rb
330
+ - app/models/concerns/ruby_to_block/block/motion_self_x.rb
331
+ - app/models/concerns/ruby_to_block/block/motion_self_y.rb
332
+ - app/models/concerns/ruby_to_block/block/motion_set_angle.rb
333
+ - app/models/concerns/ruby_to_block/block/motion_set_x.rb
334
+ - app/models/concerns/ruby_to_block/block/motion_set_y.rb
335
+ - app/models/concerns/ruby_to_block/block/motion_turn.rb
336
+ - app/models/concerns/ruby_to_block/block/motion_turn_if_reach_wall.rb
337
+ - app/models/concerns/ruby_to_block/block/null.rb
338
+ - app/models/concerns/ruby_to_block/block/operators_compare.rb
339
+ - app/models/concerns/ruby_to_block/block/operators_false.rb
340
+ - app/models/concerns/ruby_to_block/block/operators_true.rb
341
+ - app/models/concerns/ruby_to_block/block/require_smalruby.rb
342
+ - app/models/concerns/ruby_to_block/block/ruby_comment.rb
343
+ - app/models/concerns/ruby_to_block/block/ruby_expression.rb
344
+ - app/models/concerns/ruby_to_block/block/ruby_statement.rb
345
+ - app/models/concerns/ruby_to_block/block/sensing_hit.rb
346
+ - app/models/concerns/ruby_to_block/block/sound_play.rb
347
+ - app/models/concerns/ruby_to_block/block/sound_preset_sounds.rb
348
+ - app/models/concerns/ruby_to_block/block/text.rb
349
+ - app/models/concerns/ruby_to_block/block/value.rb
350
+ - app/models/concerns/ruby_to_block/context.rb
351
+ - app/models/concerns/ruby_to_block/formatter.rb
292
352
  - app/models/source_code.rb
293
353
  - app/views/editor/_block_tab.html.haml
294
354
  - app/views/editor/_character_modal.html.haml
@@ -413,6 +473,7 @@ files:
413
473
  - spec/acceptance/block_mode/blocks/hardware/rgb_led_on.feature
414
474
  - spec/acceptance/block_mode/blocks/hardware/sensor_value.feature
415
475
  - spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature
476
+ - spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature
416
477
  - spec/acceptance/block_mode/blocks/looks/hide.feature
417
478
  - spec/acceptance/block_mode/blocks/looks/say.feature
418
479
  - spec/acceptance/block_mode/blocks/looks/show.feature
@@ -472,6 +533,23 @@ files:
472
533
  - spec/javascripts/models/scene_spec.coffee
473
534
  - spec/javascripts/spec_helper.js
474
535
  - spec/lib/smalruby_editor_spec.rb
536
+ - spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb
537
+ - spec/models/concerns/ruby_to_block/block/control_if_spec.rb
538
+ - spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
539
+ - spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb
540
+ - spec/models/concerns/ruby_to_block/block/hardware_spec.rb
541
+ - spec/models/concerns/ruby_to_block/block/looks_say_spec.rb
542
+ - spec/models/concerns/ruby_to_block/block/looks_spec.rb
543
+ - spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
544
+ - spec/models/concerns/ruby_to_block/block/motion_reach_wall_spec.rb
545
+ - spec/models/concerns/ruby_to_block/block/motion_spec.rb
546
+ - spec/models/concerns/ruby_to_block/block/motion_turn_spec.rb
547
+ - spec/models/concerns/ruby_to_block/block/require_smalruby_spec.rb
548
+ - spec/models/concerns/ruby_to_block/block/ruby_comment_spec.rb
549
+ - spec/models/concerns/ruby_to_block/block/ruby_statement_spec.rb
550
+ - spec/models/concerns/ruby_to_block/block/shared/block_examples.rb
551
+ - spec/models/concerns/ruby_to_block/block/sound_spec.rb
552
+ - spec/models/concerns/ruby_to_block/block_spec.rb
475
553
  - spec/models/concerns/ruby_to_block_spec.rb
476
554
  - spec/models/source_code_spec.rb
477
555
  - spec/spec_helper.rb
@@ -482,6 +560,7 @@ files:
482
560
  - spec/steps/text_editor_steps.rb
483
561
  - spec/support/capybara.rb
484
562
  - spec/support/env.rb
563
+ - spec/support/ruby_to_block.rb
485
564
  - spec/teaspoon_env.rb
486
565
  - spec/turnip_helper.rb
487
566
  - vendor/assets/javascripts/.keep
@@ -490,10 +569,10 @@ files:
490
569
  - vendor/assets/javascripts/blockly/msg/js/ja.js
491
570
  - vendor/assets/javascripts/jquery.blockUI.js
492
571
  - vendor/assets/stylesheets/.keep
493
- - public/assets/application-64a390efe879c386a5950515064f062d.css
494
- - public/assets/application-64a390efe879c386a5950515064f062d.css.gz
495
- - public/assets/application-8bfffad1222d4e198f3c7ccc1cbd774f.js
496
- - public/assets/application-8bfffad1222d4e198f3c7ccc1cbd774f.js.gz
572
+ - public/assets/application-28b7bed56c5389dfa372e972c75b6676.css
573
+ - public/assets/application-28b7bed56c5389dfa372e972c75b6676.css.gz
574
+ - public/assets/application-4f747690ebc8ec4815ae36021fdb2c44.js
575
+ - public/assets/application-4f747690ebc8ec4815ae36021fdb2c44.js.gz
497
576
  - public/assets/favicon-a37c90b368fd8ed436cb8f9e9396465c.ico
498
577
  - public/assets/jquery-ui/animated-overlay-c48c87b7a95316f4698484e3b85ee4aa.gif
499
578
  - public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-58b63faadd031ca3db096dfdffd90224.png
@@ -567,6 +646,7 @@ test_files:
567
646
  - spec/acceptance/block_mode/blocks/hardware/rgb_led_on.feature
568
647
  - spec/acceptance/block_mode/blocks/hardware/sensor_value.feature
569
648
  - spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature
649
+ - spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature
570
650
  - spec/acceptance/block_mode/blocks/looks/hide.feature
571
651
  - spec/acceptance/block_mode/blocks/looks/say.feature
572
652
  - spec/acceptance/block_mode/blocks/looks/show.feature
@@ -626,6 +706,23 @@ test_files:
626
706
  - spec/javascripts/models/scene_spec.coffee
627
707
  - spec/javascripts/spec_helper.js
628
708
  - spec/lib/smalruby_editor_spec.rb
709
+ - spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb
710
+ - spec/models/concerns/ruby_to_block/block/control_if_spec.rb
711
+ - spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
712
+ - spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb
713
+ - spec/models/concerns/ruby_to_block/block/hardware_spec.rb
714
+ - spec/models/concerns/ruby_to_block/block/looks_say_spec.rb
715
+ - spec/models/concerns/ruby_to_block/block/looks_spec.rb
716
+ - spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
717
+ - spec/models/concerns/ruby_to_block/block/motion_reach_wall_spec.rb
718
+ - spec/models/concerns/ruby_to_block/block/motion_spec.rb
719
+ - spec/models/concerns/ruby_to_block/block/motion_turn_spec.rb
720
+ - spec/models/concerns/ruby_to_block/block/require_smalruby_spec.rb
721
+ - spec/models/concerns/ruby_to_block/block/ruby_comment_spec.rb
722
+ - spec/models/concerns/ruby_to_block/block/ruby_statement_spec.rb
723
+ - spec/models/concerns/ruby_to_block/block/shared/block_examples.rb
724
+ - spec/models/concerns/ruby_to_block/block/sound_spec.rb
725
+ - spec/models/concerns/ruby_to_block/block_spec.rb
629
726
  - spec/models/concerns/ruby_to_block_spec.rb
630
727
  - spec/models/source_code_spec.rb
631
728
  - spec/spec_helper.rb
@@ -636,5 +733,6 @@ test_files:
636
733
  - spec/steps/text_editor_steps.rb
637
734
  - spec/support/capybara.rb
638
735
  - spec/support/env.rb
736
+ - spec/support/ruby_to_block.rb
639
737
  - spec/teaspoon_env.rb
640
738
  - spec/turnip_helper.rb