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
@@ -3,6 +3,7 @@
|
|
3
3
|
<%
|
4
4
|
category = 'looks'
|
5
5
|
require 'smalruby_editor'
|
6
|
+
require 'smalruby_editor/blockly_message_helper'
|
6
7
|
color = SmalrubyEditor::COLORS[category.to_sym]
|
7
8
|
%>
|
8
9
|
|
@@ -11,10 +12,7 @@
|
|
11
12
|
# [ ]と( )秒考える
|
12
13
|
# [ ]と考える
|
13
14
|
<%
|
14
|
-
|
15
|
-
['say', '言う'],
|
16
|
-
['think', '考える'],
|
17
|
-
].each do |method, label_suffix|
|
15
|
+
%w(say think).each do |method|
|
18
16
|
%>
|
19
17
|
|
20
18
|
<% n = "#{category}_#{method}_second" %>
|
@@ -22,10 +20,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
22
20
|
init: ()->
|
23
21
|
@setHelpUrl('')
|
24
22
|
@setColour(<%= color %>)
|
25
|
-
@interpolateMsg(
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
@interpolateMsg(<%= bm(".#{method}_with_second") %>,
|
24
|
+
['TEXT', null, Blockly.ALIGN_RIGHT],
|
25
|
+
['SEC', ['Number'], Blockly.ALIGN_RIGHT],
|
26
|
+
Blockly.ALIGN_RIGHT)
|
29
27
|
@setInputsInline(true)
|
30
28
|
@setPreviousStatement(true)
|
31
29
|
@setNextStatement(true)
|
@@ -41,9 +39,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
41
39
|
init: ()->
|
42
40
|
@setHelpUrl('')
|
43
41
|
@setColour(<%= color %>)
|
44
|
-
@interpolateMsg(
|
45
|
-
|
46
|
-
|
42
|
+
@interpolateMsg(<%= bm(".#{method}") %>,
|
43
|
+
['TEXT', null, Blockly.ALIGN_RIGHT],
|
44
|
+
Blockly.ALIGN_RIGHT)
|
47
45
|
@setInputsInline(true)
|
48
46
|
@setPreviousStatement(true)
|
49
47
|
@setNextStatement(true)
|
@@ -58,9 +56,9 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
58
56
|
# 隠す
|
59
57
|
<%
|
60
58
|
[
|
61
|
-
['show', '
|
62
|
-
['hide', '
|
63
|
-
].each do |suffix,
|
59
|
+
['show', 'true'],
|
60
|
+
['hide', 'false'],
|
61
|
+
].each do |suffix, val|
|
64
62
|
n = "#{category}_#{suffix}"
|
65
63
|
%>
|
66
64
|
|
@@ -68,7 +66,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
68
66
|
init: ()->
|
69
67
|
@setHelpUrl('')
|
70
68
|
@setColour(<%= color %>)
|
71
|
-
@appendDummyInput().appendField(
|
69
|
+
@appendDummyInput().appendField(<%= bm(".#{suffix}") %>)
|
72
70
|
@setPreviousStatement(true)
|
73
71
|
@setNextStatement(true)
|
74
72
|
@setTooltip('')
|
@@ -83,7 +81,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
83
81
|
init: ()->
|
84
82
|
@setHelpUrl('')
|
85
83
|
@setColour(<%= color %>)
|
86
|
-
@appendDummyInput().appendField('
|
84
|
+
@appendDummyInput().appendField(<%= bm('.vanish') %>)
|
87
85
|
@setPreviousStatement(true)
|
88
86
|
@setNextStatement(true)
|
89
87
|
@setTooltip('')
|
@@ -3,6 +3,7 @@
|
|
3
3
|
<%
|
4
4
|
category = 'motion'
|
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,9 +13,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
12
13
|
init: ()->
|
13
14
|
@setHelpUrl('')
|
14
15
|
@setColour(<%= color %>)
|
15
|
-
@interpolateMsg('
|
16
|
-
|
17
|
-
|
16
|
+
@interpolateMsg(<%= bm('.move') %>,
|
17
|
+
['STEP', ['Number'], Blockly.ALIGN_RIGHT],
|
18
|
+
Blockly.ALIGN_RIGHT)
|
18
19
|
@setInputsInline(true)
|
19
20
|
@setPreviousStatement(true)
|
20
21
|
@setNextStatement(true)
|
@@ -28,9 +29,9 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
28
29
|
# 反時計回りに( )度回す
|
29
30
|
<%
|
30
31
|
[
|
31
|
-
['right', ''
|
32
|
-
['left', '
|
33
|
-
].each do |suffix,
|
32
|
+
['right', ''],
|
33
|
+
['left', '-'],
|
34
|
+
].each do |suffix, sign|
|
34
35
|
n = "#{category}_rotate_#{suffix}"
|
35
36
|
%>
|
36
37
|
|
@@ -38,9 +39,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
38
39
|
init: ()->
|
39
40
|
@setHelpUrl('')
|
40
41
|
@setColour(<%= color %>)
|
41
|
-
@interpolateMsg(
|
42
|
-
|
43
|
-
|
42
|
+
@interpolateMsg(<%= bm(".turn_#{suffix}_degrees") %>,
|
43
|
+
['ANGLE', ['Number'], Blockly.ALIGN_RIGHT],
|
44
|
+
Blockly.ALIGN_RIGHT)
|
44
45
|
@setInputsInline(true)
|
45
46
|
@setPreviousStatement(true)
|
46
47
|
@setNextStatement(true)
|
@@ -57,9 +58,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
57
58
|
init: ()->
|
58
59
|
@setHelpUrl('')
|
59
60
|
@setColour(<%= color %>)
|
60
|
-
@interpolateMsg('
|
61
|
-
|
62
|
-
|
61
|
+
@interpolateMsg(<%= bm('.point_in_direction') %>,
|
62
|
+
['ANGLE', ['Number'], Blockly.ALIGN_RIGHT],
|
63
|
+
Blockly.ALIGN_RIGHT)
|
63
64
|
@setInputsInline(true)
|
64
65
|
@setPreviousStatement(true)
|
65
66
|
@setNextStatement(true)
|
@@ -76,7 +77,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
76
77
|
@setHelpUrl('')
|
77
78
|
@setColour(<%= color %>)
|
78
79
|
@appendDummyInput()
|
79
|
-
.appendField('
|
80
|
+
.appendField(<%= bm('.point_towards_mouse') %>)
|
80
81
|
@setPreviousStatement(true)
|
81
82
|
@setNextStatement(true)
|
82
83
|
@setTooltip('')
|
@@ -92,7 +93,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
92
93
|
@setColour(<%= color %>)
|
93
94
|
@appendDummyInput()
|
94
95
|
.appendField(new Smalruby.FieldCharacter(), 'CHAR')
|
95
|
-
.appendField('
|
96
|
+
.appendField(<%= bm('.point_towards_character') %>)
|
96
97
|
@setPreviousStatement(true)
|
97
98
|
@setNextStatement(true)
|
98
99
|
@setTooltip('')
|
@@ -107,11 +108,11 @@ Blockly.Blocks['<%= n %>'] =
|
|
107
108
|
init: ()->
|
108
109
|
@setHelpUrl('')
|
109
110
|
@setColour(<%= color %>)
|
110
|
-
@appendDummyInput().appendField('
|
111
|
+
@appendDummyInput().appendField(<%= bm('.set_x_y_x') %>)
|
111
112
|
@appendValueInput('X').setCheck('Number')
|
112
|
-
@appendDummyInput().appendField('
|
113
|
+
@appendDummyInput().appendField(<%= bm('.set_x_y_y') %>)
|
113
114
|
@appendValueInput('Y').setCheck('Number')
|
114
|
-
@appendDummyInput().appendField('
|
115
|
+
@appendDummyInput().appendField(<%= bm('.set_x_y_suffix') %>)
|
115
116
|
@setInputsInline(true)
|
116
117
|
@setPreviousStatement(true)
|
117
118
|
@setNextStatement(true)
|
@@ -129,7 +130,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
129
130
|
@setHelpUrl('')
|
130
131
|
@setColour(<%= color %>)
|
131
132
|
@appendDummyInput()
|
132
|
-
.appendField('
|
133
|
+
.appendField(<%= bm('.go_to_mouse') %>)
|
133
134
|
@setPreviousStatement(true)
|
134
135
|
@setNextStatement(true)
|
135
136
|
@setTooltip('')
|
@@ -144,8 +145,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
144
145
|
@setHelpUrl('')
|
145
146
|
@setColour(<%= color %>)
|
146
147
|
@appendDummyInput()
|
148
|
+
.appendField(<%= bm('.go_to_character_prefix') %>)
|
147
149
|
.appendField(new Smalruby.FieldCharacter(), 'CHAR')
|
148
|
-
.appendField('
|
150
|
+
.appendField(<%= bm('.go_to_character_suffix') %>)
|
149
151
|
@setPreviousStatement(true)
|
150
152
|
@setNextStatement(true)
|
151
153
|
@setTooltip('')
|
@@ -161,10 +163,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
161
163
|
@setHelpUrl('')
|
162
164
|
@setColour(<%= color %>)
|
163
165
|
@interpolateMsg('%1秒でx座標を%2、y座標を%3に変える',
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
166
|
+
['SEC', ['Number'], Blockly.ALIGN_RIGHT],
|
167
|
+
['X', ['Number'], Blockly.ALIGN_RIGHT],
|
168
|
+
['Y', ['Number'], Blockly.ALIGN_RIGHT],
|
169
|
+
Blockly.ALIGN_RIGHT)
|
168
170
|
@setInputsInline(true)
|
169
171
|
@setPreviousStatement(true)
|
170
172
|
@setNextStatement(true)
|
@@ -182,11 +184,11 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
182
184
|
# y座標を( )にする
|
183
185
|
<%
|
184
186
|
[
|
185
|
-
['change_x_by', 'X', '
|
186
|
-
['set_x', 'X', '
|
187
|
-
['change_y_by', 'Y', '
|
188
|
-
['set_y', 'Y', '
|
189
|
-
].each do |suffix, name,
|
187
|
+
['change_x_by', 'X', '+='],
|
188
|
+
['set_x', 'X', '='],
|
189
|
+
['change_y_by', 'Y', '+='],
|
190
|
+
['set_y', 'Y', '='],
|
191
|
+
].each do |suffix, name, operator|
|
190
192
|
n = "#{category}_#{suffix}"
|
191
193
|
%>
|
192
194
|
|
@@ -194,9 +196,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
194
196
|
init: ()->
|
195
197
|
@setHelpUrl('')
|
196
198
|
@setColour(<%= color %>)
|
197
|
-
@interpolateMsg(
|
198
|
-
|
199
|
-
|
199
|
+
@interpolateMsg(<%= bm(".#{suffix}") %>,
|
200
|
+
['<%= name %>', ['Number'], Blockly.ALIGN_RIGHT],
|
201
|
+
Blockly.ALIGN_RIGHT)
|
200
202
|
@setInputsInline(true)
|
201
203
|
@setPreviousStatement(true)
|
202
204
|
@setNextStatement(true)
|
@@ -213,7 +215,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
213
215
|
init: ()->
|
214
216
|
@setHelpUrl('')
|
215
217
|
@setColour(<%= color %>)
|
216
|
-
@appendDummyInput().appendField('
|
218
|
+
@appendDummyInput().appendField(<%= bm('.turn_if_reach_wall') %>)
|
217
219
|
@setPreviousStatement(true)
|
218
220
|
@setNextStatement(true)
|
219
221
|
@setTooltip('')
|
@@ -227,7 +229,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
227
229
|
init: ()->
|
228
230
|
@setHelpUrl('')
|
229
231
|
@setColour(<%= color %>)
|
230
|
-
@appendDummyInput().appendField('
|
232
|
+
@appendDummyInput().appendField(<%= bm('.turn') %>)
|
231
233
|
@setPreviousStatement(true)
|
232
234
|
@setNextStatement(true)
|
233
235
|
@setTooltip('')
|
@@ -240,15 +242,16 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
240
242
|
Blockly.Blocks['<%= n %>'] =
|
241
243
|
init: ()->
|
242
244
|
dropdown = [
|
243
|
-
['
|
244
|
-
['
|
245
|
+
[<%= bm('.turn_xy_x') %>, 'x'],
|
246
|
+
[<%= bm('.turn_xy_y') %>, 'y'],
|
245
247
|
]
|
246
248
|
|
247
249
|
@setHelpUrl('')
|
248
250
|
@setColour(<%= color %>)
|
249
251
|
@appendDummyInput()
|
252
|
+
.appendField(<%= bm('.turn_xy_prefix') %>)
|
250
253
|
.appendField(new Blockly.FieldDropdown(dropdown), 'XY')
|
251
|
-
.appendField('
|
254
|
+
.appendField(<%= bm('.turn_xy_suffix') %>)
|
252
255
|
@setPreviousStatement(true)
|
253
256
|
@setNextStatement(true)
|
254
257
|
@setTooltip('')
|
@@ -262,17 +265,17 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
262
265
|
Blockly.Blocks['<%= n %>'] =
|
263
266
|
init: ()->
|
264
267
|
dropdown = [
|
265
|
-
['
|
266
|
-
['
|
267
|
-
['
|
268
|
+
[<%= bm('.set_rotation_style_left_right') %>, 'left_right'],
|
269
|
+
[<%= bm('.set_rotation_style_none') %>, 'none'],
|
270
|
+
[<%= bm('.set_rotation_style_free') %>, 'free'],
|
268
271
|
]
|
269
272
|
|
270
273
|
@setHelpUrl('')
|
271
274
|
@setColour(<%= color %>)
|
272
275
|
@appendDummyInput()
|
273
|
-
.appendField('
|
276
|
+
.appendField(<%= bm('.set_rotation_style_prefix') %>)
|
274
277
|
.appendField(new Blockly.FieldDropdown(dropdown), 'STYLE')
|
275
|
-
.appendField('
|
278
|
+
.appendField(<%= bm('.set_rotation_style_suffix') %>)
|
276
279
|
@setPreviousStatement(true)
|
277
280
|
@setNextStatement(true)
|
278
281
|
@setTooltip('')
|
@@ -285,11 +288,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
285
288
|
# 変数:y座標
|
286
289
|
# 変数:向き
|
287
290
|
<%
|
288
|
-
|
289
|
-
['x', 'x座標'],
|
290
|
-
['y', 'y座標'],
|
291
|
-
['angle', '向き'],
|
292
|
-
].each do |method, label|
|
291
|
+
%w(x y angle).each do |method|
|
293
292
|
n = "#{category}_self_#{method}"
|
294
293
|
%>
|
295
294
|
|
@@ -297,7 +296,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
297
296
|
init: ()->
|
298
297
|
@setHelpUrl('')
|
299
298
|
@setColour(<%= color %>)
|
300
|
-
@appendDummyInput().appendField(
|
299
|
+
@appendDummyInput().appendField(<%= bm(".self_#{method}") %>)
|
301
300
|
@setOutput(true, 'Number')
|
302
301
|
@setTooltip('')
|
303
302
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
<%
|
4
4
|
category = 'operators'
|
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,11 +13,11 @@
|
|
12
13
|
# 変数:( ) / ( )
|
13
14
|
<%
|
14
15
|
[
|
15
|
-
['add', '
|
16
|
-
['minus', '
|
17
|
-
['multiply', '
|
18
|
-
['divide', '
|
19
|
-
].each do |suffix,
|
16
|
+
['add', 'ADDITIVE', '+', '0', '0'],
|
17
|
+
['minus', 'ADDITIVE', '-', '0', '0'],
|
18
|
+
['multiply', 'MULTIPLICATIVE', '*', '0', '0'],
|
19
|
+
['divide', 'MULTIPLICATIVE', '/', '0', '1'],
|
20
|
+
].each do |suffix, order_suffix, operator, default_a, default_b|
|
20
21
|
n = "#{category}_#{suffix}"
|
21
22
|
%>
|
22
23
|
|
@@ -24,7 +25,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
24
25
|
init: ()->
|
25
26
|
@setHelpUrl('')
|
26
27
|
@setColour(<%= color %>)
|
27
|
-
@interpolateMsg(
|
28
|
+
@interpolateMsg(<%= bm(".#{suffix}") %>,
|
28
29
|
['A', null, Blockly.ALIGN_RIGHT],
|
29
30
|
['B', null, Blockly.ALIGN_RIGHT],
|
30
31
|
Blockly.ALIGN_RIGHT)
|
@@ -46,12 +47,12 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
46
47
|
# 条件:( ) > ( )
|
47
48
|
<%
|
48
49
|
[
|
49
|
-
['compare_lt', '
|
50
|
-
['compare_lte', '
|
51
|
-
['compare_eq', '
|
52
|
-
['compare_gte', '
|
53
|
-
['compare_gt', '
|
54
|
-
].each do |suffix,
|
50
|
+
['compare_lt', '<', 'RELATIONAL'],
|
51
|
+
['compare_lte', '<=', 'RELATIONAL'],
|
52
|
+
['compare_eq', '==', 'EQUALS'],
|
53
|
+
['compare_gte', '>=', 'RELATIONAL'],
|
54
|
+
['compare_gt', '>', 'RELATIONAL'],
|
55
|
+
].each do |suffix, operator, order_suffix|
|
55
56
|
n = "#{category}_#{suffix}"
|
56
57
|
%>
|
57
58
|
|
@@ -59,7 +60,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
59
60
|
init: ()->
|
60
61
|
@setHelpUrl('')
|
61
62
|
@setColour(<%= color %>)
|
62
|
-
@interpolateMsg(
|
63
|
+
@interpolateMsg(<%= bm(".#{suffix}") %>,
|
63
64
|
['A', null, Blockly.ALIGN_RIGHT],
|
64
65
|
['B', null, Blockly.ALIGN_RIGHT],
|
65
66
|
Blockly.ALIGN_RIGHT)
|
@@ -80,7 +81,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
80
81
|
init: ()->
|
81
82
|
@setHelpUrl('')
|
82
83
|
@setColour(<%= color %>)
|
83
|
-
@interpolateMsg('
|
84
|
+
@interpolateMsg(<%= bm('.rand')%>,
|
84
85
|
['A', ['Number'], Blockly.ALIGN_RIGHT],
|
85
86
|
['B', ['Number'], Blockly.ALIGN_RIGHT],
|
86
87
|
Blockly.ALIGN_RIGHT)
|
@@ -97,9 +98,9 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
97
98
|
# 条件:< > または < >
|
98
99
|
<%
|
99
100
|
[
|
100
|
-
['and', '
|
101
|
-
['or', '
|
102
|
-
].each do |suffix,
|
101
|
+
['and', '&&'],
|
102
|
+
['or', '||'],
|
103
|
+
].each do |suffix, operator|
|
103
104
|
n = "#{category}_#{suffix}"
|
104
105
|
%>
|
105
106
|
|
@@ -107,7 +108,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
107
108
|
init: ()->
|
108
109
|
@setHelpUrl('')
|
109
110
|
@setColour(<%= color %>)
|
110
|
-
@interpolateMsg(
|
111
|
+
@interpolateMsg(<%= bm(".#{suffix}") %>,
|
111
112
|
['A', ['Boolean'], Blockly.ALIGN_RIGHT],
|
112
113
|
['B', ['Boolean'], Blockly.ALIGN_RIGHT],
|
113
114
|
Blockly.ALIGN_RIGHT)
|
@@ -128,7 +129,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
128
129
|
init: ()->
|
129
130
|
@setHelpUrl('')
|
130
131
|
@setColour(<%= color %>)
|
131
|
-
@interpolateMsg('
|
132
|
+
@interpolateMsg(<%= bm('.not') %>,
|
132
133
|
['A', ['Boolean'], Blockly.ALIGN_RIGHT],
|
133
134
|
Blockly.ALIGN_RIGHT)
|
134
135
|
@setInputsInline(true)
|
@@ -146,10 +147,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
146
147
|
init: ()->
|
147
148
|
@setHelpUrl('')
|
148
149
|
@setColour(<%= color %>)
|
149
|
-
@interpolateMsg('
|
150
|
-
|
151
|
-
|
152
|
-
|
150
|
+
@interpolateMsg(<%= bm('.index_of') %>,
|
151
|
+
['A', null, Blockly.ALIGN_RIGHT],
|
152
|
+
['INDEX', ['Number'], Blockly.ALIGN_RIGHT],
|
153
|
+
Blockly.ALIGN_RIGHT)
|
153
154
|
@setInputsInline(true)
|
154
155
|
@setOutput(true, null)
|
155
156
|
@setTooltip('')
|
@@ -165,9 +166,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
165
166
|
init: ()->
|
166
167
|
@setHelpUrl('')
|
167
168
|
@setColour(<%= color %>)
|
168
|
-
@interpolateMsg('
|
169
|
-
|
170
|
-
|
169
|
+
@interpolateMsg(<%= bm('.length') %>,
|
170
|
+
['A', null, Blockly.ALIGN_RIGHT],
|
171
|
+
Blockly.ALIGN_RIGHT)
|
171
172
|
@setInputsInline(true)
|
172
173
|
@setOutput(true, null)
|
173
174
|
@setTooltip('')
|
@@ -183,10 +184,10 @@ Blockly.Blocks['<%= n %>'] =
|
|
183
184
|
init: ()->
|
184
185
|
@setHelpUrl('')
|
185
186
|
@setColour(<%= color %>)
|
186
|
-
@interpolateMsg('
|
187
|
-
|
188
|
-
|
189
|
-
|
187
|
+
@interpolateMsg(<%= bm('.modulo') %>,
|
188
|
+
['A', ['Number'], Blockly.ALIGN_RIGHT],
|
189
|
+
['B', ['Number'], Blockly.ALIGN_RIGHT],
|
190
|
+
Blockly.ALIGN_RIGHT)
|
190
191
|
@setInputsInline(true)
|
191
192
|
@setOutput(true, 'Number')
|
192
193
|
@setTooltip('')
|
@@ -203,9 +204,9 @@ Blockly.Blocks['<%= n %>'] =
|
|
203
204
|
init: ()->
|
204
205
|
@setHelpUrl('')
|
205
206
|
@setColour(<%= color %>)
|
206
|
-
@interpolateMsg('
|
207
|
-
|
208
|
-
|
207
|
+
@interpolateMsg(<%= bm('.round') %>,
|
208
|
+
['A', ['Number'], Blockly.ALIGN_RIGHT],
|
209
|
+
Blockly.ALIGN_RIGHT)
|
209
210
|
@setInputsInline(true)
|
210
211
|
@setOutput(true, 'Number')
|
211
212
|
@setTooltip('')
|
@@ -220,29 +221,28 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
220
221
|
Blockly.Blocks['<%= n %>'] =
|
221
222
|
init: ()->
|
222
223
|
dropdown = [
|
223
|
-
['
|
224
|
-
['
|
225
|
-
['
|
226
|
-
['
|
227
|
-
['
|
228
|
-
['
|
229
|
-
['
|
230
|
-
['
|
231
|
-
['
|
232
|
-
['
|
233
|
-
['
|
234
|
-
['
|
235
|
-
['
|
236
|
-
['
|
224
|
+
[<%= bm('.math_method_abs') %>, '%num%.abs'],
|
225
|
+
[<%= bm('.math_method_floor') %>, '%num%.floor'],
|
226
|
+
[<%= bm('.math_method_ceil') %>, '%num%.ceil'],
|
227
|
+
[<%= bm('.math_method_sqrt') %>, 'Math.sqrt(%num%)'],
|
228
|
+
[<%= bm('.math_method_sin') %>, 'Math.sin(%num%)'],
|
229
|
+
[<%= bm('.math_method_cos') %>, 'Math.cos(%num%)'],
|
230
|
+
[<%= bm('.math_method_tan') %>, 'Math.tan(%num%)'],
|
231
|
+
[<%= bm('.math_method_asin') %>, 'Math.asin(%num%)'],
|
232
|
+
[<%= bm('.math_method_acos') %>, 'Math.acos(%num%)'],
|
233
|
+
[<%= bm('.math_method_atan') %>, 'Math.atan(%num%)'],
|
234
|
+
[<%= bm('.math_method_ln') %>, 'Math.log(%num%)'],
|
235
|
+
[<%= bm('.math_method_log') %>, 'Math.log10(%num%)'],
|
236
|
+
[<%= bm('.math_method_e_square') %>, 'Math::E ** %num%'],
|
237
|
+
[<%= bm('.math_method_10_square') %>, '10 ** %num%'],
|
237
238
|
]
|
238
239
|
|
239
240
|
@setHelpUrl('')
|
240
241
|
@setColour(<%= color %>)
|
241
|
-
@
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
.appendField(new Blockly.FieldDropdown(dropdown), 'METHOD')
|
242
|
+
@interpolateMsg(<%= bm('.math_method') %>,
|
243
|
+
['NUM', ['Number'], Blockly.ALIGN_RIGHT],
|
244
|
+
['METHOD', ['Dropdown', dropdown], Blockly.ALIGN_RIGHT],
|
245
|
+
Blockly.ALIGN_RIGHT)
|
246
246
|
@setInputsInline(true)
|
247
247
|
@setOutput(true, 'Number')
|
248
248
|
@setTooltip('')
|
@@ -256,10 +256,7 @@ Blockly.Ruby['<%= n %>'] = (block) ->
|
|
256
256
|
# 条件:真
|
257
257
|
# 条件:偽
|
258
258
|
<%
|
259
|
-
|
260
|
-
['true', '真'],
|
261
|
-
['false', '偽'],
|
262
|
-
].each do |val, label|
|
259
|
+
%w(true false).each do |val|
|
263
260
|
n = "#{category}_#{val}"
|
264
261
|
%>
|
265
262
|
|
@@ -268,7 +265,7 @@ Blockly.Blocks['<%= n %>'] =
|
|
268
265
|
@setHelpUrl('')
|
269
266
|
@setColour(<%= color %>)
|
270
267
|
@appendDummyInput()
|
271
|
-
.appendField(
|
268
|
+
.appendField(<%= bm(".#{val}")%>)
|
272
269
|
@setInputsInline(true)
|
273
270
|
@setOutput(true, 'Boolean')
|
274
271
|
@setTooltip('')
|