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.

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