smalruby-editor 0.1.5-x86-mingw32 → 0.1.6-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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +8 -0
  4. data/README.rdoc +3 -0
  5. data/app/assets/javascripts/application.js +0 -1
  6. data/app/assets/javascripts/models/source_code.js.coffee +5 -2
  7. data/app/assets/javascripts/smalruby.js.coffee +18 -11
  8. data/app/assets/javascripts/views/main_menu_view.js.coffee +139 -81
  9. data/app/controllers/source_codes_controller.rb +7 -0
  10. data/app/models/concerns/ruby_to_block.rb +391 -0
  11. data/app/models/source_code.rb +3 -2
  12. data/app/views/editor/demo.html.erb +1 -1
  13. data/app/views/editor/index.html.haml +2 -2
  14. data/config/routes.rb +1 -0
  15. data/{app/assets/demos → demos}/default.xml +0 -0
  16. data/{app/assets/demos → demos}/rgb_led_anode.xml +82 -82
  17. data/lib/smalruby_editor/version.rb +3 -3
  18. data/lib/tasks/release.rake +0 -4
  19. data/public/assets/{application-0047adbc0fb7a529ef7a41b5e0e7d097.js → application-8bfffad1222d4e198f3c7ccc1cbd774f.js} +179 -144
  20. data/public/assets/{application-0047adbc0fb7a529ef7a41b5e0e7d097.js.gz → application-8bfffad1222d4e198f3c7ccc1cbd774f.js.gz} +0 -0
  21. data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
  22. data/smalruby-editor.gemspec +0 -6
  23. data/spec/acceptance/base.feature +119 -0
  24. data/spec/acceptance/block_mode/translate.feature +14 -0
  25. data/spec/acceptance/ruby_mode/translate.feature +65 -0
  26. data/spec/acceptance/standalone/run.feature +14 -1
  27. data/spec/controllers/source_codes_controller_spec.rb +22 -0
  28. data/{public/assets/default-5d1886100d7c8961e9962bbc4bb0c714.xml → spec/fixtures/files/01.rb.xml} +0 -0
  29. data/spec/models/concerns/ruby_to_block_spec.rb +329 -0
  30. data/spec/steps/base_steps.rb +230 -0
  31. data/spec/steps/block_mode_steps.rb +9 -1
  32. data/spec/steps/fix_turnip.rb +28 -0
  33. data/spec/steps/text_editor_steps.rb +52 -193
  34. metadata +19 -97
  35. data/app/assets/javascripts/ruby_mode.js.coffee.erb +0 -12
  36. data/public/assets/rgb_led_anode-91225bef2a8b97f1cefee862a0619b91.xml +0 -83
  37. data/spec/acceptance/ruby_mode/base.feature +0 -33
  38. data/spec/steps/ace_steps.rb +0 -77
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-19 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 4.0.0
83
- - !ruby/object:Gem::Dependency
84
- name: jquery-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: turbolinks
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +108,6 @@ dependencies:
122
108
  - - ~>
123
109
  - !ruby/object:Gem::Version
124
110
  version: '2.0'
125
- - !ruby/object:Gem::Dependency
126
- name: ace-rails-ap
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '>='
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - '>='
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
111
  - !ruby/object:Gem::Dependency
140
112
  name: flatstrap-sass
141
113
  requirement: !ruby/object:Gem::Requirement
@@ -150,20 +122,6 @@ dependencies:
150
122
  - - '>='
151
123
  - !ruby/object:Gem::Version
152
124
  version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: jquery-fileupload-rails
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - '>='
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - '>='
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
125
  - !ruby/object:Gem::Dependency
168
126
  name: shared-mime-info
169
127
  requirement: !ruby/object:Gem::Requirement
@@ -220,48 +178,6 @@ dependencies:
220
178
  - - '>='
221
179
  - !ruby/object:Gem::Version
222
180
  version: '0'
223
- - !ruby/object:Gem::Dependency
224
- name: jquery-ui-rails
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - '>='
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- type: :runtime
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - '>='
235
- - !ruby/object:Gem::Version
236
- version: '0'
237
- - !ruby/object:Gem::Dependency
238
- name: eco-source
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - '>='
242
- - !ruby/object:Gem::Version
243
- version: 1.1.0.rc.1
244
- type: :runtime
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - '>='
249
- - !ruby/object:Gem::Version
250
- version: 1.1.0.rc.1
251
- - !ruby/object:Gem::Dependency
252
- name: backbone-on-rails
253
- requirement: !ruby/object:Gem::Requirement
254
- requirements:
255
- - - '>='
256
- - !ruby/object:Gem::Version
257
- version: '0'
258
- type: :runtime
259
- prerelease: false
260
- version_requirements: !ruby/object:Gem::Requirement
261
- requirements:
262
- - - '>='
263
- - !ruby/object:Gem::Version
264
- version: '0'
265
181
  - !ruby/object:Gem::Dependency
266
182
  name: smalruby
267
183
  requirement: !ruby/object:Gem::Requirement
@@ -327,8 +243,6 @@ files:
327
243
  - Procfile
328
244
  - README.rdoc
329
245
  - Rakefile
330
- - app/assets/demos/default.xml
331
- - app/assets/demos/rgb_led_anode.xml
332
246
  - app/assets/images/.keep
333
247
  - app/assets/images/favicon.ico
334
248
  - app/assets/javascripts/application.js
@@ -355,7 +269,6 @@ files:
355
269
  - app/assets/javascripts/models/scene.js.coffee
356
270
  - app/assets/javascripts/models/source_code.js.coffee
357
271
  - app/assets/javascripts/routers/.keep
358
- - app/assets/javascripts/ruby_mode.js.coffee.erb
359
272
  - app/assets/javascripts/smalruby.js.coffee
360
273
  - app/assets/javascripts/views/.keep
361
274
  - app/assets/javascripts/views/character_modal_view.js.coffee
@@ -375,6 +288,7 @@ files:
375
288
  - app/mailers/.keep
376
289
  - app/models/.keep
377
290
  - app/models/concerns/.keep
291
+ - app/models/concerns/ruby_to_block.rb
378
292
  - app/models/source_code.rb
379
293
  - app/views/editor/_block_tab.html.haml
380
294
  - app/views/editor/_character_modal.html.haml
@@ -412,6 +326,8 @@ files:
412
326
  - db/migrate/20131219045113_add_filename_to_source_code.rb
413
327
  - db/schema.rb
414
328
  - db/seeds.rb
329
+ - demos/default.xml
330
+ - demos/rgb_led_anode.xml
415
331
  - lib/assets/.keep
416
332
  - lib/smalruby_editor.rb
417
333
  - lib/smalruby_editor/version.rb
@@ -472,6 +388,7 @@ files:
472
388
  - public/tiny.png
473
389
  - public/wide.png
474
390
  - smalruby-editor.gemspec
391
+ - spec/acceptance/base.feature
475
392
  - spec/acceptance/block_mode/blocks/character/new.feature
476
393
  - spec/acceptance/block_mode/blocks/control/await.feature
477
394
  - spec/acceptance/block_mode/blocks/control/await_until.feature
@@ -536,16 +453,18 @@ files:
536
453
  - spec/acceptance/block_mode/blocks/sensing/time_now.feature
537
454
  - spec/acceptance/block_mode/blocks/sound/play.feature
538
455
  - spec/acceptance/block_mode/demo.feature
456
+ - spec/acceptance/block_mode/translate.feature
539
457
  - spec/acceptance/readme.md
540
- - spec/acceptance/ruby_mode/base.feature
541
458
  - spec/acceptance/ruby_mode/check.feature
542
459
  - spec/acceptance/ruby_mode/download.feature
543
460
  - spec/acceptance/ruby_mode/load.feature
461
+ - spec/acceptance/ruby_mode/translate.feature
544
462
  - spec/acceptance/standalone/run.feature
545
463
  - spec/acceptance/standalone/save.feature
546
464
  - spec/controllers/editor_controller_spec.rb
547
465
  - spec/controllers/source_codes_controller_spec.rb
548
466
  - spec/fixtures/files/01.rb
467
+ - spec/fixtures/files/01.rb.xml
549
468
  - spec/fixtures/files/favicon.ico
550
469
  - spec/helpers/editor_helper_spec.rb
551
470
  - spec/javascripts/collections/character_set_spec.coffee
@@ -553,9 +472,10 @@ files:
553
472
  - spec/javascripts/models/scene_spec.coffee
554
473
  - spec/javascripts/spec_helper.js
555
474
  - spec/lib/smalruby_editor_spec.rb
475
+ - spec/models/concerns/ruby_to_block_spec.rb
556
476
  - spec/models/source_code_spec.rb
557
477
  - spec/spec_helper.rb
558
- - spec/steps/ace_steps.rb
478
+ - spec/steps/base_steps.rb
559
479
  - spec/steps/block_mode_steps.rb
560
480
  - spec/steps/fix_turnip.rb
561
481
  - spec/steps/global_variable.rb
@@ -570,11 +490,10 @@ files:
570
490
  - vendor/assets/javascripts/blockly/msg/js/ja.js
571
491
  - vendor/assets/javascripts/jquery.blockUI.js
572
492
  - vendor/assets/stylesheets/.keep
573
- - public/assets/application-0047adbc0fb7a529ef7a41b5e0e7d097.js
574
- - public/assets/application-0047adbc0fb7a529ef7a41b5e0e7d097.js.gz
575
493
  - public/assets/application-64a390efe879c386a5950515064f062d.css
576
494
  - public/assets/application-64a390efe879c386a5950515064f062d.css.gz
577
- - public/assets/default-5d1886100d7c8961e9962bbc4bb0c714.xml
495
+ - public/assets/application-8bfffad1222d4e198f3c7ccc1cbd774f.js
496
+ - public/assets/application-8bfffad1222d4e198f3c7ccc1cbd774f.js.gz
578
497
  - public/assets/favicon-a37c90b368fd8ed436cb8f9e9396465c.ico
579
498
  - public/assets/jquery-ui/animated-overlay-c48c87b7a95316f4698484e3b85ee4aa.gif
580
499
  - public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-58b63faadd031ca3db096dfdffd90224.png
@@ -593,7 +512,6 @@ files:
593
512
  - public/assets/loading-e8e6dd7833131c92a6c3b9c8ccc6a6ac.gif
594
513
  - public/assets/manifest-332a5a1668194028b55103e0ea45c054.json
595
514
  - public/assets/progressbar-82023a146fba2a0f6d925629ed2b09c5.gif
596
- - public/assets/rgb_led_anode-91225bef2a8b97f1cefee862a0619b91.xml
597
515
  homepage: https://github.com/smalruby/smalruby-editor
598
516
  licenses:
599
517
  - MIT
@@ -624,6 +542,7 @@ signing_key:
624
542
  specification_version: 4
625
543
  summary: A visual programming editor.
626
544
  test_files:
545
+ - spec/acceptance/base.feature
627
546
  - spec/acceptance/block_mode/blocks/character/new.feature
628
547
  - spec/acceptance/block_mode/blocks/control/await.feature
629
548
  - spec/acceptance/block_mode/blocks/control/await_until.feature
@@ -688,16 +607,18 @@ test_files:
688
607
  - spec/acceptance/block_mode/blocks/sensing/time_now.feature
689
608
  - spec/acceptance/block_mode/blocks/sound/play.feature
690
609
  - spec/acceptance/block_mode/demo.feature
610
+ - spec/acceptance/block_mode/translate.feature
691
611
  - spec/acceptance/readme.md
692
- - spec/acceptance/ruby_mode/base.feature
693
612
  - spec/acceptance/ruby_mode/check.feature
694
613
  - spec/acceptance/ruby_mode/download.feature
695
614
  - spec/acceptance/ruby_mode/load.feature
615
+ - spec/acceptance/ruby_mode/translate.feature
696
616
  - spec/acceptance/standalone/run.feature
697
617
  - spec/acceptance/standalone/save.feature
698
618
  - spec/controllers/editor_controller_spec.rb
699
619
  - spec/controllers/source_codes_controller_spec.rb
700
620
  - spec/fixtures/files/01.rb
621
+ - spec/fixtures/files/01.rb.xml
701
622
  - spec/fixtures/files/favicon.ico
702
623
  - spec/helpers/editor_helper_spec.rb
703
624
  - spec/javascripts/collections/character_set_spec.coffee
@@ -705,9 +626,10 @@ test_files:
705
626
  - spec/javascripts/models/scene_spec.coffee
706
627
  - spec/javascripts/spec_helper.js
707
628
  - spec/lib/smalruby_editor_spec.rb
629
+ - spec/models/concerns/ruby_to_block_spec.rb
708
630
  - spec/models/source_code_spec.rb
709
631
  - spec/spec_helper.rb
710
- - spec/steps/ace_steps.rb
632
+ - spec/steps/base_steps.rb
711
633
  - spec/steps/block_mode_steps.rb
712
634
  - spec/steps/fix_turnip.rb
713
635
  - spec/steps/global_variable.rb
@@ -1,12 +0,0 @@
1
- $ ->
2
- window.textEditor = textEditor = ace.edit('text-editor')
3
- textEditor.setTheme('ace/theme/clouds')
4
- textEditor.setShowInvisibles(true)
5
- textEditor.gotoLine(0, 0)
6
- textEditor.on 'change', (e) ->
7
- window.changed = true
8
-
9
- session = textEditor.getSession()
10
- session.setMode('ace/mode/ruby')
11
- session.setTabSize(2)
12
- session.setUseSoftTabs(true)
@@ -1,83 +0,0 @@
1
- <xml xmlns="http://www.w3.org/1999/xhtml">
2
- <character name="frog1" x="261" y="191" angle="0" costumes="frog1.png" />
3
- <block type="hardware_init_hardware" x="40" y="6" />
4
- <block type="character_new" x="45" y="50">
5
- <field name="NAME">frog1</field>
6
- <statement name="DO">
7
- <block type="events_on_click">
8
- <statement name="DO">
9
- <block type="looks_say" inline="true">
10
- <value name="TEXT">
11
- <block type="text">
12
- <field name="TEXT">ライトをぴかっとさせるでよ♪</field>
13
- </block>
14
- </value>
15
- <next>
16
- <block type="hardware_rgb_led_on">
17
- <field name="AC">anode</field>
18
- <field name="PIN">D3</field>
19
- <field name="COLOUR">#3333ff</field>
20
- <next>
21
- <block type="control_sleep" inline="true">
22
- <value name="SEC">
23
- <block type="math_number">
24
- <field name="NUM">1</field>
25
- </block>
26
- </value>
27
- <next>
28
- <block type="hardware_rgb_led_on">
29
- <field name="AC">anode</field>
30
- <field name="PIN">D3</field>
31
- <field name="COLOUR">#ffff99</field>
32
- <next>
33
- <block type="control_sleep" inline="true">
34
- <value name="SEC">
35
- <block type="math_number">
36
- <field name="NUM">1</field>
37
- </block>
38
- </value>
39
- <next>
40
- <block type="hardware_rgb_led_on">
41
- <field name="AC">anode</field>
42
- <field name="PIN">D3</field>
43
- <field name="COLOUR">#ff0000</field>
44
- <next>
45
- <block type="control_sleep" inline="true">
46
- <value name="SEC">
47
- <block type="math_number">
48
- <field name="NUM">1</field>
49
- </block>
50
- </value>
51
- <next>
52
- <block type="hardware_rgb_led_off">
53
- <field name="AC">anode</field>
54
- <field name="PIN">D3</field>
55
- <next>
56
- <block type="looks_say" inline="true">
57
- <value name="TEXT">
58
- <block type="text">
59
- <field name="TEXT" />
60
- </block>
61
- </value>
62
- </block>
63
- </next>
64
- </block>
65
- </next>
66
- </block>
67
- </next>
68
- </block>
69
- </next>
70
- </block>
71
- </next>
72
- </block>
73
- </next>
74
- </block>
75
- </next>
76
- </block>
77
- </next>
78
- </block>
79
- </statement>
80
- </block>
81
- </statement>
82
- </block>
83
- </xml>
@@ -1,33 +0,0 @@
1
- # encoding: utf-8
2
- # language: ja
3
- @javascript
4
- 機能: Base - 基本
5
- シナリオ: トップページにアクセスしてエディタ画面を表示する
6
- もし "トップページ" にアクセスする
7
-
8
- ならば "ブロックタブ" が表示されていること
9
- かつ "プログラム名の入力欄" が表示されていること
10
- かつ "ダウンロードボタン" が表示されていること
11
-
12
- シナリオ: エディタ画面を表示してRubyタブに切り替える
13
- 前提 "エディタ" 画面を表示する
14
-
15
- もし "Rubyタブ" にタブを切り替える
16
-
17
- ならば "Rubyタブ" が表示されていること
18
- かつ "テキストエディタ" が表示されていること
19
- かつ "プログラム名の入力欄" が表示されていること
20
- かつ "ダウンロードボタン" が表示されていること
21
- かつ テキストエディタにフォーカスがあること
22
- かつ テキストエディタの 0 行目の 0 文字目にカーソルがあること
23
-
24
- シナリオ: プログラムを入力後にページを遷移する
25
- 前提 "Ruby" タブを表示する
26
- かつ テキストエディタに "puts 'Hello, World!'" を入力済みである
27
- かつ プログラムの名前に "01.rb" を指定する
28
-
29
- もし ページをリロードする
30
- かつ 警告ダイアログの "dismiss" ボタンをクリックする
31
-
32
- ならば テキストエディタのプログラムは "puts 'Hello, World!'" であること
33
- かつ "プログラム名の入力欄" は "01.rb" であること
@@ -1,77 +0,0 @@
1
- # encoding: utf-8
2
-
3
- text_editor = 'テキストエディタ'
4
-
5
- step 'テキストエディタにフォーカスがあること' do
6
- expect(page.evaluate_script(<<-JS)).to be_true
7
- ace.edit('#{NAME_INFO[text_editor][:id]}').isFocused()
8
- JS
9
- end
10
-
11
- step 'テキストエディタの :row 行目の :column 文字目にカーソルがあること' do |row, column|
12
- get_cursor_position_js =
13
- "ace.edit('#{NAME_INFO[text_editor][:id]}').getCursorPosition()"
14
- expect(page.evaluate_script("#{get_cursor_position_js}.row")).to eq(row.to_i)
15
- expect(page.evaluate_script("#{get_cursor_position_js}.column"))
16
- .to eq(column.to_i)
17
- end
18
-
19
- step 'テキストエディタに :program を入力済みである' do |program|
20
- send 'テキストエディタにプログラムを入力済みである:', program
21
- end
22
-
23
- step 'テキストエディタにプログラムを入力済みである:' do |program|
24
- page.execute_script(<<-JS)
25
- ace.edit('#{NAME_INFO[text_editor][:id]}')
26
- .getSession()
27
- .getDocument()
28
- .setValue('#{program.gsub(/'/, "\\\\'")}')
29
- JS
30
- end
31
-
32
- step 'テキストエディタに :filename を読み込むこと' do |filename|
33
- js = <<-JS
34
- ace.edit('#{NAME_INFO[text_editor][:id]}')
35
- .getSession()
36
- .getDocument()
37
- .getValue()
38
- JS
39
- path = Pathname(fixture_path).join(filename)
40
- expect(page.evaluate_script(js)).to eq(path.read)
41
- end
42
-
43
- step 'テキストエディタのプログラムは以下であること:' do |program|
44
- expect(page.evaluate_script(<<-JS)).to eq(program)
45
- ace.edit('#{NAME_INFO[text_editor][:id]}')
46
- .getSession()
47
- .getDocument()
48
- .getValue()
49
- JS
50
- end
51
-
52
- step 'テキストエディタのプログラムは以下を含むこと:' do |program|
53
- expect(page.evaluate_script(<<-JS)).to include(program)
54
- ace.edit('#{NAME_INFO[text_editor][:id]}')
55
- .getSession()
56
- .getDocument()
57
- .getValue()
58
- JS
59
- end
60
-
61
- step 'テキストエディタのプログラムは以下を含まないこと:' do |program|
62
- expect(page.evaluate_script(<<-JS)).not_to include(program)
63
- ace.edit('#{NAME_INFO[text_editor][:id]}')
64
- .getSession()
65
- .getDocument()
66
- .getValue()
67
- JS
68
- end
69
-
70
- step 'テキストエディタのプログラムは :program であること' do |program|
71
- expect(page.evaluate_script(<<-JS)).to eq(program)
72
- ace.edit('#{NAME_INFO[text_editor][:id]}')
73
- .getSession()
74
- .getDocument()
75
- .getValue()
76
- JS
77
- end