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.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/Guardfile +2 -0
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +1 -1
- data/app/assets/javascripts/fix_blockly.js.erb +0 -50
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +18 -4
- data/app/assets/javascripts/models/source_code.js +1 -1
- data/app/assets/javascripts/msg/en_us.js +1 -0
- data/app/assets/javascripts/msg/ja.js +4 -0
- data/app/assets/javascripts/smalruby.js.coffee.erb +50 -6
- data/app/assets/javascripts/views/main_menu_view.js.coffee.erb +14 -4
- data/app/assets/javascripts/views/preference_modal_view.js.coffee.erb +71 -0
- data/app/assets/javascripts/views/signin_modal_view.js.coffee.erb +5 -4
- data/app/assets/stylesheets/application.css +1 -0
- data/app/assets/stylesheets/preference-modal.css.scss +22 -0
- data/app/assets/stylesheets/toolbox.css.scss.erb +36 -0
- data/app/controllers/application_controller.rb +20 -4
- data/app/controllers/editor_controller.rb +4 -0
- data/app/controllers/sessions_controller.rb +7 -4
- data/app/controllers/source_codes_controller.rb +2 -2
- data/app/controllers/users_controller.rb +22 -0
- data/app/helpers/application_helper.rb +4 -4
- data/app/helpers/sessions_helper.rb +0 -0
- data/app/helpers/users_helper.rb +10 -0
- data/app/models/concerns/ruby_to_block/block/hardware_init_hardware.rb +0 -6
- data/app/models/concerns/ruby_to_block/block/hardware_operation.rb +0 -0
- data/app/models/preference.rb +71 -0
- data/app/models/source_code.rb +4 -0
- data/app/models/user.rb +26 -0
- data/app/views/editor/_block_tab.html.haml +5 -6
- data/app/views/editor/_load_modal.html.haml +2 -2
- data/app/views/editor/_preference_modal.html.haml +16 -0
- data/app/views/editor/_signin_modal.html.haml +1 -1
- data/app/views/editor/_toolbox_default.html.haml +86 -79
- data/app/views/editor/{_toolbox_raspberrypi.html.haml → _toolbox_smalrubot.html.haml} +72 -105
- data/app/views/editor/_toolbox_smalrubot_s1.html.haml +1 -196
- data/app/views/editor/_toolbox_smalrubot_v3.html.haml +1 -196
- data/app/views/editor/index.html.haml +11 -4
- data/app/views/editor/toolbox.html.haml +1 -0
- data/app/views/layouts/application.html.erb +1 -1
- data/app/views/users/preferences.html.haml +34 -0
- data/config/application.rb +1 -1
- data/config/locales/en.yml +30 -0
- data/config/locales/ja.yml +30 -0
- data/config/routes.rb +4 -57
- data/db/migrate/20150513061200_create_users.rb +10 -0
- data/db/migrate/20150513061250_add_index_name_on_users.rb +9 -0
- data/db/schema.rb +10 -1
- data/lib/smalruby_editor.rb +22 -24
- data/lib/smalruby_editor/version.rb +1 -1
- data/smalruby-editor.gemspec +0 -0
- data/spec/acceptance/block_mode/blocks/hardware/button_pressed_or_released.feature +2 -0
- data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +1 -0
- data/spec/acceptance/block_mode/blocks/hardware/led_turn_off.feature +11 -1
- data/spec/acceptance/block_mode/blocks/hardware/led_turn_on.feature +11 -1
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver.feature +7 -1
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature +2 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_set_color.feature +9 -12
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_turn_off.feature +9 -12
- data/spec/acceptance/block_mode/blocks/hardware/sensor_value.feature +59 -60
- data/spec/acceptance/block_mode/blocks/hardware/servo_set_position.feature +76 -67
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_action.feature +9 -12
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_action_with_sec.feature +9 -11
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_dc_motor_power_ratio.feature +11 -12
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_led_turn_on_or_off.feature +9 -10
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action.feature +9 -12
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_action_with_sec.feature +9 -11
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_dc_motor_power_ratio.feature +11 -12
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_led_turn_on_or_off.feature +9 -12
- data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_sensor_value.feature +11 -12
- data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car.feature +7 -1
- data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature +2 -0
- data/spec/acceptance/standalone/preference.feature +92 -0
- data/{demos → spec/fixtures/files}/hardware_led.rb.xml +0 -0
- data/spec/javascripts/models/source_code_spec.coffee +0 -0
- data/spec/models/concerns/ruby_to_block/block/hardware__smalrubot_spec.rb +1 -1
- data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +4 -4
- data/spec/models/concerns/ruby_to_block_spec.rb +1 -1
- data/spec/models/source_code_spec.rb +1 -11
- data/spec/spec_helper.rb +8 -0
- data/spec/steps/base_steps.rb +68 -16
- data/spec/steps/standalone_steps.rb +21 -0
- data/spec/steps/text_editor_steps.rb +8 -8
- data/spec/support/feature_helper.rb +13 -0
- data/vendor/assets/javascripts/blockly/blockly_compressed.js +500 -454
- data/vendor/assets/javascripts/blockly/blocks_compressed.js +29 -28
- data/vendor/assets/javascripts/blockly/msg/js/ja.js +2 -1
- metadata +33 -35
- data/app/assets/stylesheets/toolbox_default.css.scss.erb +0 -34
- data/app/assets/stylesheets/toolbox_raspberrypi.css.scss.erb +0 -32
- data/app/assets/stylesheets/toolbox_smalrubot_s1.css.scss.erb +0 -32
- data/app/assets/stylesheets/toolbox_smalrubot_v3.css.scss.erb +0 -32
- data/demos/adjust_2wd_car.rb.xml +0 -179
- data/lib/smalruby_editor/config.rb +0 -24
- data/spec/controllers/editor_controller_spec.rb +0 -12
- data/spec/controllers/sessions_controller_spec.rb +0 -74
- 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,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
|