smalruby-editor 0.1.22-x86-mingw32 → 0.1.23-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.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.rubocop.yml +0 -0
- data/.ruby-version +1 -1
- data/.simplecov +0 -0
- data/.travis.yml +1 -1
- data/LEGAL +0 -0
- data/LICENSE +0 -0
- data/Procfile +0 -0
- data/README.rdoc +1 -0
- data/Rakefile +0 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/application.js +0 -1
- data/app/assets/javascripts/blocks/blockly.js.coffee.erb +0 -0
- data/app/assets/javascripts/blocks/character.js.coffee.erb +0 -0
- data/app/assets/javascripts/blocks/control.js.coffee.erb +16 -19
- data/app/assets/javascripts/blocks/data.js.coffee.erb +0 -0
- data/app/assets/javascripts/blocks/etc.js.coffee.erb +0 -0
- data/app/assets/javascripts/blocks/events.js.coffee.erb +8 -6
- data/app/assets/javascripts/blocks/field_character.js.coffee.erb +6 -1
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +117 -167
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +14 -16
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +46 -47
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +54 -57
- data/app/assets/javascripts/blocks/pen.js.coffee.erb +5 -9
- data/app/assets/javascripts/blocks/ruby.js.coffee.erb +4 -3
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +53 -48
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +12 -10
- data/app/assets/javascripts/collections/.keep +0 -0
- data/app/assets/javascripts/collections/character_set.js.coffee +0 -0
- data/app/assets/javascripts/fix_blockly.js +74 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +0 -0
- data/app/assets/javascripts/models/.keep +0 -0
- data/app/assets/javascripts/models/character.js.coffee +0 -0
- data/app/assets/javascripts/models/scene.js.coffee +0 -0
- data/app/assets/javascripts/models/source_code.js.coffee +0 -0
- data/app/assets/javascripts/msg/en_us.js +236 -0
- data/app/assets/javascripts/msg/ja.js +237 -0
- data/app/assets/javascripts/routers/.keep +0 -0
- data/app/assets/javascripts/smalruby.js.coffee +8 -0
- data/app/assets/javascripts/views/.keep +0 -0
- data/app/assets/javascripts/views/character_modal_view.js.coffee +0 -0
- data/app/assets/javascripts/views/character_selector_view.js.coffee +0 -0
- data/app/assets/javascripts/views/load_modal_view.js.coffee +0 -0
- data/app/assets/javascripts/views/{main_menu_view.js.coffee → main_menu_view.js.coffee.erb} +19 -18
- data/app/assets/javascripts/views/reset_modal_view.js.coffee +0 -0
- data/app/assets/javascripts/views/signin_modal_view.js.coffee +0 -0
- data/app/assets/stylesheets/application.css +0 -0
- data/app/assets/stylesheets/editor.css.scss +4 -0
- data/app/assets/stylesheets/flatstrap-custom.css.scss +0 -0
- data/app/assets/stylesheets/load-modal.css.scss +0 -0
- data/app/assets/stylesheets/toolbox.css.scss.erb +0 -0
- data/app/assets/templates/.keep +0 -0
- data/app/controllers/application_controller.rb +16 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/editor_controller.rb +0 -0
- data/app/controllers/sessions_controller.rb +0 -0
- data/app/controllers/source_codes_controller.rb +0 -0
- data/app/helpers/application_helper.rb +11 -0
- data/app/helpers/editor_helper.rb +0 -0
- data/app/helpers/sessions_helper.rb +0 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/concerns/ruby_to_block.rb +0 -0
- data/app/models/concerns/ruby_to_block/block.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/base.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/character.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/character_event.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/character_method_call.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/character_new.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/character_operation.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/control_beark.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/control_if.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/control_loop.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/control_sleep.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/do.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/else.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/end.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/events_on_click.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/events_on_key_push_or_down.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/events_on_start.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_button_not_use_pullup.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_led_off.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_led_on.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_set_speed.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_speed.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_on_button_down_or_up.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_on_sensor_change.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_operation.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_off.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_on.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_sensor_value.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_commands.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_run.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_set_speed.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_speed.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/looks_hide.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/looks_say.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/looks_show.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/looks_vanish.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/math_number.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_change_x_by.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_change_y_by.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_go_to_character.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_go_to_mouse.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_move.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_point_towards_character.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_point_towards_mouse.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_rotate_left.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_rotate_right.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_self_angle.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_self_x.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_self_y.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_set_angle.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_set_rotation_style.rb +17 -0
- data/app/models/concerns/ruby_to_block/block/motion_set_x.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_set_x_y.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_set_y.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn_if_reach_wall.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn_xy.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/null.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/operators_compare.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/operators_false.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/operators_true.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/require_smalruby.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/ruby_comment.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/ruby_expression.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/ruby_p.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/ruby_statement.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/sensing_hit.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/sensing_reach_wall.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/sound_play.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/sound_preset_sounds.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/text.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/value.rb +0 -0
- data/app/models/concerns/ruby_to_block/context.rb +0 -0
- data/app/models/concerns/ruby_to_block/formatter.rb +0 -0
- data/app/models/source_code.rb +0 -0
- data/app/views/editor/_block_tab.html.haml +4 -4
- data/app/views/editor/_character_modal.html.haml +7 -7
- data/app/views/editor/_load_modal.html.haml +6 -6
- data/app/views/editor/_reset_modal.html.haml +0 -0
- data/app/views/editor/_signin_modal.html.haml +0 -0
- data/app/views/editor/_toolbox.html.haml +39 -39
- data/app/views/editor/demo.html.erb +0 -0
- data/app/views/editor/index.html.haml +18 -18
- data/app/views/layouts/application.html.erb +2 -0
- data/bin/bundle +0 -0
- data/bin/rails +0 -0
- data/bin/rake +0 -0
- data/bin/smalruby-editor +0 -0
- data/config.ru +0 -0
- data/config/application.rb +1 -1
- data/config/boot.rb +0 -0
- data/config/database.yml.mysql2 +0 -0
- data/config/database.yml.sqlite3 +0 -0
- data/config/database.yml.travis +0 -0
- data/config/environment.rb +0 -0
- data/config/environments/development.rb +0 -0
- data/config/environments/production.rb +4 -1
- data/config/environments/standalone.rb +0 -0
- data/config/environments/test.rb +0 -0
- data/config/initializers/backtrace_silencers.rb +0 -0
- data/config/initializers/filter_parameter_logging.rb +0 -0
- data/config/initializers/inflections.rb +0 -0
- data/config/initializers/mime_types.rb +0 -0
- data/config/initializers/secret_token.rb +0 -0
- data/config/initializers/session_store.rb +0 -0
- data/config/initializers/teaspoon.rb +0 -0
- data/config/initializers/wrap_parameters.rb +0 -0
- data/config/locales/en.yml +64 -22
- data/config/locales/ja.yml +65 -0
- data/config/routes.rb +3 -1
- data/config/unicorn.rb +0 -0
- data/db/migrate/20131216121603_create_source_codes.rb +0 -0
- data/db/migrate/20131219045113_add_filename_to_source_code.rb +0 -0
- data/db/schema.rb +0 -0
- data/db/seeds.rb +0 -0
- data/demos/adjust_2wd_car.rb.xml +0 -0
- data/demos/car_chase.rb.xml +0 -0
- data/demos/hardware_led.rb.xml +0 -0
- data/demos/pong.rb.xml +0 -0
- data/demos/star.rb.xml +0 -0
- data/lib/assets/.keep +0 -0
- data/lib/smalruby_editor.rb +0 -0
- data/lib/smalruby_editor/blockly_message_helper.rb +20 -0
- data/lib/smalruby_editor/version.rb +1 -1
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/gem.rake +1 -3
- data/lib/tasks/release.rake +0 -0
- data/lib/tasks/rspec.rake +0 -0
- data/lib/tasks/rubocop.rake +0 -0
- data/log/.keep +0 -0
- data/public/404.html +0 -0
- data/public/422.html +0 -0
- data/public/500.html +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/blockly/media/1x1.gif +0 -0
- data/public/blockly/media/click.mp3 +0 -0
- data/public/blockly/media/click.ogg +0 -0
- data/public/blockly/media/click.wav +0 -0
- data/public/blockly/media/delete.mp3 +0 -0
- data/public/blockly/media/delete.ogg +0 -0
- data/public/blockly/media/delete.wav +0 -0
- data/public/blockly/media/handclosed.cur +0 -0
- data/public/blockly/media/handopen.cur +0 -0
- data/public/blockly/media/quote0.png +0 -0
- data/public/blockly/media/quote1.png +0 -0
- data/public/blockly/media/trashbody.png +0 -0
- data/public/blockly/media/trashlid.png +0 -0
- data/public/blockly/media/tree.png +0 -0
- data/public/browserconfig.xml +0 -0
- data/public/fonts/FontAwesome.otf +0 -0
- data/public/fonts/fontawesome-webfont.eot +0 -0
- data/public/fonts/fontawesome-webfont.ttf +0 -0
- data/public/fonts/fontawesome-webfont.woff +0 -0
- data/public/large.png +0 -0
- data/public/robots.txt +0 -0
- data/public/smalruby/assets/ball1.png +0 -0
- data/public/smalruby/assets/ball2.png +0 -0
- data/public/smalruby/assets/ball3.png +0 -0
- data/public/smalruby/assets/ball4.png +0 -0
- data/public/smalruby/assets/ball5.png +0 -0
- data/public/smalruby/assets/ball6.png +0 -0
- data/public/smalruby/assets/car1.png +0 -0
- data/public/smalruby/assets/car2.png +0 -0
- data/public/smalruby/assets/car3.png +0 -0
- data/public/smalruby/assets/car4.png +0 -0
- data/public/smalruby/assets/cat1.png +0 -0
- data/public/smalruby/assets/cat2.png +0 -0
- data/public/smalruby/assets/cat3.png +0 -0
- data/public/smalruby/assets/frog1.png +0 -0
- data/public/smalruby/assets/piano_do.wav +0 -0
- data/public/smalruby/assets/piano_do_2.wav +0 -0
- data/public/smalruby/assets/piano_fa.wav +0 -0
- data/public/smalruby/assets/piano_mi.wav +0 -0
- data/public/smalruby/assets/piano_ra.wav +0 -0
- data/public/smalruby/assets/piano_re.wav +0 -0
- data/public/smalruby/assets/piano_si.wav +0 -0
- data/public/smalruby/assets/piano_so.wav +0 -0
- data/public/smalruby/assets/ryu1.png +0 -0
- data/public/smalruby/assets/ryu2.png +0 -0
- data/public/smalruby/assets/taichi1.png +0 -0
- data/public/smalruby/assets/taichi2.png +0 -0
- data/public/square.png +0 -0
- data/public/tiny.png +0 -0
- data/public/wide.png +0 -0
- data/smalruby-editor.gemspec +1 -1
- data/spec/acceptance/base.feature +0 -0
- data/spec/acceptance/block_mode/blocks/character/new.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/await.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/break.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/if.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/if_else.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/loop.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/next.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/redo.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/sleep.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/times.feature +0 -0
- data/spec/acceptance/block_mode/blocks/control/until.feature +0 -0
- data/spec/acceptance/block_mode/blocks/events/on_click.feature +0 -0
- data/spec/acceptance/block_mode/blocks/events/on_hit.feature +0 -0
- data/spec/acceptance/block_mode/blocks/events/on_key_push_or_down.feature +0 -0
- data/spec/acceptance/block_mode/blocks/events/on_start.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/button_down_or_up.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/button_not_use_pullup.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/led_off.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/led_on.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/on_button_down_or_up.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/on_sensor_change.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_off.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_on.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/sensor_value.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature +0 -0
- data/spec/acceptance/block_mode/blocks/looks/hide.feature +0 -0
- data/spec/acceptance/block_mode/blocks/looks/say.feature +0 -0
- data/spec/acceptance/block_mode/blocks/looks/show.feature +0 -0
- data/spec/acceptance/block_mode/blocks/looks/vanish.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/change_x_by.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/change_y_by.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/move.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/reach_wall.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/rotate_left.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/rotate_right.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/self_angle.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/self_x.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/self_y.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/set_angle.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/set_x.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/set_x_y.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/set_y.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/turn.feature +0 -0
- data/spec/acceptance/block_mode/blocks/motion/turn_if_reach_wall.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/and_or.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/four_arithmetic_and_compares.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/index_of.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/length.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/math_method.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/negate.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/rand.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/round.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/text.feature +0 -0
- data/spec/acceptance/block_mode/blocks/operators/true_false.feature +0 -0
- data/spec/acceptance/block_mode/blocks/ruby/expression.feature +0 -0
- data/spec/acceptance/block_mode/blocks/ruby/p.feature +0 -0
- data/spec/acceptance/block_mode/blocks/ruby/statement_comment.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/character_property.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/hit.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_key_push_or_down.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_x.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_y.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_push_or_down.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/reach_wall.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sensing/time_now.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sound/play.feature +0 -0
- data/spec/acceptance/block_mode/demo.feature +0 -0
- data/spec/acceptance/block_mode/translate.feature +0 -0
- data/spec/acceptance/readme.md +0 -0
- data/spec/acceptance/ruby_mode/check.feature +0 -0
- data/spec/acceptance/ruby_mode/download.feature +0 -0
- data/spec/acceptance/ruby_mode/load.feature +0 -0
- data/spec/acceptance/ruby_mode/translate.feature +0 -0
- data/spec/acceptance/standalone/run.feature +0 -0
- data/spec/acceptance/standalone/save.feature +0 -0
- data/spec/acceptance/standalone/signin.feature +0 -0
- data/spec/controllers/editor_controller_spec.rb +0 -0
- data/spec/controllers/sessions_controller_spec.rb +0 -0
- data/spec/controllers/source_codes_controller_spec.rb +0 -0
- data/spec/fixtures/files/01.rb +0 -0
- data/spec/fixtures/files/01.rb.xml +0 -0
- data/spec/fixtures/files/01_remix.rb +0 -0
- data/spec/fixtures/files/01_remix02.rb +0 -0
- data/spec/fixtures/files/01_remix10.rb.xml +0 -0
- data/spec/fixtures/files/favicon.ico +0 -0
- data/spec/helpers/editor_helper_spec.rb +0 -0
- data/spec/helpers/sessions_helper_spec.rb +0 -0
- data/spec/javascripts/collections/character_set_spec.coffee +0 -0
- data/spec/javascripts/models/character_spec.coffee +0 -0
- data/spec/javascripts/models/scene_spec.coffee +0 -0
- data/spec/javascripts/models/source_code_spec.coffee +0 -0
- data/spec/javascripts/spec_helper.js +0 -0
- data/spec/lib/smalruby_editor_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/control_if_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/control_loop_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/looks_say_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/looks_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/motion_move_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/motion_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/motion_turn_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/motion_turn_xy_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/require_smalruby_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/ruby_comment_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/ruby_statement_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/sensing_reach_wall_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/shared/block_examples.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/sound_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block/text_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block/block_spec.rb +0 -0
- data/spec/models/concerns/ruby_to_block_spec.rb +0 -0
- data/spec/models/source_code_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/steps/base_steps.rb +1 -0
- data/spec/steps/block_mode_steps.rb +0 -0
- data/spec/steps/fix_turnip.rb +0 -0
- data/spec/steps/global_variable.rb +0 -0
- data/spec/steps/text_editor_steps.rb +0 -0
- data/spec/support/capybara.rb +0 -0
- data/spec/support/env.rb +0 -0
- data/spec/support/ruby_to_block.rb +0 -0
- data/spec/teaspoon_env.rb +0 -0
- data/spec/turnip_helper.rb +0 -0
- data/vendor/assets/javascripts/.keep +0 -0
- data/vendor/assets/javascripts/blockly/blockly_compressed.js +0 -0
- data/vendor/assets/javascripts/blockly/blocks_compressed.js +0 -0
- data/vendor/assets/javascripts/blockly/msg/js/en_us.js +507 -0
- data/vendor/assets/javascripts/blockly/msg/js/ja.js +0 -0
- data/vendor/assets/javascripts/jquery.blockUI.js +0 -0
- data/vendor/assets/stylesheets/.keep +0 -0
- metadata +80 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f9e3657a17fff32fcd9ac5b73969f9e406f593
|
4
|
+
data.tar.gz: 9a3e3b072a873403ae7fee32c1bdffaef07161f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5da5933e6419273e373c0fb36851607c35726a60a5e858b90ae0dad1f727d0b6f876a1a77c9a6592b2c3436d2e3e9cbbbec43987a9903cd6c77e407986e4b400
|
7
|
+
data.tar.gz: b822bbc6a28e7b310b6385f1d926417d1478f4277fe0e26b487090f8c879dca050d0ca59efbb8a596a1c9ac93fcb421ca65fa3397a529e923f74cb6bd244df91
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.rubocop.yml
CHANGED
File without changes
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.4
|
data/.simplecov
CHANGED
File without changes
|
data/.travis.yml
CHANGED
data/LEGAL
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/Procfile
CHANGED
File without changes
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
File without changes
|
data/app/assets/images/.keep
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,6 +3,7 @@
|
|
3
3
|
<%
|
4
4
|
category = 'control'
|
5
5
|
require 'smalruby_editor'
|
6
|
+
require 'smalruby_editor/blockly_message_helper'
|
6
7
|
color = SmalrubyEditor::COLORS[category.to_sym]
|
7
8
|
%>
|
8
9
|
|
@@ -12,7 +13,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
12
13
|
init: ()->
|
13
14
|
@setHelpUrl('')
|
14
15
|
@setColour(<%= color %>)
|
15
|
-
@interpolateMsg('
|
16
|
+
@interpolateMsg(<%= bm('.sleep') %>,
|
16
17
|
['SEC', ['Number'], Blockly.ALIGN_RIGHT],
|
17
18
|
Blockly.ALIGN_RIGHT)
|
18
19
|
@setInputsInline(true)
|
@@ -30,9 +31,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
30
31
|
init: ()->
|
31
32
|
@setHelpUrl('')
|
32
33
|
@setColour(<%= color %>)
|
33
|
-
@appendDummyInput().appendField('
|
34
|
+
@appendDummyInput().appendField(<%= bm('.loop') %>)
|
34
35
|
@appendStatementInput('DO')
|
35
|
-
@appendDummyInput().appendField('
|
36
|
+
@appendDummyInput().appendField(<%= bm('.loop_end') %>)
|
36
37
|
@setPreviousStatement(true)
|
37
38
|
@setNextStatement(true)
|
38
39
|
@setTooltip('')
|
@@ -45,11 +46,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
45
46
|
'loop do\n' + branch + 'end\n'
|
46
47
|
|
47
48
|
<%
|
48
|
-
|
49
|
-
['break', '繰り返しから脱出する'],
|
50
|
-
['next', '次の繰り返しにジャンプする'],
|
51
|
-
['redo', '現在の繰り返しをやり直す'],
|
52
|
-
].each do |suffix, label|
|
49
|
+
%w(break next redo).each do |suffix|
|
53
50
|
n = "#{category}_#{suffix}"
|
54
51
|
%>
|
55
52
|
|
@@ -57,7 +54,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
57
54
|
init: ()->
|
58
55
|
@setHelpUrl('')
|
59
56
|
@setColour(<%= color %>)
|
60
|
-
@appendDummyInput().appendField(
|
57
|
+
@appendDummyInput().appendField(<%= bm(".#{suffix}") %>)
|
61
58
|
@setPreviousStatement(true)
|
62
59
|
@setNextStatement(true)
|
63
60
|
@setTooltip('')
|
@@ -75,8 +72,8 @@ Blockly.Blocks['<%= n %>'] =
|
|
75
72
|
init: ()->
|
76
73
|
@setHelpUrl('')
|
77
74
|
@setColour(<%= color %>)
|
78
|
-
@appendValueInput('COND').setCheck('Boolean').appendField('
|
79
|
-
@appendDummyInput().appendField('
|
75
|
+
@appendValueInput('COND').setCheck('Boolean').appendField(<%= bm('.if') %>)
|
76
|
+
@appendDummyInput().appendField(<%= bm('.then') %>)
|
80
77
|
@appendStatementInput('THEN')
|
81
78
|
@setPreviousStatement(true)
|
82
79
|
@setNextStatement(true)
|
@@ -94,10 +91,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
94
91
|
init: ()->
|
95
92
|
@setHelpUrl('')
|
96
93
|
@setColour(<%= color %>)
|
97
|
-
@appendValueInput('COND').setCheck('Boolean').appendField('
|
98
|
-
@appendDummyInput().appendField('
|
94
|
+
@appendValueInput('COND').setCheck('Boolean').appendField(<%= bm('.if') %>)
|
95
|
+
@appendDummyInput().appendField(<%= bm('.then') %>)
|
99
96
|
@appendStatementInput('THEN')
|
100
|
-
@appendDummyInput().appendField('
|
97
|
+
@appendDummyInput().appendField(<%= bm('.else') %>)
|
101
98
|
@appendStatementInput('ELSE')
|
102
99
|
@setPreviousStatement(true)
|
103
100
|
@setNextStatement(true)
|
@@ -116,7 +113,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
116
113
|
init: ()->
|
117
114
|
@setHelpUrl('')
|
118
115
|
@setColour(<%= color %>)
|
119
|
-
@interpolateMsg('
|
116
|
+
@interpolateMsg(<%= bm('.times') %>,
|
120
117
|
['COUNT', ['Number'], Blockly.ALIGN_RIGHT],
|
121
118
|
Blockly.ALIGN_RIGHT)
|
122
119
|
@appendStatementInput('DO')
|
@@ -136,7 +133,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
136
133
|
init: ()->
|
137
134
|
@setHelpUrl('')
|
138
135
|
@setColour(<%= color %>)
|
139
|
-
@interpolateMsg('
|
136
|
+
@interpolateMsg(<%= bm('.await_until') %>,
|
140
137
|
['COND', ['Boolean'], Blockly.ALIGN_RIGHT],
|
141
138
|
Blockly.ALIGN_RIGHT)
|
142
139
|
@setInputsInline(true)
|
@@ -158,12 +155,12 @@ Blockly.Blocks['<%= n %>'] =
|
|
158
155
|
init: ()->
|
159
156
|
@setHelpUrl('')
|
160
157
|
@setColour(<%= color %>)
|
161
|
-
@interpolateMsg('
|
158
|
+
@interpolateMsg(<%= bm('.until') %>,
|
162
159
|
['COND', ['Boolean'], Blockly.ALIGN_RIGHT],
|
163
160
|
Blockly.ALIGN_RIGHT)
|
164
161
|
@appendStatementInput('DO')
|
165
162
|
@appendDummyInput()
|
166
|
-
.appendField('
|
163
|
+
.appendField(<%= bm('.loop_end') %>)
|
167
164
|
.setAlign(Blockly.ALIGN_RIGHT)
|
168
165
|
@setInputsInline(true)
|
169
166
|
@setPreviousStatement(true)
|
@@ -182,7 +179,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
182
179
|
@setHelpUrl('')
|
183
180
|
@setColour(<%= color %>)
|
184
181
|
@appendDummyInput()
|
185
|
-
.appendField('
|
182
|
+
.appendField(<%= bm('.await') %>)
|
186
183
|
@setPreviousStatement(true)
|
187
184
|
@setNextStatement(true)
|
188
185
|
@setTooltip('')
|
File without changes
|
File without changes
|
@@ -3,6 +3,7 @@
|
|
3
3
|
<%
|
4
4
|
category = 'events'
|
5
5
|
require 'smalruby_editor'
|
6
|
+
require 'smalruby_editor/blockly_message_helper'
|
6
7
|
color = SmalrubyEditor::COLORS[category.to_sym]
|
7
8
|
%>
|
8
9
|
|
@@ -13,7 +14,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
13
14
|
@setHelpUrl('')
|
14
15
|
@setColour(<%= color %>)
|
15
16
|
@appendDummyInput()
|
16
|
-
.appendField('
|
17
|
+
.appendField(<%= bm('.on_start') %>)
|
17
18
|
@appendStatementInput('DO')
|
18
19
|
@setPreviousStatement(true)
|
19
20
|
@setNextStatement(true)
|
@@ -32,11 +33,11 @@ Blockly.Blocks['<%= n %>'] =
|
|
32
33
|
@setHelpUrl('')
|
33
34
|
@setColour(<%= color %>)
|
34
35
|
@appendDummyInput()
|
35
|
-
.appendField('
|
36
|
+
.appendField(<%= bm('.on_key_push_or_down_prefix') %>)
|
36
37
|
.appendField(new Blockly.FieldDropdown(keyDropdown), 'KEY')
|
37
|
-
.appendField('
|
38
|
+
.appendField(<%= bm('.on_key_push_or_down_middle') %>)
|
38
39
|
.appendField(new Blockly.FieldDropdown(podDropdown), 'POD')
|
39
|
-
.appendField('
|
40
|
+
.appendField(<%= bm('.on_key_push_or_down_suffix') %>)
|
40
41
|
@appendStatementInput('DO')
|
41
42
|
@setPreviousStatement(true)
|
42
43
|
@setNextStatement(true)
|
@@ -54,7 +55,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
54
55
|
@setHelpUrl('')
|
55
56
|
@setColour(<%= color %>)
|
56
57
|
@appendDummyInput()
|
57
|
-
.appendField('
|
58
|
+
.appendField(<%= bm('.on_click') %>)
|
58
59
|
@appendStatementInput('DO')
|
59
60
|
@setPreviousStatement(true)
|
60
61
|
@setNextStatement(true)
|
@@ -70,8 +71,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
70
71
|
@setHelpUrl('')
|
71
72
|
@setColour(<%= color %>)
|
72
73
|
@appendDummyInput()
|
74
|
+
.appendField(<%= bm('.on_hit_prefix') %>)
|
73
75
|
.appendField(new Smalruby.FieldCharacter(), 'CHAR')
|
74
|
-
.appendField('
|
76
|
+
.appendField(<%= bm('.on_hit_suffix') %>)
|
75
77
|
@appendStatementInput('DO')
|
76
78
|
@setPreviousStatement(true)
|
77
79
|
@setNextStatement(true)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
require 'smalruby_editor'
|
3
|
+
require 'smalruby_editor/blockly_message_helper'
|
4
|
+
%>
|
5
|
+
|
1
6
|
'use strict'
|
2
7
|
|
3
8
|
goog.provide('Smalruby.FieldCharacter')
|
@@ -101,7 +106,7 @@ Smalruby.FieldCharacter.dropdownChange = (value) ->
|
|
101
106
|
|
102
107
|
Smalruby.FieldCharacter.NullCharacter =
|
103
108
|
get: (name) ->
|
104
|
-
'
|
109
|
+
<%= bm('.no_character') %>
|
105
110
|
on: -> $.noop
|
106
111
|
off: -> $.noop
|
107
112
|
link: -> $.noop
|
@@ -3,39 +3,49 @@
|
|
3
3
|
<%
|
4
4
|
category = 'hardware'
|
5
5
|
require 'smalruby_editor'
|
6
|
+
require 'smalruby_editor/blockly_message_helper'
|
6
7
|
colors = SmalrubyEditor::COLORS
|
7
8
|
%>
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
dioPinDropdown = null
|
11
|
+
pwmPinDropdown = null
|
12
|
+
rgbLedPinDropdown = null
|
13
|
+
aiPinDropdown = null
|
14
|
+
acDropdown = null
|
15
|
+
lorPinDropdown = null
|
16
|
+
twoWDPinDropdown = null
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
+
$(document).ready ->
|
19
|
+
# ハードウェアの環境設定
|
20
|
+
window.SmalrubyEditor.Hardware =
|
21
|
+
Type: 'Arduino' # 種別
|
22
|
+
DioPins: [2..13] # デジタルIOピン
|
23
|
+
PwmPins: [3, 5, 6, 9, 10, 11] # デジタルIOピンのうちPWMに対応しているピン
|
24
|
+
AiPins: [0..5] # アナログ入力ピン
|
18
25
|
|
19
|
-
|
20
|
-
|
26
|
+
dioPinDropdown =
|
27
|
+
(["D#{n}", "D#{n}"] for n in window.SmalrubyEditor.Hardware.DioPins)
|
21
28
|
|
22
|
-
|
23
|
-
|
29
|
+
pwmPinDropdown =
|
30
|
+
(["D#{n}", "D#{n}"] for n in window.SmalrubyEditor.Hardware.PwmPins)
|
24
31
|
|
25
|
-
|
26
|
-
|
32
|
+
rgbLedPinDropdown =
|
33
|
+
(["D#{n}", "D#{n}"] for n in [3, 9])
|
27
34
|
|
28
|
-
|
29
|
-
|
30
|
-
['カソード', 'cathode']
|
31
|
-
]
|
35
|
+
aiPinDropdown =
|
36
|
+
(["A#{n}", "A#{n}"] for n in window.SmalrubyEditor.Hardware.AiPins)
|
32
37
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
]
|
38
|
+
acDropdown = [
|
39
|
+
[<%= bm('.anode') %>, 'anode']
|
40
|
+
[<%= bm('.cathode') %>, 'cathode']
|
41
|
+
]
|
37
42
|
|
38
|
-
|
43
|
+
lorPinDropdown = [
|
44
|
+
[<%= bm('.left') %>, 'left'],
|
45
|
+
[<%= bm('.right') %>, 'right'],
|
46
|
+
]
|
47
|
+
|
48
|
+
twoWDPinDropdown = (["D#{n}", "D#{n}"] for n in [5, 6])
|
39
49
|
|
40
50
|
# ハードウェアを準備する
|
41
51
|
<% n = "#{category}_init_hardware" %>
|
@@ -43,7 +53,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
43
53
|
init: ()->
|
44
54
|
@setHelpUrl('')
|
45
55
|
@setColour(<%= colors[:etc] %>)
|
46
|
-
@appendDummyInput().appendField('
|
56
|
+
@appendDummyInput().appendField(<%= bm('.init_hardware') %>)
|
47
57
|
@setTooltip('')
|
48
58
|
|
49
59
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
@@ -55,10 +65,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
55
65
|
# LED[▼PIN]をオンにする
|
56
66
|
# LED[▼PIN]をオフにする
|
57
67
|
<%
|
58
|
-
|
59
|
-
['on', 'オン'],
|
60
|
-
['off', 'オフ'],
|
61
|
-
].each do |method, label|
|
68
|
+
%w(on off).each do |method|
|
62
69
|
n = "#{category}_led_#{method}"
|
63
70
|
%>
|
64
71
|
|
@@ -66,10 +73,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
66
73
|
init: ()->
|
67
74
|
@setHelpUrl('')
|
68
75
|
@setColour(<%= colors[:looks] %>)
|
69
|
-
@
|
70
|
-
|
71
|
-
|
72
|
-
.appendField('を<%= label %>にする')
|
76
|
+
@interpolateMsg(<%= bm(".led_#{method}") %>,
|
77
|
+
['PIN', ['Dropdown', dioPinDropdown], Blockly.ALIGN_RIGHT],
|
78
|
+
Blockly.ALIGN_RIGHT)
|
73
79
|
@setPreviousStatement(true)
|
74
80
|
@setNextStatement(true)
|
75
81
|
@setTooltip('')
|
@@ -89,14 +95,11 @@ Blockly.Blocks['<%= n %>'] =
|
|
89
95
|
init: ()->
|
90
96
|
@setHelpUrl('')
|
91
97
|
@setColour(<%= colors[:looks] %>)
|
92
|
-
@
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
.appendField('を')
|
98
|
-
.appendField(new Blockly.FieldColour('#ff0000'), 'COLOUR')
|
99
|
-
.appendField('にする')
|
98
|
+
@interpolateMsg(<%= bm('.rgb_led_on') %>,
|
99
|
+
['AC', ['Dropdown', acDropdown], Blockly.ALIGN_RIGHT],
|
100
|
+
['PIN', ['Dropdown', rgbLedPinDropdown], Blockly.ALIGN_RIGHT],
|
101
|
+
['COLOUR', ['Colour', '#ff0000'], Blockly.ALIGN_RIGHT],
|
102
|
+
Blockly.ALIGN_RIGHT)
|
100
103
|
@setPreviousStatement(true)
|
101
104
|
@setNextStatement(true)
|
102
105
|
@setTooltip('')
|
@@ -117,12 +120,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
117
120
|
init: ()->
|
118
121
|
@setHelpUrl('')
|
119
122
|
@setColour(<%= colors[:looks] %>)
|
120
|
-
@
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
.appendField(new Blockly.FieldDropdown(rgbLedPinDropdown), 'PIN')
|
125
|
-
.appendField('をオフにする')
|
123
|
+
@interpolateMsg(<%= bm('.rgb_led_off') %>,
|
124
|
+
['AC', ['Dropdown', acDropdown], Blockly.ALIGN_RIGHT],
|
125
|
+
['PIN', ['Dropdown', rgbLedPinDropdown], Blockly.ALIGN_RIGHT],
|
126
|
+
Blockly.ALIGN_RIGHT)
|
126
127
|
@setPreviousStatement(true)
|
127
128
|
@setNextStatement(true)
|
128
129
|
@setTooltip('')
|
@@ -142,17 +143,16 @@ Blockly.Blocks['<%= n %>'] =
|
|
142
143
|
|
143
144
|
@setHelpUrl('')
|
144
145
|
@setColour(<%= colors[:looks] %>)
|
145
|
-
@
|
146
|
-
|
147
|
-
|
148
|
-
.appendField('を表示する')
|
146
|
+
@interpolateMsg(<%= bm('.seven_segment_display_show') %>,
|
147
|
+
['NUM', ['Dropdown', dropdown], Blockly.ALIGN_RIGHT],
|
148
|
+
Blockly.ALIGN_RIGHT)
|
149
149
|
@setPreviousStatement(true)
|
150
150
|
@setNextStatement(true)
|
151
151
|
@setTooltip('')
|
152
152
|
|
153
153
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
154
154
|
num = parseInt(@getFieldValue('NUM'))
|
155
|
-
"seven_segment_display.show(#{num})
|
155
|
+
Blockly.Ruby.characterMethodCall_("seven_segment_display.show(#{num})")
|
156
156
|
|
157
157
|
# 7セグディスプレイをオフにする
|
158
158
|
<% n = "#{category}_seven_segment_display_off" %>
|
@@ -161,13 +161,13 @@ Blockly.Blocks['<%= n %>'] =
|
|
161
161
|
@setHelpUrl('')
|
162
162
|
@setColour(<%= colors[:looks] %>)
|
163
163
|
@appendDummyInput()
|
164
|
-
.appendField('
|
164
|
+
.appendField(<%= bm('.seven_segment_display_off') %>)
|
165
165
|
@setPreviousStatement(true)
|
166
166
|
@setNextStatement(true)
|
167
167
|
@setTooltip('')
|
168
168
|
|
169
169
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
170
|
-
"seven_segment_display.off
|
170
|
+
Blockly.Ruby.characterMethodCall_("seven_segment_display.off")
|
171
171
|
|
172
172
|
# 「LCD」サブジャンル
|
173
173
|
|
@@ -177,11 +177,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
177
177
|
init: ()->
|
178
178
|
@setHelpUrl('')
|
179
179
|
@setColour(<%= colors[:looks] %>)
|
180
|
-
@
|
181
|
-
|
182
|
-
|
183
|
-
@appendDummyInput()
|
184
|
-
.appendField('を表示する')
|
180
|
+
@interpolateMsg(<%= bm('.lcd_puts') %>,
|
181
|
+
['TEXT', ['String'], Blockly.ALIGN_RIGHT],
|
182
|
+
Blockly.ALIGN_RIGHT)
|
185
183
|
@setInputsInline(true)
|
186
184
|
@setPreviousStatement(true)
|
187
185
|
@setNextStatement(true)
|
@@ -189,7 +187,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
189
187
|
|
190
188
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
191
189
|
text = Blockly.Ruby.valueToCode(@, 'TEXT', Blockly.Ruby.ORDER_NONE) || ''
|
192
|
-
"lcd.puts(#{text})
|
190
|
+
Blockly.Ruby.characterMethodCall_("lcd.puts(#{text})")
|
193
191
|
|
194
192
|
# LCDをクリアする
|
195
193
|
<% n = "#{category}_lcd_clear" %>
|
@@ -198,28 +196,13 @@ Blockly.Blocks['<%= n %>'] =
|
|
198
196
|
@setHelpUrl('')
|
199
197
|
@setColour(<%= colors[:looks] %>)
|
200
198
|
@appendDummyInput()
|
201
|
-
.appendField('
|
199
|
+
.appendField(<%= bm('.lcd_clear') %>)
|
202
200
|
@setPreviousStatement(true)
|
203
201
|
@setNextStatement(true)
|
204
202
|
@setTooltip('')
|
205
203
|
|
206
204
|
Blockly.Ruby['<%= n %>'] = (block) ->
|
207
|
-
|
208
|
-
|
209
|
-
# 7セグディスプレイをオフにする
|
210
|
-
<% n = "#{category}_seven_segment_display_off" %>
|
211
|
-
Blockly.Blocks['<%= n %>'] =
|
212
|
-
init: ()->
|
213
|
-
@setHelpUrl('')
|
214
|
-
@setColour(<%= colors[:looks] %>)
|
215
|
-
@appendDummyInput()
|
216
|
-
.appendField('7セグディスプレイをオフにする')
|
217
|
-
@setPreviousStatement(true)
|
218
|
-
@setNextStatement(true)
|
219
|
-
@setTooltip('')
|
220
|
-
|
221
|
-
Blockly.Ruby['<%= n %>'] = (block) ->
|
222
|
-
"seven_segment_display.off\n"
|
205
|
+
Blockly.Ruby.characterMethodCall_('lcd.clear')
|
223
206
|
|
224
207
|
# 「サーボ」サブジャンル
|
225
208
|
|
@@ -229,14 +212,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
229
212
|
init: ()->
|
230
213
|
@setHelpUrl('')
|
231
214
|
@setColour(<%= colors[:motion] %>)
|
232
|
-
@
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
@appendValueInput('POS')
|
237
|
-
.setCheck('Number')
|
238
|
-
@appendDummyInput()
|
239
|
-
.appendField('度(5~180)にする')
|
215
|
+
@interpolateMsg(<%= bm('.servo_set_position') %>,
|
216
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
217
|
+
['POS', ['Number'], Blockly.ALIGN_RIGHT],
|
218
|
+
Blockly.ALIGN_RIGHT)
|
240
219
|
@setInputsInline(true)
|
241
220
|
@setPreviousStatement(true)
|
242
221
|
@setNextStatement(true)
|
@@ -257,26 +236,17 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
257
236
|
# 2WD車[▼PIN]を右に曲げる
|
258
237
|
# 2WD車[▼PIN]を止める
|
259
238
|
<%
|
260
|
-
|
261
|
-
['forward', '進める'],
|
262
|
-
['backward', 'バックさせる'],
|
263
|
-
['turn_left', '左に曲げる'],
|
264
|
-
['turn_right', '右に曲げる'],
|
265
|
-
['stop', '止める'],
|
266
|
-
].each do |method, label|
|
239
|
+
%w(forward backward turn_left turn_right stop).each do |method|
|
267
240
|
n = "#{category}_#{subcategory}_#{method}"
|
268
241
|
%>
|
269
242
|
|
270
243
|
Blockly.Blocks['<%= n %>'] =
|
271
244
|
init: ()->
|
272
|
-
dropdown = (["D#{n}", "D#{n}"] for n in [2..10])
|
273
|
-
|
274
245
|
@setHelpUrl('')
|
275
246
|
@setColour(<%= colors[:motion] %>)
|
276
|
-
@
|
277
|
-
|
278
|
-
|
279
|
-
.appendField('を<%= label %>')
|
247
|
+
@interpolateMsg(<%= bm(".#{subcategory}_#{method}") %>,
|
248
|
+
['PIN', ['Dropdown', twoWDPinDropdown], Blockly.ALIGN_RIGHT],
|
249
|
+
Blockly.ALIGN_RIGHT)
|
280
250
|
@setInputsInline(true)
|
281
251
|
@setPreviousStatement(true)
|
282
252
|
@setNextStatement(true)
|
@@ -294,15 +264,11 @@ Blockly.Blocks['<%= n %>'] =
|
|
294
264
|
init: ()->
|
295
265
|
@setHelpUrl('')
|
296
266
|
@setColour(<%= colors[:motion] %>)
|
297
|
-
@
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
.setCheck('Number')
|
303
|
-
@appendDummyInput()
|
304
|
-
.appendField('秒')
|
305
|
-
@appendValueInput('COMMAND').setCheck('String')
|
267
|
+
@interpolateMsg(<%= bm(".#{subcategory}_run") %>,
|
268
|
+
['COMMAND', ['String'], Blockly.ALIGN_RIGHT],
|
269
|
+
['PIN', ['Dropdown', twoWDPinDropdown], Blockly.ALIGN_RIGHT],
|
270
|
+
['SEC', ['Number'], Blockly.ALIGN_RIGHT],
|
271
|
+
Blockly.ALIGN_RIGHT)
|
306
272
|
@setInputsInline(true)
|
307
273
|
@setPreviousStatement(true)
|
308
274
|
@setNextStatement(true)
|
@@ -320,11 +286,11 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
320
286
|
Blockly.Blocks['<%= n %>'] =
|
321
287
|
init: ()->
|
322
288
|
commands = [
|
323
|
-
[
|
324
|
-
[
|
325
|
-
[
|
326
|
-
[
|
327
|
-
[
|
289
|
+
[<%= bm(".#{subcategory}_commands_forward") %>, 'forward'],
|
290
|
+
[<%= bm(".#{subcategory}_commands_backward") %>, 'backward'],
|
291
|
+
[<%= bm(".#{subcategory}_commands_turn_left") %>, 'turn_left'],
|
292
|
+
[<%= bm(".#{subcategory}_commands_turn_right") %>, 'turn_right'],
|
293
|
+
[<%= bm(".#{subcategory}_commands_stop") %>, 'stop'],
|
328
294
|
]
|
329
295
|
@setHelpUrl('')
|
330
296
|
@setColour(<%= colors[:motion] %>)
|
@@ -343,15 +309,11 @@ Blockly.Blocks['<%= n %>'] =
|
|
343
309
|
init: ()->
|
344
310
|
@setHelpUrl('')
|
345
311
|
@setColour(<%= colors[:motion] %>)
|
346
|
-
@
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
.appendField('の速度を')
|
352
|
-
@interpolateMsg('%1%にする',
|
353
|
-
['SPEED', ['Number'], Blockly.ALIGN_RIGHT],
|
354
|
-
Blockly.ALIGN_RIGHT)
|
312
|
+
@interpolateMsg(<%= bm(".#{subcategory}_set_speed") %>,
|
313
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
314
|
+
['LOR', ['Dropdown', lorPinDropdown], Blockly.ALIGN_RIGHT],
|
315
|
+
['SPEED', ['Number'], Blockly.ALIGN_RIGHT],
|
316
|
+
Blockly.ALIGN_RIGHT)
|
355
317
|
@setInputsInline(true)
|
356
318
|
@setPreviousStatement(true)
|
357
319
|
@setNextStatement(true)
|
@@ -369,12 +331,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
369
331
|
init: ()->
|
370
332
|
@setHelpUrl('')
|
371
333
|
@setColour(<%= colors[:sensing] %>)
|
372
|
-
@
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
.appendField(new Blockly.FieldDropdown(lorPinDropdown), 'LOR')
|
377
|
-
.appendField('の速度(%)')
|
334
|
+
@interpolateMsg(<%= bm(".#{subcategory}_speed") %>,
|
335
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
336
|
+
['LOR', ['Dropdown', lorPinDropdown], Blockly.ALIGN_RIGHT],
|
337
|
+
Blockly.ALIGN_RIGHT)
|
378
338
|
@setOutput(true, 'Number')
|
379
339
|
@setTooltip('')
|
380
340
|
|
@@ -391,18 +351,17 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
391
351
|
Blockly.Blocks['<%= n %>'] =
|
392
352
|
init: ()->
|
393
353
|
methodDropdown = [
|
394
|
-
[
|
395
|
-
[
|
396
|
-
[
|
354
|
+
[<%= bm(".#{subcategory}_forward") %>, 'forward'],
|
355
|
+
[<%= bm(".#{subcategory}_backward") %>, 'backward'],
|
356
|
+
[<%= bm(".#{subcategory}_stop") %>, 'stop'],
|
397
357
|
]
|
398
358
|
|
399
359
|
@setHelpUrl('')
|
400
360
|
@setColour(<%= colors[:motion] %>)
|
401
|
-
@
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
.appendField(new Blockly.FieldDropdown(methodDropdown), 'METHOD')
|
361
|
+
@interpolateMsg(<%= bm(".#{subcategory}") %>,
|
362
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
363
|
+
['METHOD', ['Dropdown', methodDropdown], Blockly.ALIGN_RIGHT],
|
364
|
+
Blockly.ALIGN_RIGHT)
|
406
365
|
@setInputsInline(true)
|
407
366
|
@setPreviousStatement(true)
|
408
367
|
@setNextStatement(true)
|
@@ -420,13 +379,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
420
379
|
init: ()->
|
421
380
|
@setHelpUrl('')
|
422
381
|
@setColour(<%= colors[:motion] %>)
|
423
|
-
@
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
@interpolateMsg('%1%にする',
|
428
|
-
['SPEED', ['Number'], Blockly.ALIGN_RIGHT],
|
429
|
-
Blockly.ALIGN_RIGHT)
|
382
|
+
@interpolateMsg(<%= bm(".#{subcategory}_set_speed") %>,
|
383
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
384
|
+
['SPEED', ['Number'], Blockly.ALIGN_RIGHT],
|
385
|
+
Blockly.ALIGN_RIGHT)
|
430
386
|
@setInputsInline(true)
|
431
387
|
@setPreviousStatement(true)
|
432
388
|
@setNextStatement(true)
|
@@ -443,10 +399,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
443
399
|
init: ()->
|
444
400
|
@setHelpUrl('')
|
445
401
|
@setColour(<%= colors[:sensing] %>)
|
446
|
-
@
|
447
|
-
|
448
|
-
|
449
|
-
.appendField('の)モーターの速度(%)')
|
402
|
+
@interpolateMsg(<%= bm(".#{subcategory}_speed") %>,
|
403
|
+
['PIN', ['Dropdown', pwmPinDropdown], Blockly.ALIGN_RIGHT],
|
404
|
+
Blockly.ALIGN_RIGHT)
|
450
405
|
@setOutput(true, 'Number')
|
451
406
|
@setTooltip('')
|
452
407
|
|
@@ -465,11 +420,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
465
420
|
|
466
421
|
@setHelpUrl('')
|
467
422
|
@setColour(<%= colors[:sensing] %>)
|
468
|
-
@
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
.appendField(new Blockly.FieldDropdown(douDropdown), 'DOU')
|
423
|
+
@interpolateMsg(<%= bm(".button_down_or_up") %>,
|
424
|
+
['PIN', ['Dropdown', dioPinDropdown], Blockly.ALIGN_RIGHT],
|
425
|
+
['DOU', ['Dropdown', douDropdown], Blockly.ALIGN_RIGHT],
|
426
|
+
Blockly.ALIGN_RIGHT)
|
473
427
|
@setOutput(true, 'Boolean')
|
474
428
|
@setTooltip('')
|
475
429
|
|
@@ -486,12 +440,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
486
440
|
|
487
441
|
@setHelpUrl('')
|
488
442
|
@setColour(<%= colors[:events] %>)
|
489
|
-
@
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
.appendField(new Blockly.FieldDropdown(douDropdown), 'DOU')
|
494
|
-
.appendField('とき')
|
443
|
+
@interpolateMsg(<%= bm('.on_button_down_or_up') %>,
|
444
|
+
['PIN', ['Dropdown', dioPinDropdown], Blockly.ALIGN_RIGHT],
|
445
|
+
['DOU', ['Dropdown', douDropdown], Blockly.ALIGN_RIGHT],
|
446
|
+
Blockly.ALIGN_RIGHT)
|
495
447
|
@appendStatementInput('DO')
|
496
448
|
@setPreviousStatement(true)
|
497
449
|
@setNextStatement(true)
|
@@ -508,10 +460,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
508
460
|
init: ()->
|
509
461
|
@setHelpUrl('')
|
510
462
|
@setColour(<%= colors[:etc] %>)
|
511
|
-
@
|
512
|
-
|
513
|
-
|
514
|
-
.appendField('のプルアップ抵抗を使わない')
|
463
|
+
@interpolateMsg(<%= bm('.button_not_use_pullup') %>,
|
464
|
+
['PIN', ['Dropdown', dioPinDropdown], Blockly.ALIGN_RIGHT],
|
465
|
+
Blockly.ALIGN_RIGHT)
|
515
466
|
@setPreviousStatement(true)
|
516
467
|
@setNextStatement(true)
|
517
468
|
@setTooltip('')
|
@@ -528,9 +479,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
528
479
|
init: ()->
|
529
480
|
@setHelpUrl('')
|
530
481
|
@setColour(<%= colors[:sensing] %>)
|
531
|
-
@
|
532
|
-
|
533
|
-
|
482
|
+
@interpolateMsg(<%= bm('.sensor_value') %>,
|
483
|
+
['PIN', ['Dropdown', aiPinDropdown], Blockly.ALIGN_RIGHT],
|
484
|
+
Blockly.ALIGN_RIGHT)
|
534
485
|
@setOutput(true, 'Number')
|
535
486
|
@setTooltip('')
|
536
487
|
|
@@ -544,10 +495,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
544
495
|
init: ()->
|
545
496
|
@setHelpUrl('')
|
546
497
|
@setColour(<%= colors[:events] %>)
|
547
|
-
@
|
548
|
-
|
549
|
-
|
550
|
-
.appendField('が変化したとき')
|
498
|
+
@interpolateMsg(<%= bm('.on_sensor_change') %>,
|
499
|
+
['PIN', ['Dropdown', aiPinDropdown], Blockly.ALIGN_RIGHT],
|
500
|
+
Blockly.ALIGN_RIGHT)
|
551
501
|
@appendStatementInput('DO')
|
552
502
|
@setPreviousStatement(true)
|
553
503
|
@setNextStatement(true)
|