smalruby-editor 0.3.5-x86-mingw32 → 0.4.0-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 +1 -0
- data/.simplecov +7 -7
- data/.travis.yml +0 -0
- data/Guardfile +1 -1
- data/LICENSE +0 -0
- data/Procfile +1 -1
- data/Rakefile +0 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/blocks/blockly.js.coffee.erb +0 -0
- data/app/assets/javascripts/blocks/character.js.coffee.erb +3 -0
- 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/field_character.js.coffee.erb +13 -1
- data/app/assets/javascripts/blocks/field_costume.js.coffee.erb +84 -0
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +26 -0
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +32 -0
- data/app/assets/javascripts/collections/.keep +0 -0
- data/app/assets/javascripts/collections/character_set.js.coffee +0 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +10 -1
- data/app/assets/javascripts/models/.keep +0 -0
- data/app/assets/javascripts/models/character.js.coffee +45 -6
- data/app/assets/javascripts/models/scene.js.coffee +0 -0
- data/app/assets/javascripts/msg/en_us.js +4 -0
- data/app/assets/javascripts/msg/ja.js +4 -0
- data/app/assets/javascripts/routers/.keep +0 -0
- data/app/assets/javascripts/smalruby.js.coffee.erb +5 -1
- data/app/assets/javascripts/views/.keep +0 -0
- data/app/assets/javascripts/views/character_modal_view.js.coffee.erb +357 -0
- data/app/assets/javascripts/views/character_selector_view.js.coffee +2 -0
- data/app/assets/stylesheets/editor.css.scss +201 -16
- data/app/assets/stylesheets/flatstrap-custom.css.scss +0 -0
- data/app/assets/stylesheets/load-modal.css.scss +0 -0
- data/app/assets/templates/.keep +0 -0
- data/app/controllers/application_controller.rb +8 -2
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/costumes_controller.rb +58 -0
- data/app/controllers/editor_controller.rb +2 -0
- data/app/helpers/costumes_helper.rb +2 -0
- data/app/helpers/editor_helper.rb +0 -0
- data/app/helpers/sessions_helper.rb +0 -4
- 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 +2 -0
- data/app/models/concerns/ruby_to_block/block/character.rb +32 -11
- 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_pressed_or_released.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_turn_off.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_led_turn_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_neo_pixel_set_rgb.rb +31 -0
- data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_set_color.rb +0 -0
- data/app/models/concerns/ruby_to_block/block/hardware_rgb_led_turn_off.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_next_costume.rb +12 -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_switch_costume.rb +22 -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_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/costume.rb +67 -0
- data/app/models/source_code.rb +9 -1
- data/app/models/user.rb +7 -0
- data/app/views/costumes/index.html.haml +19 -0
- data/app/views/editor/_character_modal.html.haml +35 -7
- data/app/views/editor/_toolbox_default.html.haml +9 -0
- data/app/views/editor/demo.html.erb +0 -0
- data/app/views/editor/index.html.haml +1 -0
- data/bin/smalruby-editor +1 -0
- data/bin/spring +7 -9
- data/config.ru +0 -0
- 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 +0 -0
- 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 +10 -1
- data/config/locales/ja.yml +10 -0
- data/config/routes.rb +2 -0
- data/config/unicorn.rb +23 -23
- data/db/migrate/20131216121603_create_source_codes.rb +0 -0
- data/db/migrate/20131219045113_add_filename_to_source_code.rb +0 -0
- data/db/migrate/20150513061250_add_index_name_on_users.rb +1 -1
- data/db/migrate/20150607012053_create_costumes.rb +12 -0
- data/db/migrate/20150607012707_add_indexes_on_costumes.rb +13 -0
- data/db/migrate/20150607034013_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
- data/db/migrate/20150607034014_add_missing_unique_indices.acts_as_taggable_on_engine.rb +21 -0
- data/db/migrate/20150607034015_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20150607034016_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20150607034017_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +12 -0
- data/db/migrate/20150607034018_insert_preset_costumes.rb +9 -0
- data/db/schema.rb +35 -2
- data/db/seeds.rb +2 -0
- data/demos/car_chase.rb.xml +128 -128
- data/demos/pong.rb.xml +379 -379
- data/demos/star.rb.xml +115 -115
- data/lib/assets/.keep +0 -0
- data/lib/smalruby_editor/version.rb +1 -1
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/gem.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/handopen.cur +0 -0
- data/public/blockly/media/quote0.png +0 -0
- data/public/blockly/media/quote1.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 +2 -1
- data/spec/acceptance/block_mode/blocks/character/new.feature +5 -5
- data/spec/acceptance/block_mode/blocks/control/await.feature +2 -2
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +3 -3
- 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 +2 -2
- data/spec/acceptance/block_mode/blocks/events/on_hit.feature +4 -4
- data/spec/acceptance/block_mode/blocks/events/on_key_push_or_down.feature +4 -4
- data/spec/acceptance/block_mode/blocks/events/on_start.feature +2 -2
- data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +1 -1
- data/spec/acceptance/block_mode/blocks/hardware/led_turn_off.feature +2 -2
- data/spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature +2 -2
- 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/neo_pixel_set_rgb.feature +100 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.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/smalrubot_s1_action_with_sec.feature +1 -1
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_led_turn_on_or_off.feature +1 -1
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action_with_sec.feature +1 -1
- 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 +2 -2
- data/spec/acceptance/block_mode/blocks/looks/next_costume.feature +56 -0
- data/spec/acceptance/block_mode/blocks/looks/say.feature +3 -3
- data/spec/acceptance/block_mode/blocks/looks/show.feature +2 -2
- data/spec/acceptance/block_mode/blocks/looks/vanish.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/change_x_by.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/change_y_by.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/move.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/reach_wall.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/rotate_left.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/rotate_right.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/self_angle.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/self_x.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/self_y.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/set_angle.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/set_x.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/set_x_y.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/set_y.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/turn.feature +2 -2
- data/spec/acceptance/block_mode/blocks/motion/turn_if_reach_wall.feature +2 -2
- 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 +2 -2
- data/spec/acceptance/block_mode/blocks/sensing/hit.feature +6 -6
- 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 +2 -2
- data/spec/acceptance/block_mode/blocks/sensing/time_now.feature +0 -0
- data/spec/acceptance/block_mode/blocks/sound/play.feature +2 -2
- data/spec/acceptance/block_mode/character_modal_view.feature +164 -0
- data/spec/acceptance/block_mode/demo.feature +2 -2
- 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/load.feature +0 -0
- data/spec/acceptance/ruby_mode/translate.feature +2 -2
- data/spec/acceptance/standalone/preference.feature +8 -8
- data/spec/acceptance/standalone/run.feature +0 -0
- data/spec/acceptance/standalone/save.feature +1 -1
- data/spec/acceptance/standalone/signin.feature +1 -1
- 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/extra_car.png +0 -0
- data/spec/fixtures/files/favicon.ico +0 -0
- data/spec/helpers/editor_helper_spec.rb +0 -0
- data/spec/javascripts/collections/character_set_spec.coffee +0 -0
- data/spec/javascripts/models/character_spec.coffee +2 -14
- data/spec/javascripts/models/scene_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/character_spec.rb +71 -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 +6 -6
- data/spec/models/concerns/ruby_to_block/block/hardware__neo_pixel_spec.rb +77 -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 +26 -2
- 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 +2 -2
- 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/spec_helper.rb +21 -10
- 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/standalone_steps.rb +3 -3
- data/spec/steps/then_steps.rb +28 -0
- data/spec/steps/when_steps.rb +15 -18
- 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/jquery.blockUI.js +0 -0
- data/vendor/assets/stylesheets/.keep +0 -0
- metadata +56 -14
- data/app/assets/javascripts/views/character_modal_view.js.coffee +0 -194
@@ -11,8 +11,8 @@
|
|
11
11
|
"""
|
12
12
|
require "smalruby"
|
13
13
|
|
14
|
-
car1 = Character.new(costume: "car2.png", x: 0, y: 0, angle: 0)
|
15
|
-
car2 = Character.new(costume: "car4.png", x: 0, y: 415, angle: 0)
|
14
|
+
car1 = Character.new(costume: "costume1:car2.png", x: 0, y: 0, angle: 0)
|
15
|
+
car2 = Character.new(costume: "costume1:car4.png", x: 0, y: 415, angle: 0)
|
16
16
|
# 車のおいかけっこ
|
17
17
|
|
18
18
|
# 逃げる車
|
File without changes
|
data/spec/acceptance/readme.md
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"""
|
12
12
|
require "smalruby"
|
13
13
|
|
14
|
-
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
14
|
+
car1 = Character.new(costume: "costume1:car1.png", x: 0, y: 0, angle: 0)
|
15
15
|
|
16
16
|
car1.on(:start) do
|
17
17
|
loop do
|
@@ -28,7 +28,7 @@
|
|
28
28
|
ならば 次のXMLと同等のブロックが配置されていること:
|
29
29
|
"""
|
30
30
|
<xml>
|
31
|
-
<character x="0" y="0" name="car1" costumes="car1.png" angle="0"></character>
|
31
|
+
<character x="0" y="0" name="car1" costumes="costume1:car1.png" angle="0"></character>
|
32
32
|
<block type="character_new" id="1" x="0" y="0">
|
33
33
|
<field name="NAME">car1</field>
|
34
34
|
<statement name="DO">
|
@@ -8,12 +8,12 @@ Feature: Preference - 設定
|
|
8
8
|
And '/' にアクセスする
|
9
9
|
|
10
10
|
Scenario: ログインして設定ダイアログを表示する
|
11
|
-
When "submenu-button" をクリックする
|
11
|
+
When "#submenu-button" をクリックする
|
12
12
|
|
13
13
|
Then "#submenu" に "#preference-button" が表示されていないこと
|
14
14
|
|
15
15
|
When ログインする
|
16
|
-
And "submenu-button" をクリックする
|
16
|
+
And "#submenu-button" をクリックする
|
17
17
|
|
18
18
|
Then "#submenu" に "#preference-button" が表示されていること
|
19
19
|
|
@@ -22,13 +22,13 @@ Feature: Preference - 設定
|
|
22
22
|
|
23
23
|
Then "#preference-modal" が表示されていること
|
24
24
|
|
25
|
-
When "preference-modal-ok-button" をクリックする
|
25
|
+
When "#preference-modal-ok-button" をクリックする
|
26
26
|
And JavaScriptによるリクエストが終わるまで待つ
|
27
27
|
|
28
28
|
Then "#preference-modal" が表示されていないこと
|
29
29
|
|
30
30
|
When ログアウトする
|
31
|
-
And "submenu-button" をクリックする
|
31
|
+
And "#submenu-button" をクリックする
|
32
32
|
|
33
33
|
Then "#submenu" に "#preference-button" が表示されていないこと
|
34
34
|
|
@@ -48,7 +48,7 @@ Feature: Preference - 設定
|
|
48
48
|
When "user[preferences][toolbox__default__enabled_hardware_blocks]" をチェックする
|
49
49
|
And "user[preferences][toolbox__default__enabled_smalrubot_v3_blocks]" をチェックする
|
50
50
|
And "user[preferences][toolbox__default__enabled_smalrubot_s1_blocks]" をチェックする
|
51
|
-
And "preference-modal-ok-button" をクリックする
|
51
|
+
And "#preference-modal-ok-button" をクリックする
|
52
52
|
And JavaScriptによるリクエストが終わるまで待つ
|
53
53
|
|
54
54
|
Then "#preference-modal" が表示されていないこと
|
@@ -78,7 +78,7 @@ Feature: Preference - 設定
|
|
78
78
|
And "user[preferences][disabled_new_character]" をチェックする
|
79
79
|
And "user[preferences][enabled_readonly_ruby_mode]" をチェックする
|
80
80
|
And "user[preferences][hardware_port]" フィールドに "COM3" を指定する
|
81
|
-
And "preference-modal-ok-button" をクリックする
|
81
|
+
And "#preference-modal-ok-button" をクリックする
|
82
82
|
And JavaScriptによるリクエストが終わるまで待つ
|
83
83
|
|
84
84
|
Then "#preference-modal" が表示されていないこと
|
@@ -95,7 +95,7 @@ Feature: Preference - 設定
|
|
95
95
|
When ログインする
|
96
96
|
And サブメニューの "#preference-button" をクリックする
|
97
97
|
And "user[preferences][disabled_new_character]" をチェックする
|
98
|
-
And "preference-modal-ok-button" をクリックする
|
98
|
+
And "#preference-modal-ok-button" をクリックする
|
99
99
|
And JavaScriptによるリクエストが終わるまで待つ
|
100
100
|
|
101
101
|
Then "#preference-modal" が表示されていないこと
|
@@ -109,7 +109,7 @@ Feature: Preference - 設定
|
|
109
109
|
When ログインする
|
110
110
|
And サブメニューの "#preference-button" をクリックする
|
111
111
|
And "user[preferences][enabled_readonly_ruby_mode]" をチェックする
|
112
|
-
And "preference-modal-ok-button" をクリックする
|
112
|
+
And "#preference-modal-ok-button" をクリックする
|
113
113
|
And JavaScriptによるリクエストが終わるまで待つ
|
114
114
|
|
115
115
|
Then "#preference-modal" が表示されていないこと
|
File without changes
|
@@ -71,7 +71,7 @@
|
|
71
71
|
かつ ホームディレクトリの "<保存したファイルの名前>" が次の内容であること:
|
72
72
|
"""
|
73
73
|
<xml>
|
74
|
-
<character x="300" y="200" name="car1" costumes="car4.png" angle="90"></character>
|
74
|
+
<character x="300" y="200" name="car1" costumes="costume1:car4.png" angle="90"></character>
|
75
75
|
<block type="character_new" id="1" x="0" y="0">
|
76
76
|
<field name="NAME">car1</field>
|
77
77
|
<statement name="DO">
|
File without changes
|
data/spec/fixtures/files/01.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
@@ -91,20 +91,8 @@ describe 'Smalruby.Character', ->
|
|
91
91
|
expect(self.costume()).to.equal('car1.png')
|
92
92
|
|
93
93
|
describe '#costumeUrl', ->
|
94
|
-
|
95
|
-
|
96
|
-
expect(self.costumeUrl()).to.equal('/smalruby/assets/car1.png')
|
97
|
-
|
98
|
-
describe 'プリセットではない場合', ->
|
99
|
-
beforeEach ->
|
100
|
-
self = new klass
|
101
|
-
costumes: [
|
102
|
-
'http://example.com/car1.png'
|
103
|
-
'http://example.com/car2.png'
|
104
|
-
]
|
105
|
-
|
106
|
-
it 'costumeの値であること', ->
|
107
|
-
expect(self.costumeUrl()).to.equal(self.costume())
|
94
|
+
it 'プレフィックスが/smalruby/assets/であること', ->
|
95
|
+
expect(self.costumeUrl()).to.equal('/smalruby/assets/car1.png')
|
108
96
|
|
109
97
|
describe '#nextCostume', ->
|
110
98
|
it 'costumeIndexをインクリメントすること', ->
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
require_relative 'shared/block_examples'
|
4
|
+
|
5
|
+
# rubocop:disable EmptyLines, LineLength
|
6
|
+
|
7
|
+
describe RubyToBlock::Block::Character, to_blocks: true do
|
8
|
+
parts = <<-EOS
|
9
|
+
require "smalruby"
|
10
|
+
|
11
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
12
|
+
EOS
|
13
|
+
describe compact_source_code(parts) do
|
14
|
+
_parts = parts
|
15
|
+
let(:data) { _parts }
|
16
|
+
|
17
|
+
it '結果が正しいこと' do
|
18
|
+
should eq_block_xml(<<-XML)
|
19
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
20
|
+
XML
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
parts = <<-EOS
|
25
|
+
require "smalruby"
|
26
|
+
|
27
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0, rotation_style: :left_right)
|
28
|
+
EOS
|
29
|
+
describe compact_source_code(parts) do
|
30
|
+
_parts = parts
|
31
|
+
let(:data) { _parts }
|
32
|
+
|
33
|
+
it '結果が正しいこと' do
|
34
|
+
should eq_block_xml(<<-XML)
|
35
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" rotation_style="left_right" />
|
36
|
+
XML
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
parts = <<-EOS
|
41
|
+
require "smalruby"
|
42
|
+
|
43
|
+
car1 = Character.new(costume: ["car1.png", "car2.png"], x: 0, y: 0, angle: 0)
|
44
|
+
EOS
|
45
|
+
describe compact_source_code(parts) do
|
46
|
+
_parts = parts
|
47
|
+
let(:data) { _parts }
|
48
|
+
|
49
|
+
it '結果が正しいこと' do
|
50
|
+
should eq_block_xml(<<-XML)
|
51
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png,car2.png" />
|
52
|
+
XML
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
parts = <<-EOS
|
57
|
+
require "smalruby"
|
58
|
+
|
59
|
+
car1 = Character.new(costume: ["car1.png", "car2.png"], costume_index: 1, x: 0, y: 0, angle: 0)
|
60
|
+
EOS
|
61
|
+
describe compact_source_code(parts) do
|
62
|
+
_parts = parts
|
63
|
+
let(:data) { _parts }
|
64
|
+
|
65
|
+
it '結果が正しいこと' do
|
66
|
+
should eq_block_xml(<<-XML)
|
67
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png,car2.png" costume_index="1" />
|
68
|
+
XML
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
File without changes
|
File without changes
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
end
|
23
23
|
|
24
24
|
parts = <<-EOS
|
25
|
-
cat1 = Character.new(costume: "cat1.png", x: 200, y: 150, angle: 90)
|
25
|
+
cat1 = Character.new(costume: "costume1:cat1.png", x: 200, y: 150, angle: 90)
|
26
26
|
|
27
27
|
car1.on(:start) do
|
28
28
|
|
@@ -43,8 +43,8 @@ end
|
|
43
43
|
|
44
44
|
it '結果が正しいこと' do
|
45
45
|
should eq_block_xml(<<-XML)
|
46
|
-
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
47
|
-
<character name="cat1" x="200" y="150" angle="90" costumes="cat1.png" />
|
46
|
+
<character name="car1" x="0" y="0" angle="0" costumes="costume1:car1.png" />
|
47
|
+
<character name="cat1" x="200" y="150" angle="90" costumes="costume1:cat1.png" />
|
48
48
|
<block type="character_new">
|
49
49
|
<field name="NAME">car1</field>
|
50
50
|
<statement name="DO">
|
@@ -66,7 +66,7 @@ end
|
|
66
66
|
end
|
67
67
|
|
68
68
|
parts = <<-EOS
|
69
|
-
cat1 = Character.new(costume: "cat1.png", x: 200, y: 150, angle: 90)
|
69
|
+
cat1 = Character.new(costume: "costume1:cat1.png", x: 200, y: 150, angle: 90)
|
70
70
|
|
71
71
|
car1.on(:start) do
|
72
72
|
|
@@ -81,8 +81,8 @@ end
|
|
81
81
|
|
82
82
|
it '結果が正しいこと' do
|
83
83
|
should eq_block_xml(<<-XML)
|
84
|
-
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
85
|
-
<character name="cat1" x="200" y="150" angle="90" costumes="cat1.png" />
|
84
|
+
<character name="car1" x="0" y="0" angle="0" costumes="costume1:car1.png" />
|
85
|
+
<character name="cat1" x="200" y="150" angle="90" costumes="costume1:cat1.png" />
|
86
86
|
<block type="character_new">
|
87
87
|
<field name="NAME">car1</field>
|
88
88
|
<statement name="DO">
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
require_relative 'shared/block_examples'
|
4
|
+
|
5
|
+
# rubocop:disable EmptyLines, LineLength
|
6
|
+
|
7
|
+
describe RubyToBlock::Block, 'NeoPixel blocks', to_blocks: true do
|
8
|
+
parts = <<-EOS
|
9
|
+
require "smalruby"
|
10
|
+
|
11
|
+
init_hardware
|
12
|
+
|
13
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
14
|
+
|
15
|
+
car1.on(:start) do
|
16
|
+
neo_pixel("D5").set(color: [0, 128, 255])
|
17
|
+
end
|
18
|
+
car1.neo_pixel("D5").set(color: [0, 128, 255])
|
19
|
+
EOS
|
20
|
+
describe compact_source_code(parts) do
|
21
|
+
_parts = parts
|
22
|
+
let(:data) { _parts }
|
23
|
+
|
24
|
+
it '結果が正しいこと' do
|
25
|
+
should eq_block_xml(<<-XML)
|
26
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
27
|
+
<block type="character_new">
|
28
|
+
<field name="NAME">car1</field>
|
29
|
+
<statement name="DO">
|
30
|
+
<block type="events_on_start">
|
31
|
+
<statement name="DO">
|
32
|
+
<block type="hardware_neo_pixel_set_rgb">
|
33
|
+
<field name="PIN">D5</field>
|
34
|
+
<value name="RED">
|
35
|
+
<block type="math_number">
|
36
|
+
<field name="NUM">0</field>
|
37
|
+
</block>
|
38
|
+
</value>
|
39
|
+
<value name="GREEN">
|
40
|
+
<block type="math_number">
|
41
|
+
<field name="NUM">128</field>
|
42
|
+
</block>
|
43
|
+
</value>
|
44
|
+
<value name="BLUE">
|
45
|
+
<block type="math_number">
|
46
|
+
<field name="NUM">255</field>
|
47
|
+
</block>
|
48
|
+
</value>
|
49
|
+
</block>
|
50
|
+
</statement>
|
51
|
+
<next>
|
52
|
+
<block type="hardware_neo_pixel_set_rgb">
|
53
|
+
<field name="PIN">D5</field>
|
54
|
+
<value name="RED">
|
55
|
+
<block type="math_number">
|
56
|
+
<field name="NUM">0</field>
|
57
|
+
</block>
|
58
|
+
</value>
|
59
|
+
<value name="GREEN">
|
60
|
+
<block type="math_number">
|
61
|
+
<field name="NUM">128</field>
|
62
|
+
</block>
|
63
|
+
</value>
|
64
|
+
<value name="BLUE">
|
65
|
+
<block type="math_number">
|
66
|
+
<field name="NUM">255</field>
|
67
|
+
</block>
|
68
|
+
</value>
|
69
|
+
</block>
|
70
|
+
</next>
|
71
|
+
</block>
|
72
|
+
</statement>
|
73
|
+
</block>
|
74
|
+
XML
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
File without changes
|
@@ -11,11 +11,15 @@ car1.on(:start) do
|
|
11
11
|
self.visible = true
|
12
12
|
self.visible = false
|
13
13
|
vanish
|
14
|
+
next_costume
|
15
|
+
switch_costume("costume1")
|
14
16
|
end
|
15
17
|
car1.say(message: "こんにちは!")
|
16
18
|
car1.visible = true
|
17
19
|
car1.visible = false
|
18
20
|
car1.vanish
|
21
|
+
car1.next_costume
|
22
|
+
car1.switch_costume("costume1")
|
19
23
|
EOS
|
20
24
|
describe compact_source_code(parts), character_new_data: true do
|
21
25
|
_parts = parts
|
@@ -38,7 +42,17 @@ car1.vanish
|
|
38
42
|
<next>
|
39
43
|
<block type="looks_hide">
|
40
44
|
<next>
|
41
|
-
<block type="looks_vanish"
|
45
|
+
<block type="looks_vanish">
|
46
|
+
<next>
|
47
|
+
<block type="looks_next_costume">
|
48
|
+
<next>
|
49
|
+
<block type="looks_switch_costume">
|
50
|
+
<field name="COSTUME">costume1</field>
|
51
|
+
</block>
|
52
|
+
</next>
|
53
|
+
</block>
|
54
|
+
</next>
|
55
|
+
</block>
|
42
56
|
</next>
|
43
57
|
</block>
|
44
58
|
</next>
|
@@ -58,7 +72,17 @@ car1.vanish
|
|
58
72
|
<next>
|
59
73
|
<block type="looks_hide">
|
60
74
|
<next>
|
61
|
-
<block type="looks_vanish"
|
75
|
+
<block type="looks_vanish">
|
76
|
+
<next>
|
77
|
+
<block type="looks_next_costume">
|
78
|
+
<next>
|
79
|
+
<block type="looks_switch_costume">
|
80
|
+
<field name="COSTUME">costume1</field>
|
81
|
+
</block>
|
82
|
+
</next>
|
83
|
+
</block>
|
84
|
+
</next>
|
85
|
+
</block>
|
62
86
|
</next>
|
63
87
|
</block>
|
64
88
|
</next>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -9,7 +9,7 @@ shared_context ':character_new_data', character_new_data: true do
|
|
9
9
|
<<-EOS.strip_heredoc
|
10
10
|
require "smalruby"
|
11
11
|
|
12
|
-
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
12
|
+
car1 = Character.new(costume: "costume1:car1.png", x: 0, y: 0, angle: 0)
|
13
13
|
#{parts}
|
14
14
|
EOS
|
15
15
|
}
|
@@ -20,7 +20,7 @@ shared_context ':on_start_data', on_start_data: true do
|
|
20
20
|
<<-EOS.strip_heredoc
|
21
21
|
require "smalruby"
|
22
22
|
|
23
|
-
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
23
|
+
car1 = Character.new(costume: "costume1:car1.png", x: 0, y: 0, angle: 0)
|
24
24
|
|
25
25
|
car1.on(:start) do
|
26
26
|
#{parts.lines.join(' ')}
|