smalruby-editor 0.2.6 → 0.2.7

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/Guardfile +2 -0
  4. data/app/assets/javascripts/blocks/hardware.js.coffee.erb +1 -1
  5. data/app/assets/javascripts/fix_blockly.js.erb +0 -50
  6. data/app/assets/javascripts/generators/ruby.js.coffee.erb +18 -4
  7. data/app/assets/javascripts/models/source_code.js +1 -1
  8. data/app/assets/javascripts/msg/en_us.js +1 -0
  9. data/app/assets/javascripts/msg/ja.js +4 -0
  10. data/app/assets/javascripts/smalruby.js.coffee.erb +50 -6
  11. data/app/assets/javascripts/views/main_menu_view.js.coffee.erb +14 -4
  12. data/app/assets/javascripts/views/preference_modal_view.js.coffee.erb +71 -0
  13. data/app/assets/javascripts/views/signin_modal_view.js.coffee.erb +5 -4
  14. data/app/assets/stylesheets/application.css +1 -0
  15. data/app/assets/stylesheets/preference-modal.css.scss +22 -0
  16. data/app/assets/stylesheets/toolbox.css.scss.erb +36 -0
  17. data/app/controllers/application_controller.rb +20 -4
  18. data/app/controllers/editor_controller.rb +4 -0
  19. data/app/controllers/sessions_controller.rb +7 -4
  20. data/app/controllers/source_codes_controller.rb +2 -2
  21. data/app/controllers/users_controller.rb +22 -0
  22. data/app/helpers/application_helper.rb +4 -4
  23. data/app/helpers/sessions_helper.rb +0 -0
  24. data/app/helpers/users_helper.rb +10 -0
  25. data/app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb +0 -6
  26. data/app/models/concerns/ruby_to_block/block/hardware_operation.rb +0 -0
  27. data/app/models/preference.rb +71 -0
  28. data/app/models/source_code.rb +4 -0
  29. data/app/models/user.rb +26 -0
  30. data/app/views/editor/_block_tab.html.haml +5 -6
  31. data/app/views/editor/_load_modal.html.haml +2 -2
  32. data/app/views/editor/_preference_modal.html.haml +16 -0
  33. data/app/views/editor/_signin_modal.html.haml +1 -1
  34. data/app/views/editor/_toolbox_default.html.haml +86 -79
  35. data/app/views/editor/{_toolbox_raspberrypi.html.haml → _toolbox_smalrubot.html.haml} +72 -105
  36. data/app/views/editor/_toolbox_smalrubot_s1.html.haml +1 -196
  37. data/app/views/editor/_toolbox_smalrubot_v3.html.haml +1 -196
  38. data/app/views/editor/index.html.haml +11 -4
  39. data/app/views/editor/toolbox.html.haml +1 -0
  40. data/app/views/layouts/application.html.erb +1 -1
  41. data/app/views/users/preferences.html.haml +34 -0
  42. data/config/application.rb +1 -1
  43. data/config/locales/en.yml +30 -0
  44. data/config/locales/ja.yml +30 -0
  45. data/config/routes.rb +4 -57
  46. data/db/migrate/20150513061200_create_users.rb +10 -0
  47. data/db/migrate/20150513061250_add_index_name_on_users.rb +9 -0
  48. data/db/schema.rb +10 -1
  49. data/lib/smalruby_editor.rb +22 -24
  50. data/lib/smalruby_editor/version.rb +1 -1
  51. data/smalruby-editor.gemspec +0 -0
  52. data/spec/acceptance/block_mode/blocks/hardware/button_pressed_or_released.feature +2 -0
  53. data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +1 -0
  54. data/spec/acceptance/block_mode/blocks/hardware/led_turn_off.feature +11 -1
  55. data/spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature +11 -1
  56. data/spec/acceptance/block_mode/blocks/hardware/motor_driver.feature +7 -1
  57. data/spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature +2 -0
  58. data/spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature +9 -12
  59. data/spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.feature +9 -12
  60. data/spec/acceptance/block_mode/blocks/hardware/sensor_value.feature +59 -60
  61. data/spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature +76 -67
  62. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_action.feature +9 -12
  63. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_action_with_sec.feature +9 -11
  64. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_dc_motor_power_ratio.feature +11 -12
  65. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_led_turn_on_or_off.feature +9 -10
  66. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action.feature +9 -12
  67. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action_with_sec.feature +9 -11
  68. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_dc_motor_power_ratio.feature +11 -12
  69. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_led_turn_on_or_off.feature +9 -12
  70. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_sensor_value.feature +11 -12
  71. data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature +7 -1
  72. data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature +2 -0
  73. data/spec/acceptance/standalone/preference.feature +92 -0
  74. data/{demos → spec/fixtures/files}/hardware_led.rb.xml +0 -0
  75. data/spec/javascripts/models/source_code_spec.coffee +0 -0
  76. data/spec/models/concerns/ruby_to_block/block/hardware__smalrubot_spec.rb +1 -1
  77. data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +4 -4
  78. data/spec/models/concerns/ruby_to_block_spec.rb +1 -1
  79. data/spec/models/source_code_spec.rb +1 -11
  80. data/spec/spec_helper.rb +8 -0
  81. data/spec/steps/base_steps.rb +68 -16
  82. data/spec/steps/standalone_steps.rb +21 -0
  83. data/spec/steps/text_editor_steps.rb +8 -8
  84. data/spec/support/feature_helper.rb +13 -0
  85. data/vendor/assets/javascripts/blockly/blockly_compressed.js +500 -454
  86. data/vendor/assets/javascripts/blockly/blocks_compressed.js +29 -28
  87. data/vendor/assets/javascripts/blockly/msg/js/ja.js +2 -1
  88. metadata +33 -35
  89. data/app/assets/stylesheets/toolbox_default.css.scss.erb +0 -34
  90. data/app/assets/stylesheets/toolbox_raspberrypi.css.scss.erb +0 -32
  91. data/app/assets/stylesheets/toolbox_smalrubot_s1.css.scss.erb +0 -32
  92. data/app/assets/stylesheets/toolbox_smalrubot_v3.css.scss.erb +0 -32
  93. data/demos/adjust_2wd_car.rb.xml +0 -179
  94. data/lib/smalruby_editor/config.rb +0 -24
  95. data/spec/controllers/editor_controller_spec.rb +0 -12
  96. data/spec/controllers/sessions_controller_spec.rb +0 -74
  97. data/spec/helpers/sessions_helper_spec.rb +0 -15
@@ -1,24 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- module SmalrubyEditor
4
- class Config < Settingslogic
5
- if Rails.env.test?
6
- source({})
7
- load!
8
- self['features'] = ['disabled_add_character_from_beginning']
9
- else
10
- path = SmalrubyEditor.home_directory.join('config', 'config.yml')
11
- if path.exist?
12
- source(path)
13
- else
14
- source({})
15
- end
16
- end
17
- suppress_errors(true)
18
-
19
- def enabled?(feature)
20
- features.try(:include?, feature)
21
- end
22
- module_function :enabled?
23
- end
24
- end
@@ -1,12 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'spec_helper'
3
- require 'nkf'
4
-
5
- describe EditorController do
6
- describe 'エディタ画面を表示する (GET index)' do
7
- it 'returns http success' do
8
- get :index
9
- response.should be_success
10
- end
11
- end
12
- end
@@ -1,74 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'spec_helper'
3
-
4
- describe SessionsController do
5
- describe 'ログインする (XHR POST create)' do
6
- let(:params) {
7
- {
8
- username: '1102',
9
- }
10
- }
11
-
12
- context 'RAILS_ENVがstandaloneの場合', set_standalone_rails_env: true do
13
- before do
14
- xhr :post, :create, params, {}
15
- end
16
-
17
- describe 'レスポンスボディ' do
18
- subject { response.body }
19
-
20
- it { should eq('1102') }
21
- end
22
-
23
- describe 'session' do
24
- subject { session }
25
-
26
- describe '[:username]' do
27
- subject { super()[:username] }
28
-
29
- it { should eq(params[:username]) }
30
- end
31
- end
32
- end
33
-
34
- context 'RAILS_ENVがstandaloneではない場合' do
35
- it do
36
- expect {
37
- xhr :post, :create, params, {}
38
- }.to raise_exception
39
- end
40
- end
41
- end
42
-
43
- describe 'ログアウトする (DELETE destroy)' do
44
- let(:_session) {
45
- {
46
- username: '1102',
47
- }
48
- }
49
-
50
- context 'RAILS_ENVがstandaloneの場合', set_standalone_rails_env: true do
51
- before do
52
- xhr :delete, :destroy, {}, _session
53
- end
54
-
55
- describe 'session' do
56
- subject { session }
57
-
58
- describe '[:username]' do
59
- subject { super()[:username] }
60
-
61
- it { should be_nil }
62
- end
63
- end
64
- end
65
-
66
- context 'RAILS_ENVがstandaloneではない場合' do
67
- it do
68
- expect {
69
- xhr :post, :create, params, {}
70
- }.to raise_exception
71
- end
72
- end
73
- end
74
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Specs in this file have access to a helper object that includes
4
- # the SessionsHelper. For example:
5
- #
6
- # describe SessionsHelper do
7
- # describe "string concat" do
8
- # it "concats two strings with spaces" do
9
- # expect(helper.concat_strings("this","that")).to eq("this that")
10
- # end
11
- # end
12
- # end
13
- describe SessionsHelper do
14
- pending "add some examples to (or delete) #{__FILE__}"
15
- end