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