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
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -94,22 +94,14 @@ RSpec.configure do |config|
|
|
94
94
|
}
|
95
95
|
end
|
96
96
|
|
97
|
+
Capybara.asset_host = "http://localhost:3000"
|
98
|
+
|
97
99
|
config.include JsonSpec::Helpers
|
98
100
|
config.include ERB::Util, type: :helper
|
99
101
|
config.include ERB::Util, type: :feature
|
100
102
|
config.include ActionView::Helpers::JavaScriptHelper, type: :feature
|
101
103
|
config.include FeatureHelper, type: :feature
|
102
104
|
|
103
|
-
config.before(:each) do
|
104
|
-
Preference.user_defaults.each do |key, value|
|
105
|
-
Preference[key] = value
|
106
|
-
end
|
107
|
-
Preference.admin_defaults.each do |key, value|
|
108
|
-
Preference[key] = value
|
109
|
-
end
|
110
|
-
Preference["disabled_add_character_from_beginning"] = true
|
111
|
-
end
|
112
|
-
|
113
105
|
config.after(javascript: true) do
|
114
106
|
page.execute_script('window.onbeforeunload = null')
|
115
107
|
FileUtils.rm_rf(downloads_dir) if selenium?
|
@@ -136,7 +128,26 @@ RSpec.configure do |config|
|
|
136
128
|
DatabaseRewinder.clean_all
|
137
129
|
end
|
138
130
|
|
131
|
+
config.before(:each) do
|
132
|
+
Preference.user_defaults.each do |key, value|
|
133
|
+
Preference[key] = value
|
134
|
+
end
|
135
|
+
Preference.admin_defaults.each do |key, value|
|
136
|
+
Preference[key] = value
|
137
|
+
end
|
138
|
+
Preference["disabled_add_character_from_beginning"] = true
|
139
|
+
|
140
|
+
load(Rails.root.join("db/seeds.rb"))
|
141
|
+
end
|
142
|
+
|
139
143
|
config.after :each do
|
140
144
|
DatabaseRewinder.clean
|
141
145
|
end
|
146
|
+
|
147
|
+
# for debug
|
148
|
+
config.after(:each, javascript: true, open_on_error: true) do
|
149
|
+
if example.exception.present?
|
150
|
+
save_and_open_page
|
151
|
+
end
|
152
|
+
end
|
142
153
|
end
|
File without changes
|
data/spec/steps/fix_turnip.rb
CHANGED
File without changes
|
File without changes
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
step ":name としてログインする" do |name|
|
4
|
-
step %{"signin-button" をクリックする}
|
4
|
+
step %{"#signin-button" をクリックする}
|
5
5
|
step %{JavaScriptによるアニメーションが終わるまで待つ}
|
6
6
|
step %{"signin-modal-username" に "#{name}" を指定する}
|
7
|
-
step %{"signin-modal-ok-button" をクリックする}
|
7
|
+
step %{"#signin-modal-ok-button" をクリックする}
|
8
8
|
step %{JavaScriptによるリクエストが終わるまで待つ}
|
9
9
|
step %{JavaScriptによるアニメーションが終わるまで待つ}
|
10
10
|
end
|
@@ -14,7 +14,7 @@ step "ログインする" do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
step "ログアウトする" do
|
17
|
-
step %{"submenu-button" をクリックする}
|
17
|
+
step %{"#submenu-button" をクリックする}
|
18
18
|
step %{サブメニューの "#signout-button" をクリックする}
|
19
19
|
step %{JavaScriptによるリクエストが終わるまで待つ}
|
20
20
|
step %{"#main-menu" に "ログイン" を含むこと}
|
data/spec/steps/then_steps.rb
CHANGED
@@ -20,6 +20,34 @@ step ':parent に :name が表示されていないこと' do |parent, name|
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
step ':parent に次の要素が表示されていること:' do |parent, table|
|
24
|
+
within(name_to(parent)) do
|
25
|
+
table.hashes.each do |h|
|
26
|
+
expect(page.all(name_to(h["selecter"]), visible: true)).not_to be_empty
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
step ':parent に次の要素が表示されていないこと:' do |parent, table|
|
32
|
+
within(name_to(parent)) do
|
33
|
+
table.hashes.each do |h|
|
34
|
+
expect(page.all(name_to(h["selecter"]), visible: true)).to be_empty
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
step ':parent に文字 :text が表示されていること' do |parent, text|
|
40
|
+
within(name_to(parent)) do
|
41
|
+
expect(page).to have_content(text)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
step ':parent に文字 :text が表示されていないこと' do |parent, text|
|
46
|
+
within(name_to(parent)) do
|
47
|
+
expect(page).not_to have_content(text)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
23
51
|
step 'コンボボックス :name の :option_label を選択していること' do
|
24
52
|
|name, option_label|
|
25
53
|
expect(find(%{select[name="#{name}"] option[selected]}).text)
|
data/spec/steps/when_steps.rb
CHANGED
@@ -57,17 +57,17 @@ step 'プログラムの名前に :filename を指定する' do |filename|
|
|
57
57
|
step %("プログラム名の入力欄" に "#{filename}" を指定する)
|
58
58
|
end
|
59
59
|
|
60
|
-
step '
|
60
|
+
step ':selector をクリックする' do |selector|
|
61
61
|
# HACK: 以下では期待通りの動作にならなかったのでjQueryで無理やり実現した
|
62
62
|
# click_on('submenu-button')
|
63
63
|
# click_on(name_to(name, :id))
|
64
|
-
page.execute_script("$('#{name_to(
|
65
|
-
step %{JavaScriptによるリクエストが終わるまで待つ}
|
66
|
-
step %{JavaScriptによるアニメーションが終わるまで待つ}
|
64
|
+
page.execute_script("$('#{name_to(selector)}').click()")
|
67
65
|
end
|
68
66
|
|
69
|
-
step ':
|
70
|
-
|
67
|
+
step 'サブメニューの :selector をクリックする' do |selector|
|
68
|
+
step %{"#{selector}" をクリックする}
|
69
|
+
step %{JavaScriptによるリクエストが終わるまで待つ}
|
70
|
+
step %{JavaScriptによるアニメーションが終わるまで待つ}
|
71
71
|
end
|
72
72
|
|
73
73
|
step 'ダウンロードが完了するまで待つ' do
|
@@ -88,16 +88,19 @@ step ':name にフォーカスを移す' do |name|
|
|
88
88
|
JS
|
89
89
|
end
|
90
90
|
|
91
|
-
step ':filename
|
92
|
-
step '"ロードボタン" にフォーカスを移す'
|
93
|
-
|
91
|
+
step ':field フィールドにファイル :filename を設定する' do |field, filename|
|
94
92
|
# HACK: input#load-file[type="file"]は非表示要素であるため、.show()し
|
95
93
|
# ないと見つけられずattach_fileが失敗する
|
96
|
-
page.execute_script("$('
|
94
|
+
page.execute_script("$('##{field}').show()")
|
97
95
|
|
98
96
|
path = Pathname(fixture_path).join(filename).to_s
|
99
97
|
path.gsub!(File::SEPARATOR, File::ALT_SEPARATOR) if windows?
|
100
|
-
attach_file(
|
98
|
+
attach_file(field, path)
|
99
|
+
end
|
100
|
+
|
101
|
+
step ':filename をロードする' do |filename|
|
102
|
+
step '"ロードボタン" にフォーカスを移す'
|
103
|
+
step %{'load-file' フィールドにファイル '#{filename}' を設定する}
|
101
104
|
end
|
102
105
|
|
103
106
|
step 'ページをリロードする' do
|
@@ -199,11 +202,5 @@ end
|
|
199
202
|
# rubocop:enable Eval
|
200
203
|
|
201
204
|
step 'ページを表示する' do
|
202
|
-
|
203
|
-
end
|
204
|
-
|
205
|
-
steps_for :debug do
|
206
|
-
step 'ページを表示する' do
|
207
|
-
save_and_open_page
|
208
|
-
end
|
205
|
+
save_and_open_page
|
209
206
|
end
|
data/spec/support/capybara.rb
CHANGED
File without changes
|
data/spec/support/env.rb
CHANGED
File without changes
|
File without changes
|
data/spec/teaspoon_env.rb
CHANGED
File without changes
|
data/spec/turnip_helper.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smalruby-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Kouji Takao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -192,20 +192,34 @@ dependencies:
|
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: acts-as-taggable-on
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '3.4'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '3.4'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
210
|
name: smalruby
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - "~>"
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.1.
|
215
|
+
version: 0.1.10
|
202
216
|
type: :runtime
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.1.
|
222
|
+
version: 0.1.10
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
224
|
name: bundler
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,6 +282,7 @@ files:
|
|
268
282
|
- app/assets/javascripts/blocks/etc.js.coffee.erb
|
269
283
|
- app/assets/javascripts/blocks/events.js.coffee.erb
|
270
284
|
- app/assets/javascripts/blocks/field_character.js.coffee.erb
|
285
|
+
- app/assets/javascripts/blocks/field_costume.js.coffee.erb
|
271
286
|
- app/assets/javascripts/blocks/hardware.js.coffee.erb
|
272
287
|
- app/assets/javascripts/blocks/looks.js.coffee.erb
|
273
288
|
- app/assets/javascripts/blocks/motion.js.coffee.erb
|
@@ -289,7 +304,7 @@ files:
|
|
289
304
|
- app/assets/javascripts/routers/.keep
|
290
305
|
- app/assets/javascripts/smalruby.js.coffee.erb
|
291
306
|
- app/assets/javascripts/views/.keep
|
292
|
-
- app/assets/javascripts/views/character_modal_view.js.coffee
|
307
|
+
- app/assets/javascripts/views/character_modal_view.js.coffee.erb
|
293
308
|
- app/assets/javascripts/views/character_selector_view.js.coffee
|
294
309
|
- app/assets/javascripts/views/load_modal_view.js.coffee.erb
|
295
310
|
- app/assets/javascripts/views/main_menu_view.js.coffee.erb
|
@@ -305,11 +320,13 @@ files:
|
|
305
320
|
- app/assets/templates/.keep
|
306
321
|
- app/controllers/application_controller.rb
|
307
322
|
- app/controllers/concerns/.keep
|
323
|
+
- app/controllers/costumes_controller.rb
|
308
324
|
- app/controllers/editor_controller.rb
|
309
325
|
- app/controllers/sessions_controller.rb
|
310
326
|
- app/controllers/source_codes_controller.rb
|
311
327
|
- app/controllers/users_controller.rb
|
312
328
|
- app/helpers/application_helper.rb
|
329
|
+
- app/helpers/costumes_helper.rb
|
313
330
|
- app/helpers/editor_helper.rb
|
314
331
|
- app/helpers/sessions_helper.rb
|
315
332
|
- app/helpers/users_helper.rb
|
@@ -341,6 +358,7 @@ files:
|
|
341
358
|
- app/models/concerns/ruby_to_block/block/hardware_motor_driver.rb
|
342
359
|
- app/models/concerns/ruby_to_block/block/hardware_motor_driver_set_speed.rb
|
343
360
|
- app/models/concerns/ruby_to_block/block/hardware_motor_driver_speed.rb
|
361
|
+
- app/models/concerns/ruby_to_block/block/hardware_neo_pixel_set_rgb.rb
|
344
362
|
- app/models/concerns/ruby_to_block/block/hardware_operation.rb
|
345
363
|
- app/models/concerns/ruby_to_block/block/hardware_rgb_led_set_color.rb
|
346
364
|
- app/models/concerns/ruby_to_block/block/hardware_rgb_led_turn_off.rb
|
@@ -357,8 +375,10 @@ files:
|
|
357
375
|
- app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_set_speed.rb
|
358
376
|
- app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_speed.rb
|
359
377
|
- app/models/concerns/ruby_to_block/block/looks_hide.rb
|
378
|
+
- app/models/concerns/ruby_to_block/block/looks_next_costume.rb
|
360
379
|
- app/models/concerns/ruby_to_block/block/looks_say.rb
|
361
380
|
- app/models/concerns/ruby_to_block/block/looks_show.rb
|
381
|
+
- app/models/concerns/ruby_to_block/block/looks_switch_costume.rb
|
362
382
|
- app/models/concerns/ruby_to_block/block/looks_vanish.rb
|
363
383
|
- app/models/concerns/ruby_to_block/block/math_number.rb
|
364
384
|
- app/models/concerns/ruby_to_block/block/motion_change_x_by.rb
|
@@ -398,9 +418,11 @@ files:
|
|
398
418
|
- app/models/concerns/ruby_to_block/block/value.rb
|
399
419
|
- app/models/concerns/ruby_to_block/context.rb
|
400
420
|
- app/models/concerns/ruby_to_block/formatter.rb
|
421
|
+
- app/models/costume.rb
|
401
422
|
- app/models/preference.rb
|
402
423
|
- app/models/source_code.rb
|
403
424
|
- app/models/user.rb
|
425
|
+
- app/views/costumes/index.html.haml
|
404
426
|
- app/views/editor/_block_tab.html.haml
|
405
427
|
- app/views/editor/_character_modal.html.haml
|
406
428
|
- app/views/editor/_load_modal.html.haml
|
@@ -450,6 +472,14 @@ files:
|
|
450
472
|
- db/migrate/20131219045113_add_filename_to_source_code.rb
|
451
473
|
- db/migrate/20150513061200_create_users.rb
|
452
474
|
- db/migrate/20150513061250_add_index_name_on_users.rb
|
475
|
+
- db/migrate/20150607012053_create_costumes.rb
|
476
|
+
- db/migrate/20150607012707_add_indexes_on_costumes.rb
|
477
|
+
- db/migrate/20150607034013_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
|
478
|
+
- db/migrate/20150607034014_add_missing_unique_indices.acts_as_taggable_on_engine.rb
|
479
|
+
- db/migrate/20150607034015_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
|
480
|
+
- db/migrate/20150607034016_add_missing_taggable_index.acts_as_taggable_on_engine.rb
|
481
|
+
- db/migrate/20150607034017_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
|
482
|
+
- db/migrate/20150607034018_insert_preset_costumes.rb
|
453
483
|
- db/schema.rb
|
454
484
|
- db/seeds.rb
|
455
485
|
- demos/car_chase.rb.xml
|
@@ -469,10 +499,10 @@ files:
|
|
469
499
|
- public/422.html
|
470
500
|
- public/500.html
|
471
501
|
- public/apple-touch-icon.png
|
472
|
-
- public/assets/application-
|
473
|
-
- public/assets/application-
|
474
|
-
- public/assets/application-
|
475
|
-
- public/assets/application-
|
502
|
+
- public/assets/application-01ea22bf031b73863715417bd68b9cfa.css
|
503
|
+
- public/assets/application-01ea22bf031b73863715417bd68b9cfa.css.gz
|
504
|
+
- public/assets/application-10e7350b7f8e32535d954c6a53e6b2ff.js
|
505
|
+
- public/assets/application-10e7350b7f8e32535d954c6a53e6b2ff.js.gz
|
476
506
|
- public/assets/blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js
|
477
507
|
- public/assets/blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js.gz
|
478
508
|
- public/assets/blockly/msg/js/ja-16b694632120c3d1ace214702c6ea413.js
|
@@ -493,11 +523,11 @@ files:
|
|
493
523
|
- public/assets/jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png
|
494
524
|
- public/assets/jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png
|
495
525
|
- public/assets/loading-e77296be32d066d3e29d3bf9803fa417.gif
|
496
|
-
- public/assets/manifest-
|
497
|
-
- public/assets/msg/en_us-
|
498
|
-
- public/assets/msg/en_us-
|
499
|
-
- public/assets/msg/ja-
|
500
|
-
- public/assets/msg/ja-
|
526
|
+
- public/assets/manifest-013a6df7ca7443586ce9a3614a33dd39.json
|
527
|
+
- public/assets/msg/en_us-e54bdd84fc120684bed3fa16e2d3d7fa.js
|
528
|
+
- public/assets/msg/en_us-e54bdd84fc120684bed3fa16e2d3d7fa.js.gz
|
529
|
+
- public/assets/msg/ja-ada4923ec8028047541796bf2f31dd1c.js
|
530
|
+
- public/assets/msg/ja-ada4923ec8028047541796bf2f31dd1c.js.gz
|
501
531
|
- public/assets/progressbar-ee8fb1222f286f625bbf7332844a6a0c.gif
|
502
532
|
- public/blockly/media/1x1.gif
|
503
533
|
- public/blockly/media/anon.jpeg
|
@@ -574,6 +604,7 @@ files:
|
|
574
604
|
- spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature
|
575
605
|
- spec/acceptance/block_mode/blocks/hardware/motor_driver.feature
|
576
606
|
- spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature
|
607
|
+
- spec/acceptance/block_mode/blocks/hardware/neo_pixel_set_rgb.feature
|
577
608
|
- spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature
|
578
609
|
- spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.feature
|
579
610
|
- spec/acceptance/block_mode/blocks/hardware/sensor_value.feature
|
@@ -590,6 +621,7 @@ files:
|
|
590
621
|
- spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature
|
591
622
|
- spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature
|
592
623
|
- spec/acceptance/block_mode/blocks/looks/hide.feature
|
624
|
+
- spec/acceptance/block_mode/blocks/looks/next_costume.feature
|
593
625
|
- spec/acceptance/block_mode/blocks/looks/say.feature
|
594
626
|
- spec/acceptance/block_mode/blocks/looks/show.feature
|
595
627
|
- spec/acceptance/block_mode/blocks/looks/vanish.feature
|
@@ -630,6 +662,7 @@ files:
|
|
630
662
|
- spec/acceptance/block_mode/blocks/sensing/reach_wall.feature
|
631
663
|
- spec/acceptance/block_mode/blocks/sensing/time_now.feature
|
632
664
|
- spec/acceptance/block_mode/blocks/sound/play.feature
|
665
|
+
- spec/acceptance/block_mode/character_modal_view.feature
|
633
666
|
- spec/acceptance/block_mode/demo.feature
|
634
667
|
- spec/acceptance/block_mode/translate.feature
|
635
668
|
- spec/acceptance/readme.md
|
@@ -647,6 +680,7 @@ files:
|
|
647
680
|
- spec/fixtures/files/01_remix.rb
|
648
681
|
- spec/fixtures/files/01_remix02.rb
|
649
682
|
- spec/fixtures/files/01_remix10.rb.xml
|
683
|
+
- spec/fixtures/files/extra_car.png
|
650
684
|
- spec/fixtures/files/favicon.ico
|
651
685
|
- spec/fixtures/files/hardware_led.rb.xml
|
652
686
|
- spec/helpers/editor_helper_spec.rb
|
@@ -657,9 +691,11 @@ files:
|
|
657
691
|
- spec/javascripts/spec_helper.js
|
658
692
|
- spec/lib/smalruby_editor_spec.rb
|
659
693
|
- spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb
|
694
|
+
- spec/models/concerns/ruby_to_block/block/character_spec.rb
|
660
695
|
- spec/models/concerns/ruby_to_block/block/control_if_spec.rb
|
661
696
|
- spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
|
662
697
|
- spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb
|
698
|
+
- spec/models/concerns/ruby_to_block/block/hardware__neo_pixel_spec.rb
|
663
699
|
- spec/models/concerns/ruby_to_block/block/hardware__smalrubot_spec.rb
|
664
700
|
- spec/models/concerns/ruby_to_block/block/hardware_spec.rb
|
665
701
|
- spec/models/concerns/ruby_to_block/block/looks_say_spec.rb
|
@@ -753,6 +789,7 @@ test_files:
|
|
753
789
|
- spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature
|
754
790
|
- spec/acceptance/block_mode/blocks/hardware/motor_driver.feature
|
755
791
|
- spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature
|
792
|
+
- spec/acceptance/block_mode/blocks/hardware/neo_pixel_set_rgb.feature
|
756
793
|
- spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature
|
757
794
|
- spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.feature
|
758
795
|
- spec/acceptance/block_mode/blocks/hardware/sensor_value.feature
|
@@ -769,6 +806,7 @@ test_files:
|
|
769
806
|
- spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature
|
770
807
|
- spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature
|
771
808
|
- spec/acceptance/block_mode/blocks/looks/hide.feature
|
809
|
+
- spec/acceptance/block_mode/blocks/looks/next_costume.feature
|
772
810
|
- spec/acceptance/block_mode/blocks/looks/say.feature
|
773
811
|
- spec/acceptance/block_mode/blocks/looks/show.feature
|
774
812
|
- spec/acceptance/block_mode/blocks/looks/vanish.feature
|
@@ -809,6 +847,7 @@ test_files:
|
|
809
847
|
- spec/acceptance/block_mode/blocks/sensing/reach_wall.feature
|
810
848
|
- spec/acceptance/block_mode/blocks/sensing/time_now.feature
|
811
849
|
- spec/acceptance/block_mode/blocks/sound/play.feature
|
850
|
+
- spec/acceptance/block_mode/character_modal_view.feature
|
812
851
|
- spec/acceptance/block_mode/demo.feature
|
813
852
|
- spec/acceptance/block_mode/translate.feature
|
814
853
|
- spec/acceptance/readme.md
|
@@ -826,6 +865,7 @@ test_files:
|
|
826
865
|
- spec/fixtures/files/01_remix.rb
|
827
866
|
- spec/fixtures/files/01_remix02.rb
|
828
867
|
- spec/fixtures/files/01_remix10.rb.xml
|
868
|
+
- spec/fixtures/files/extra_car.png
|
829
869
|
- spec/fixtures/files/favicon.ico
|
830
870
|
- spec/fixtures/files/hardware_led.rb.xml
|
831
871
|
- spec/helpers/editor_helper_spec.rb
|
@@ -836,9 +876,11 @@ test_files:
|
|
836
876
|
- spec/javascripts/spec_helper.js
|
837
877
|
- spec/lib/smalruby_editor_spec.rb
|
838
878
|
- spec/models/concerns/ruby_to_block/block/character_method_call_spec.rb
|
879
|
+
- spec/models/concerns/ruby_to_block/block/character_spec.rb
|
839
880
|
- spec/models/concerns/ruby_to_block/block/control_if_spec.rb
|
840
881
|
- spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
|
841
882
|
- spec/models/concerns/ruby_to_block/block/events_on_start_spec.rb
|
883
|
+
- spec/models/concerns/ruby_to_block/block/hardware__neo_pixel_spec.rb
|
842
884
|
- spec/models/concerns/ruby_to_block/block/hardware__smalrubot_spec.rb
|
843
885
|
- spec/models/concerns/ruby_to_block/block/hardware_spec.rb
|
844
886
|
- spec/models/concerns/ruby_to_block/block/looks_say_spec.rb
|
@@ -1,194 +0,0 @@
|
|
1
|
-
# キャラクター設定ダイアログを表現するビュー
|
2
|
-
Smalruby.CharacterModalView = Backbone.View.extend
|
3
|
-
model: new Smalruby.Character()
|
4
|
-
|
5
|
-
events:
|
6
|
-
'click #character-modal-costume-selector a': 'onSelectCostume'
|
7
|
-
'click #character_rotation_style_free': 'onRotationStyleFree'
|
8
|
-
'click #character_rotation_style_left_right': 'onRotationStyleLeftRight'
|
9
|
-
'click #character_rotation_style_none': 'onRotationStyleNone'
|
10
|
-
'click #character-modal-ok-button': 'onOk'
|
11
|
-
|
12
|
-
previewZoomLevel: 0.5
|
13
|
-
|
14
|
-
initialize: ->
|
15
|
-
Smalruby.removeBackdropOnHidden(@$el)
|
16
|
-
|
17
|
-
@target = null
|
18
|
-
|
19
|
-
$('#character-modal-costume-selector img').on 'dragstart', (e) ->
|
20
|
-
e.preventDefault()
|
21
|
-
|
22
|
-
setPosition = (pos) =>
|
23
|
-
@model.set
|
24
|
-
x: parseInt(pos.left / @previewZoomLevel)
|
25
|
-
y: parseInt(pos.top / @previewZoomLevel)
|
26
|
-
|
27
|
-
$('#character-modal-character').draggable
|
28
|
-
containment: '#character-modal-preview'
|
29
|
-
cursor: 'move'
|
30
|
-
drag: (event, ui) ->
|
31
|
-
setPosition(ui.position)
|
32
|
-
|
33
|
-
$('#character-modal-preview').droppable
|
34
|
-
drop: (event, ui) ->
|
35
|
-
setPosition(ui.draggable.position())
|
36
|
-
|
37
|
-
@$el.find('input[name="character[name]"]').keypress (e) ->
|
38
|
-
e = window.event if !e
|
39
|
-
if e.keyCode == 13
|
40
|
-
false
|
41
|
-
else
|
42
|
-
true
|
43
|
-
|
44
|
-
self = @
|
45
|
-
changeNameFunc = (e) ->
|
46
|
-
self.model.set({ name: $(@).val() })
|
47
|
-
self.nameChanged = true
|
48
|
-
@$el.find('input[name="character[name]"]').change(changeNameFunc)
|
49
|
-
@$el.find('input[name="character[name]"]').keyup(changeNameFunc)
|
50
|
-
|
51
|
-
@$el.find('input[name="character[x]"]').change (e) ->
|
52
|
-
self.model.set({ x: $(@).val() })
|
53
|
-
|
54
|
-
@$el.find('input[name="character[y]"]').change (e) ->
|
55
|
-
self.model.set({ y: $(@).val() })
|
56
|
-
|
57
|
-
@$el.find('input[name="character[angle]"]').change (e) ->
|
58
|
-
self.model.set({ angle: $(@).val() })
|
59
|
-
|
60
|
-
@listenTo(@model, 'change:name', @onChangeName)
|
61
|
-
@listenTo(@model, 'change:x', @onChangeX)
|
62
|
-
@listenTo(@model, 'change:y', @onChangeY)
|
63
|
-
@listenTo(@model, 'change:angle', @onChangeAngle)
|
64
|
-
@listenTo(@model, 'change:costumes', @onChangeCostumes)
|
65
|
-
@listenTo(@model, 'change:rotationStyle', @onChangeRotationStyle)
|
66
|
-
@listenTo(@model, 'change', @onChange)
|
67
|
-
|
68
|
-
@callAllOnChangeAttributes_()
|
69
|
-
|
70
|
-
render: ->
|
71
|
-
@onChange(@model)
|
72
|
-
@$el.modal
|
73
|
-
backdrop: 'static'
|
74
|
-
@$el.modal('show')
|
75
|
-
|
76
|
-
# HACK: ダイアログを表示して500ms程度待たないと画像のサイズが取得できなかった
|
77
|
-
f = ->
|
78
|
-
if @readImageSizeflag
|
79
|
-
img = $('#character-modal-costume-selector .active img')
|
80
|
-
if img.width() > 0
|
81
|
-
$('#character-modal-character').css
|
82
|
-
width: "#{img.width() / 2}px"
|
83
|
-
height: "#{img.height() / 2}px"
|
84
|
-
@readImageSizeflag = false
|
85
|
-
else
|
86
|
-
setTimeout(_.bind(f, @), 50)
|
87
|
-
if @readImageSizeflag
|
88
|
-
setTimeout(_.bind(f, @), 1)
|
89
|
-
|
90
|
-
callAllOnChangeAttributes_: ->
|
91
|
-
@onChangeName(@model, @model.get('name'))
|
92
|
-
@onChangeX(@model, @model.get('x'))
|
93
|
-
@onChangeY(@model, @model.get('y'))
|
94
|
-
@onChangeAngle(@model, @model.get('angle'))
|
95
|
-
@onChangeCostumes(@model, @model.get('costumes'))
|
96
|
-
@onChangeRotationStyle(@model, @model.get('rotationStyle'))
|
97
|
-
|
98
|
-
onChangeName: (model, value, options) ->
|
99
|
-
@$el.find('input[name="character[name]"]').val(value)
|
100
|
-
|
101
|
-
onChangeX: (model, value, options) ->
|
102
|
-
@$el.find('input[name="character[x]"]').val(value)
|
103
|
-
$('#character_x_value').text(value)
|
104
|
-
$('#character-modal-character').css('left', parseInt(value * @previewZoomLevel))
|
105
|
-
|
106
|
-
onChangeY: (model, value, options) ->
|
107
|
-
@$el.find('input[name="character[y]"]').val(value)
|
108
|
-
$('#character_y_value').text(value)
|
109
|
-
$('#character-modal-character').css('top', parseInt(value * @previewZoomLevel))
|
110
|
-
|
111
|
-
onChangeAngle: (model, value, options) ->
|
112
|
-
@$el.find('input[name="character[angle]"]').val(value)
|
113
|
-
$('#character_angle_value').text("#{value}°")
|
114
|
-
rotate = "rotate(#{value}deg)"
|
115
|
-
$('#character_angle_vector').css
|
116
|
-
'-moz-transform': rotate
|
117
|
-
'-webkit-transform': rotate
|
118
|
-
transform: rotate
|
119
|
-
|
120
|
-
@model.rotateImage('#character-modal-character')
|
121
|
-
|
122
|
-
onChangeCostumes: (model, value, options) ->
|
123
|
-
img = $('<img>').attr
|
124
|
-
src: model.costumeUrl()
|
125
|
-
alt: model.costume()
|
126
|
-
$('#character-modal-character img').replaceWith(img)
|
127
|
-
@$el.find('#character-modal-costume-selector a.thumbnail').removeClass('active')
|
128
|
-
thumb = @$el.find("#character-modal-costume-selector img[alt=\"#{model.costume()}\"]")
|
129
|
-
thumb.parent().addClass('active')
|
130
|
-
if thumb.width() > 0
|
131
|
-
$('#character-modal-character').css
|
132
|
-
width: "#{thumb.width() / 2}px"
|
133
|
-
height: "#{thumb.height() / 2}px"
|
134
|
-
else
|
135
|
-
@readImageSizeflag = true
|
136
|
-
|
137
|
-
onChangeRotationStyle: (model, value, options) ->
|
138
|
-
$('#character_rotation_style button.btn').removeClass('btn-primary')
|
139
|
-
$("#character_rotation_style_#{value}").addClass('btn-primary')
|
140
|
-
@onChangeAngle(@model, @model.get('angle'))
|
141
|
-
|
142
|
-
onChange: (model, options) ->
|
143
|
-
return unless @target
|
144
|
-
|
145
|
-
@$el.find('.control-group[for="character[name]"]').removeClass('error')
|
146
|
-
@$el.find('#character-modal-ok-button').removeClass('disabled').removeAttr('disabled')
|
147
|
-
|
148
|
-
unless @model.isValid()
|
149
|
-
@$el.find('.control-group[for="character[name]"]').addClass('error')
|
150
|
-
@$el.find('#character-modal-ok-button').addClass('disabled').attr({ disabled: 'disabled' })
|
151
|
-
|
152
|
-
name = @model.get('name')
|
153
|
-
if @target.get('name') != name &&
|
154
|
-
Smalruby.Collections.CharacterSet.findWhere({ name: name })
|
155
|
-
@$el.find('.control-group[for="character[name]"]').addClass('error')
|
156
|
-
@$el.find('#character-modal-ok-button').addClass('disabled').attr({ disabled: 'disabled' })
|
157
|
-
|
158
|
-
onSelectCostume: (e) ->
|
159
|
-
e.preventDefault()
|
160
|
-
|
161
|
-
costume = $(e.target).attr('alt') || $(e.target).find('img').attr('alt')
|
162
|
-
|
163
|
-
attrs =
|
164
|
-
costumes: [costume]
|
165
|
-
|
166
|
-
unless @nameChanged
|
167
|
-
prefix = Smalruby.Character.costumeToNamePrefix(costume)
|
168
|
-
if prefix != @model.namePrefix()
|
169
|
-
if prefix == @target.namePrefix()
|
170
|
-
attrs['name'] = @target.get('name')
|
171
|
-
else
|
172
|
-
attrs['name'] = Smalruby.Collections.CharacterSet.uniqueName(costume)
|
173
|
-
|
174
|
-
@model.set(attrs)
|
175
|
-
|
176
|
-
onRotationStyleFree: ->
|
177
|
-
@model.set({ rotationStyle: 'free' })
|
178
|
-
|
179
|
-
onRotationStyleLeftRight: ->
|
180
|
-
@model.set({ rotationStyle: 'left_right' })
|
181
|
-
|
182
|
-
onRotationStyleNone: ->
|
183
|
-
@model.set({ rotationStyle: 'none' })
|
184
|
-
|
185
|
-
onOk: ->
|
186
|
-
@$el.modal('hide')
|
187
|
-
if @target
|
188
|
-
@target.set(_.clone(@model.attributes))
|
189
|
-
|
190
|
-
setCharacter: (character)->
|
191
|
-
@target = character
|
192
|
-
@model.set(_.clone(@target.attributes))
|
193
|
-
@nameChanged = false
|
194
|
-
@
|