smalruby-editor 0.0.12-x86-mingw32 → 0.1.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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/.travis.yml +2 -0
- data/LEGAL +32 -0
- data/Rakefile +1 -1
- data/app/assets/demos/default.xml +126 -0
- data/app/assets/demos/rgb_led_anode.xml +83 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/application.js +18 -1
- data/app/assets/javascripts/block_mode.js.coffee.erb +10 -0
- data/app/assets/javascripts/blocks/blockly.js.coffee.erb +34 -0
- data/app/assets/javascripts/blocks/character.js.coffee.erb +76 -0
- data/app/assets/javascripts/blocks/control.js.coffee.erb +180 -0
- data/app/assets/javascripts/blocks/data.js.coffee.erb +6 -0
- data/app/assets/javascripts/blocks/etc.js.coffee.erb +6 -0
- data/app/assets/javascripts/blocks/events.js.coffee.erb +82 -0
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +313 -0
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +163 -0
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +297 -0
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +279 -0
- data/app/assets/javascripts/blocks/pen.js.coffee.erb +6 -0
- data/app/assets/javascripts/blocks/ruby.js.coffee.erb +74 -0
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +241 -0
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +75 -0
- data/{public/favicon.ico → app/assets/javascripts/collections/.keep} +0 -0
- data/app/assets/javascripts/collections/character_set.js.coffee +12 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +188 -0
- data/app/assets/javascripts/models/.keep +0 -0
- data/app/assets/javascripts/models/character.js.coffee +66 -0
- data/app/assets/javascripts/models/scene.js.coffee +5 -0
- data/app/assets/javascripts/models/source_code.js.coffee +64 -0
- data/app/assets/javascripts/routers/.keep +0 -0
- data/app/assets/javascripts/ruby_mode.js.coffee.erb +12 -0
- data/app/assets/javascripts/smalruby.js.coffee +97 -0
- data/app/assets/javascripts/views/.keep +0 -0
- data/app/assets/javascripts/views/character_modal_view.js.coffee +148 -0
- data/app/assets/javascripts/views/character_selector_view.js.coffee +109 -0
- data/app/assets/javascripts/views/main_menu_view.js.coffee +264 -0
- data/app/assets/stylesheets/editor.css.scss +318 -2
- data/app/assets/stylesheets/toolbox.css.scss.erb +62 -0
- data/app/assets/templates/.keep +0 -0
- data/app/controllers/application_controller.rb +19 -0
- data/app/controllers/editor_controller.rb +4 -0
- data/app/controllers/source_codes_controller.rb +8 -2
- data/app/helpers/application_helper.rb +1 -0
- data/app/helpers/editor_helper.rb +46 -0
- data/app/models/source_code.rb +49 -6
- data/app/views/editor/_block_tab.html.haml +53 -0
- data/app/views/editor/_character_modal.html.haml +53 -0
- data/app/views/editor/_toolbox.html.haml +384 -0
- data/app/views/editor/demo.html.erb +16 -0
- data/app/views/editor/index.html.haml +60 -0
- data/app/views/layouts/application.html.erb +7 -0
- data/config/application.rb +1 -0
- data/config/initializers/teaspoon.rb +79 -0
- data/config/routes.rb +4 -0
- data/lib/smalruby_editor/version.rb +1 -1
- data/lib/tasks/gem.rake +7 -4
- data/lib/tasks/release.rake +43 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/blockly/media/1x1.gif +0 -0
- data/public/blockly/media/click.mp3 +0 -0
- data/public/blockly/media/click.ogg +0 -0
- data/public/blockly/media/click.wav +0 -0
- data/public/blockly/media/delete.mp3 +0 -0
- data/public/blockly/media/delete.ogg +0 -0
- data/public/blockly/media/delete.wav +0 -0
- data/public/blockly/media/handclosed.cur +0 -0
- data/public/blockly/media/handopen.cur +0 -0
- data/public/blockly/media/quote0.png +0 -0
- data/public/blockly/media/quote1.png +0 -0
- data/public/blockly/media/trashbody.png +0 -0
- data/public/blockly/media/trashlid.png +0 -0
- data/public/blockly/media/tree.png +0 -0
- data/public/browserconfig.xml +1 -0
- data/public/large.png +0 -0
- data/public/smalruby/assets/ball1.png +0 -0
- data/public/smalruby/assets/ball2.png +0 -0
- data/public/smalruby/assets/ball3.png +0 -0
- data/public/smalruby/assets/ball4.png +0 -0
- data/public/smalruby/assets/ball5.png +0 -0
- data/public/smalruby/assets/ball6.png +0 -0
- data/public/smalruby/assets/car1.png +0 -0
- data/public/smalruby/assets/car2.png +0 -0
- data/public/smalruby/assets/car3.png +0 -0
- data/public/smalruby/assets/car4.png +0 -0
- data/public/smalruby/assets/cat1.png +0 -0
- data/public/smalruby/assets/cat2.png +0 -0
- data/public/smalruby/assets/cat3.png +0 -0
- data/public/smalruby/assets/frog1.png +0 -0
- data/public/smalruby/assets/piano_do.wav +0 -0
- data/public/smalruby/assets/piano_do_2.wav +0 -0
- data/public/smalruby/assets/piano_fa.wav +0 -0
- data/public/smalruby/assets/piano_mi.wav +0 -0
- data/public/smalruby/assets/piano_ra.wav +0 -0
- data/public/smalruby/assets/piano_re.wav +0 -0
- data/public/smalruby/assets/piano_si.wav +0 -0
- data/public/smalruby/assets/piano_so.wav +0 -0
- data/public/square.png +0 -0
- data/public/tiny.png +0 -0
- data/public/wide.png +0 -0
- data/smalruby-editor.gemspec +4 -0
- data/spec/acceptance/block_mode/blocks/character/new.feature +136 -0
- data/spec/acceptance/block_mode/blocks/control/await.feature +20 -0
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +39 -0
- data/spec/acceptance/block_mode/blocks/control/break.feature +20 -0
- data/spec/acceptance/block_mode/blocks/control/if.feature +68 -0
- data/spec/acceptance/block_mode/blocks/control/if_else.feature +78 -0
- data/spec/acceptance/block_mode/blocks/control/loop.feature +45 -0
- data/spec/acceptance/block_mode/blocks/control/next.feature +20 -0
- data/spec/acceptance/block_mode/blocks/control/redo.feature +20 -0
- data/spec/acceptance/block_mode/blocks/control/sleep.feature +41 -0
- data/spec/acceptance/block_mode/blocks/control/times.feature +72 -0
- data/spec/acceptance/block_mode/blocks/control/until.feature +68 -0
- data/spec/acceptance/block_mode/blocks/events/on_click.feature +75 -0
- data/spec/acceptance/block_mode/blocks/events/on_hit.feature +83 -0
- data/spec/acceptance/block_mode/blocks/events/on_key_push_or_down.feature +171 -0
- data/spec/acceptance/block_mode/blocks/events/on_start.feature +75 -0
- data/spec/acceptance/block_mode/blocks/hardware/init_hardware.feature +44 -0
- data/spec/acceptance/block_mode/blocks/hardware/led_off.feature +75 -0
- data/spec/acceptance/block_mode/blocks/hardware/led_on.feature +75 -0
- data/spec/acceptance/block_mode/blocks/hardware/on_sensor_change.feature +81 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_off.feature +81 -0
- data/spec/acceptance/block_mode/blocks/hardware/rgb_led_on.feature +87 -0
- data/spec/acceptance/block_mode/blocks/hardware/sensor_value.feature +100 -0
- data/spec/acceptance/block_mode/blocks/looks/hide.feature +69 -0
- data/spec/acceptance/block_mode/blocks/looks/say.feature +106 -0
- data/spec/acceptance/block_mode/blocks/looks/show.feature +69 -0
- data/spec/acceptance/block_mode/blocks/looks/vanish.feature +69 -0
- data/spec/acceptance/block_mode/blocks/motion/change_x_by.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/change_y_by.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/move.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/reach_wall.feature +98 -0
- data/spec/acceptance/block_mode/blocks/motion/rotate_left.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/rotate_right.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/self_angle.feature +92 -0
- data/spec/acceptance/block_mode/blocks/motion/self_x.feature +92 -0
- data/spec/acceptance/block_mode/blocks/motion/self_y.feature +92 -0
- data/spec/acceptance/block_mode/blocks/motion/set_angle.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/set_x.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/set_x_y.feature +95 -0
- data/spec/acceptance/block_mode/blocks/motion/set_y.feature +81 -0
- data/spec/acceptance/block_mode/blocks/motion/turn.feature +69 -0
- data/spec/acceptance/block_mode/blocks/motion/turn_if_reach_wall.feature +69 -0
- data/spec/acceptance/block_mode/blocks/sensing/character_property.feature +114 -0
- data/spec/acceptance/block_mode/blocks/sensing/hit.feature +110 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_key_push_or_down.feature +91 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_x.feature +39 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_pos_y.feature +39 -0
- data/spec/acceptance/block_mode/blocks/sensing/input_mouse_push_or_down.feature +91 -0
- data/spec/acceptance/block_mode/blocks/sensing/time_now.feature +43 -0
- data/spec/acceptance/block_mode/blocks/sound/play.feature +81 -0
- data/spec/acceptance/block_mode/demo.feature +49 -0
- data/spec/acceptance/{text_editor → ruby_mode}/base.feature +11 -2
- data/spec/acceptance/{standalone → ruby_mode}/check.feature +8 -9
- data/spec/acceptance/ruby_mode/download.feature +33 -0
- data/spec/acceptance/{text_editor → ruby_mode}/load.feature +13 -13
- data/spec/acceptance/standalone/run.feature +17 -0
- data/spec/acceptance/standalone/save.feature +6 -6
- data/spec/helpers/editor_helper_spec.rb +110 -10
- data/spec/javascripts/collections/character_set_spec.coffee +41 -0
- data/spec/javascripts/models/character_spec.coffee +146 -0
- data/spec/javascripts/models/scene_spec.coffee +15 -0
- data/spec/javascripts/spec_helper.js +29 -0
- data/spec/spec_helper.rb +3 -8
- data/spec/steps/block_mode_steps.rb +37 -0
- data/spec/steps/global_variable.rb +30 -6
- data/spec/steps/text_editor_steps.rb +20 -2
- data/spec/teaspoon_env.rb +46 -0
- data/vendor/assets/javascripts/blockly/blockly_compressed.js +992 -0
- data/vendor/assets/javascripts/blockly/blocks_compressed.js +129 -0
- data/vendor/assets/javascripts/blockly/msg/js/ja.js +377 -0
- data/vendor/assets/javascripts/jquery.blockUI.js +619 -0
- metadata +290 -23
- data/app/assets/javascripts/editor.js.coffee.erb +0 -137
- data/app/views/editor/index.html.erb +0 -22
- data/spec/acceptance/text_editor/check.feature +0 -29
- data/spec/acceptance/text_editor/save.feature +0 -34
- data/spec/support/assets.rb +0 -18
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= render template: 'editor/index' %>
|
2
|
+
|
3
|
+
<script type="text/javascript">
|
4
|
+
$(function() {
|
5
|
+
var data = '<%= escape_javascript(File.read(Rails.root.join("app/assets/demos/#{@filename}"))) %>';
|
6
|
+
data = $('<div>').html(data).text();
|
7
|
+
Smalruby.loadXml(data);
|
8
|
+
|
9
|
+
<% if @filename != 'default.xml' %>
|
10
|
+
var filename = $('<div>').html('<%= escape_javascript(@filename.sub(/\.xml$/, '.rb')) %>').text();
|
11
|
+
$('#filename').val(filename)
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
window.changed = false;
|
15
|
+
});
|
16
|
+
</script>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
.navbar{:id => "main-menu", :class => 'navbar-inverse'}
|
2
|
+
.navbar-inner
|
3
|
+
%ul.nav{:id => 'tabs'}
|
4
|
+
%li.active
|
5
|
+
%a{:href => '#block-tab', :'data-toggle' => 'tab'}<
|
6
|
+
%i.icon-folder-close
|
7
|
+
ブロック
|
8
|
+
%li
|
9
|
+
%a{:href => '#ruby-tab', :'data-toggle' => 'tab'}<
|
10
|
+
%i.icon-pencil
|
11
|
+
Ruby
|
12
|
+
|
13
|
+
= form_tag(source_codes_load_path, id: "file-form", class: "navbar-form pull-right", method: "post", multipart: true) do
|
14
|
+
%input#load-file{:type => 'file', :name => 'source_code[file]', :style => 'display: none'}
|
15
|
+
%input#filename{:type => 'text', :class => 'span4', :placeholder => 'プログラムの名前を入れてね(例:01.rb)'}
|
16
|
+
= link_to '', source_codes_download_path, id: 'download-link', style: 'display: none', 'data-method' => 'delete'
|
17
|
+
|
18
|
+
- if standalone?
|
19
|
+
%button#run-button{:class => "btn btn-primary"}<
|
20
|
+
%i.icon-play
|
21
|
+
実行
|
22
|
+
- else
|
23
|
+
%button#download-button{:class => "btn btn-primary"}<
|
24
|
+
%i.icon-download-alt
|
25
|
+
ダウンロード
|
26
|
+
|
27
|
+
.btn-group
|
28
|
+
%a#submenu-button{:class => "dropdown-toggle btn btn-primary", :"data-toggle" => "dropdown", :href => "#"}
|
29
|
+
%i.icon-reorder
|
30
|
+
%ul.dropdown-menu{:class => "pull-right"}
|
31
|
+
%li
|
32
|
+
%a#load-button
|
33
|
+
%h4
|
34
|
+
%i.icon-folder-open
|
35
|
+
ロード
|
36
|
+
- if standalone?
|
37
|
+
%li
|
38
|
+
%a#save-button
|
39
|
+
%h4
|
40
|
+
%i.icon-hdd
|
41
|
+
セーブ
|
42
|
+
%li
|
43
|
+
%a#check-button
|
44
|
+
%h4
|
45
|
+
%i.icon-check
|
46
|
+
チェック
|
47
|
+
%li
|
48
|
+
%a#reset-button
|
49
|
+
%h4
|
50
|
+
%i.icon-off
|
51
|
+
リセット
|
52
|
+
|
53
|
+
#messages
|
54
|
+
|
55
|
+
#modes-container{:class => 'tab-content'}
|
56
|
+
#block-tab{:class => 'tab-pane active modes-tab-pane'}
|
57
|
+
= render 'block_tab'
|
58
|
+
|
59
|
+
#ruby-tab{:class => 'tab-pane modes-tab-pane'}
|
60
|
+
#text-editor
|
@@ -3,6 +3,13 @@
|
|
3
3
|
<head>
|
4
4
|
<title>smalruby-editor</title>
|
5
5
|
<%= favicon_link_tag %>
|
6
|
+
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
|
7
|
+
<meta name="application-name" content="Smalruby" />
|
8
|
+
<meta name="msapplication-TileColor" content="#0088cc" />
|
9
|
+
<meta name="msapplication-square70x70logo" content="tiny.png" />
|
10
|
+
<meta name="msapplication-square150x150logo" content="square.png" />
|
11
|
+
<meta name="msapplication-wide310x150logo" content="wide.png" />
|
12
|
+
<meta name="msapplication-square310x310logo" content="large.png" />
|
6
13
|
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
7
14
|
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
8
15
|
<%= csrf_meta_tags %>
|
data/config/application.rb
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
# rubocop:disable LeadingCommentSpace,RegexpLiteral
|
2
|
+
Teaspoon.setup do |config|
|
3
|
+
# This determines where the Teaspoon routes will be
|
4
|
+
# mounted. Changing this to '/jasmine' would allow you to browse to
|
5
|
+
# http://localhost:3000/jasmine to run your specs.
|
6
|
+
config.mount_at = '/teaspoon'
|
7
|
+
|
8
|
+
# This defaults to Rails.root if left nil. If you're testing an
|
9
|
+
# engine using a dummy application it can be useful to set this to
|
10
|
+
# your engines root.. E.g. `Teaspoon::Engine.root`
|
11
|
+
config.root = nil
|
12
|
+
|
13
|
+
# These paths are appended to the Rails assets paths (relative to
|
14
|
+
# config.root), and by default is an array that you can replace or
|
15
|
+
# add to.
|
16
|
+
config.asset_paths = ['spec/javascripts', 'spec/javascripts/stylesheets']
|
17
|
+
|
18
|
+
# Fixtures are rendered through a standard controller. This means
|
19
|
+
# you can use things like HAML or RABL/JBuilder, etc. to generate
|
20
|
+
# fixtures within this path.
|
21
|
+
config.fixture_path = 'spec/javascripts/fixtures'
|
22
|
+
|
23
|
+
# You can modify the default suite configuration and create new
|
24
|
+
# suites here. Suites can be isolated from one another. When
|
25
|
+
# defining a suite you can provide a name and a block. If the name
|
26
|
+
# is left blank, :default is assumed. You can omit various
|
27
|
+
# directives and the defaults will be used.
|
28
|
+
#
|
29
|
+
# To run a specific suite
|
30
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
31
|
+
# - from the command line: rake teaspoon suite=[suite_name]
|
32
|
+
config.suite do |suite|
|
33
|
+
# You can specify a file matcher and all matching files will be
|
34
|
+
# loaded when the suite is run. It's important that these files
|
35
|
+
# are serve-able from sprockets.
|
36
|
+
#
|
37
|
+
# Note: Can also be set to nil.
|
38
|
+
suite.matcher =
|
39
|
+
'{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}'
|
40
|
+
|
41
|
+
# Each suite can load a different helper, which can in turn
|
42
|
+
# require additional files. This file is loaded before your specs
|
43
|
+
# are loaded, and can be used as a manifest.
|
44
|
+
suite.helper = 'spec_helper'
|
45
|
+
|
46
|
+
# These are the core Teaspoon javascripts. It's strongly
|
47
|
+
# encouraged to include only the base files here. You can require
|
48
|
+
# other support libraries in your spec helper, which allows you to
|
49
|
+
# change them without having to restart the server.
|
50
|
+
#
|
51
|
+
# Available frameworks: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
|
52
|
+
#
|
53
|
+
# Note: To use the CoffeeScript source files use `'teaspoon/jasmine'` etc.
|
54
|
+
suite.javascripts = ['teaspoon-jasmine']
|
55
|
+
|
56
|
+
# If you want to change how Teaspoon looks, or include your own
|
57
|
+
# stylesheets you can do that here. The default is the stylesheet
|
58
|
+
# for the HTML reporter.
|
59
|
+
suite.stylesheets = ['teaspoon']
|
60
|
+
|
61
|
+
# When running coverage reports, you probably want to exclude
|
62
|
+
# libraries that you're not testing. Accepts an array of
|
63
|
+
# filenames or regular expressions. The default is to exclude
|
64
|
+
# assets from vendors or gems.
|
65
|
+
suite.no_coverage =
|
66
|
+
[%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/},
|
67
|
+
%r{/(.+)_helper.}]
|
68
|
+
# excludes jquery from coverage reports
|
69
|
+
# suite.no_coverage << 'jquery.min.js'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Example suite. Since we're just filtering to files already within
|
73
|
+
# the root spec/javascripts, these files will also be run in the
|
74
|
+
# default suite -- but can be focused into a more specific suite.
|
75
|
+
#config.suite :targeted do |suite|
|
76
|
+
# suite.matcher = 'spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}'
|
77
|
+
#end
|
78
|
+
end if defined?(Teaspoon) && Teaspoon.respond_to?(:setup)
|
79
|
+
# let Teaspoon be undefined outside of development/test/asset groups
|
data/config/routes.rb
CHANGED
@@ -2,11 +2,15 @@
|
|
2
2
|
SmalrubyEditor::Application.routes.draw do
|
3
3
|
root 'editor#index'
|
4
4
|
|
5
|
+
match '/demo(/:filename)' => 'editor#demo',
|
6
|
+
defaults: { filename: 'default' }, via: :get
|
7
|
+
|
5
8
|
resources :source_codes, only: [:create]
|
6
9
|
post 'source_codes/check'
|
7
10
|
delete 'source_codes/download'
|
8
11
|
post 'source_codes/load'
|
9
12
|
delete 'source_codes/write'
|
13
|
+
post 'source_codes/run'
|
10
14
|
|
11
15
|
# The priority is based upon order of creation: first created ->
|
12
16
|
# highest priority.
|
data/lib/tasks/gem.rake
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
require 'bundler/
|
1
|
+
require 'bundler/gem_helper'
|
2
|
+
|
3
|
+
namespace :gem do
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
end
|
2
6
|
|
3
7
|
task 'assets:precompile:standalone' do
|
4
8
|
Rails.env = ENV['RAILS_ENV'] = 'standalone'
|
9
|
+
Rake::Task['assets:precompile'].reenable
|
5
10
|
Rake::Task['assets:precompile'].invoke
|
6
11
|
end
|
7
12
|
|
8
|
-
task 'build' => ['assets:clobber', 'assets:precompile:standalone']
|
9
|
-
|
10
|
-
|
13
|
+
task 'gem:build' => ['assets:clobber', 'assets:precompile:standalone']
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
task :build do
|
4
|
+
ENV['GEM_PLATFORM'] = 'linux'
|
5
|
+
Rake::Task['gem:build'].invoke
|
6
|
+
|
7
|
+
ENV['GEM_PLATFORM'] = 'x86-mingw32'
|
8
|
+
Rake::Task['gem:build'].reenable
|
9
|
+
Rake::Task['assets:clobber'].reenable
|
10
|
+
Rake::Task['assets:precompile:standalone'].reenable
|
11
|
+
Rake::Task['gem:build'].invoke
|
12
|
+
end
|
13
|
+
|
14
|
+
task :release do
|
15
|
+
ENV['GEM_PLATFORM'] = 'linux'
|
16
|
+
Rake::Task['gem:release'].invoke
|
17
|
+
|
18
|
+
ENV['GEM_PLATFORM'] = 'x86-mingw32'
|
19
|
+
Rake::Task['gem:release'].reenable
|
20
|
+
Rake::Task['gem:build'].reenable
|
21
|
+
Rake::Task['assets:clobber'].reenable
|
22
|
+
Rake::Task['assets:precompile:standalone'].reenable
|
23
|
+
Rake::Task['gem:release'].invoke
|
24
|
+
|
25
|
+
sh 'git mirror'
|
26
|
+
sh 'relish push smalruby/smalruby-editor'
|
27
|
+
|
28
|
+
require 'lib/smalruby_editor/version'
|
29
|
+
next_version = SmalrubyEditor::VERSION.split('.').tap { |versions|
|
30
|
+
versions[-1] = (versions[-1].to_i + 1).to_s
|
31
|
+
}.join('.')
|
32
|
+
File.open('lib/smalruby_editor/version.rb', 'w+') do |f|
|
33
|
+
lines = []
|
34
|
+
while line = f.gets
|
35
|
+
line = "#{$1} '#{next_version}'\n" if /(\s*VERSION = )/.match(line)
|
36
|
+
lines << line
|
37
|
+
end
|
38
|
+
f.rewind
|
39
|
+
f.write(lines.join("\n"))
|
40
|
+
end
|
41
|
+
sh "git commit -m 'バージョンを#{next_version}に更新'"
|
42
|
+
sh 'git push'
|
43
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><browserconfig><msapplication><tile><square70x70logo src="tiny.png"/><square150x150logo src="square.png"/><wide310x150logo src="wide.png"/><square310x310logo src="large.png"/><TileColor>#0088cc</TileColor></tile></msapplication></browserconfig>
|
data/public/large.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/public/square.png
ADDED
Binary file
|
data/public/tiny.png
ADDED
Binary file
|
data/public/wide.png
ADDED
Binary file
|
data/smalruby-editor.gemspec
CHANGED
@@ -70,6 +70,10 @@ Gem::Specification.new do |spec|
|
|
70
70
|
['shared-mime-info'],
|
71
71
|
['launchy'],
|
72
72
|
['mime-types', '~> 1.16'],
|
73
|
+
['haml-rails'],
|
74
|
+
['jquery-ui-rails'],
|
75
|
+
['backbone-on-rails'],
|
76
|
+
['smalruby'],
|
73
77
|
]
|
74
78
|
runtime_dependencies << ['therubyracer'] unless is_windows
|
75
79
|
runtime_dependencies.each do |args|
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# language: ja
|
3
|
+
@javascript
|
4
|
+
機能: character_new - 「キャラクター」ブロック
|
5
|
+
シナリオ: ブロックのみ配置する
|
6
|
+
前提 "ブロック" タブを表示する
|
7
|
+
かつ 次のキャラクターを追加する:
|
8
|
+
| name | costumes | x | y | angle |
|
9
|
+
| car1 | car4.png | 300 | 200 | 90 |
|
10
|
+
|
11
|
+
もし 次のブロックを配置する:
|
12
|
+
"""
|
13
|
+
%block{:type => "character_new", :x => "0", :y => "0"}
|
14
|
+
%field{:name => "NAME"}<
|
15
|
+
car1
|
16
|
+
"""
|
17
|
+
かつ ブロックからソースコードを生成する
|
18
|
+
|
19
|
+
ならば テキストエディタのプログラムは以下であること:
|
20
|
+
"""
|
21
|
+
require "smalruby"
|
22
|
+
|
23
|
+
car1 = Character.new(costume: "car4.png", x: 300, y: 200, angle: 90)
|
24
|
+
|
25
|
+
"""
|
26
|
+
|
27
|
+
シナリオ: ブロックとその内部にキャラクターの操作ブロックを配置する
|
28
|
+
前提 "ブロック" タブを表示する
|
29
|
+
かつ 次のキャラクターを追加する:
|
30
|
+
| name | costumes | x | y | angle |
|
31
|
+
| car1 | car4.png | 300 | 200 | 90 |
|
32
|
+
|
33
|
+
もし 次のブロックを配置する:
|
34
|
+
"""
|
35
|
+
%block{:type => "character_new", :x => "0", :y => "0"}
|
36
|
+
%field{:name => "NAME"}<
|
37
|
+
car1
|
38
|
+
%statement{:name => "DO"}
|
39
|
+
%block{:type => "motion_move", :x => "0", :y => "0"}
|
40
|
+
%value{:name => "STEP"}
|
41
|
+
%block{:type => "math_number"}
|
42
|
+
%field{:name => "NUM"}<
|
43
|
+
10
|
44
|
+
"""
|
45
|
+
かつ ブロックからソースコードを生成する
|
46
|
+
|
47
|
+
ならば テキストエディタのプログラムは以下であること:
|
48
|
+
"""
|
49
|
+
require "smalruby"
|
50
|
+
|
51
|
+
car1 = Character.new(costume: "car4.png", x: 300, y: 200, angle: 90)
|
52
|
+
car1.move(10)
|
53
|
+
|
54
|
+
"""
|
55
|
+
|
56
|
+
シナリオ: 複数のブロックとその内部にキャラクターの操作ブロックを配置する
|
57
|
+
前提 "ブロック" タブを表示する
|
58
|
+
かつ 次のキャラクターを追加する:
|
59
|
+
| name | costumes | x | y | angle |
|
60
|
+
| car1 | car4.png | 300 | 200 | 90 |
|
61
|
+
|
62
|
+
もし 次のブロックを配置する:
|
63
|
+
"""
|
64
|
+
%block{:type => "character_new", :x => "0", :y => "0"}
|
65
|
+
%field{:name => "NAME"}<
|
66
|
+
car1
|
67
|
+
%statement{:name => "DO"}
|
68
|
+
%block{:type => "motion_move", :x => "0", :y => "0"}
|
69
|
+
%value{:name => "STEP"}
|
70
|
+
%block{:type => "math_number"}
|
71
|
+
%field{:name => "NUM"}<
|
72
|
+
10
|
73
|
+
%block{:type => "character_new", :x => "0", :y => "30"}
|
74
|
+
%field{:name => "NAME"}<
|
75
|
+
car1
|
76
|
+
%statement{:name => "DO"}
|
77
|
+
%block{:type => "motion_move", :x => "0", :y => "0"}
|
78
|
+
%value{:name => "STEP"}
|
79
|
+
%block{:type => "math_number"}
|
80
|
+
%field{:name => "NUM"}<
|
81
|
+
5
|
82
|
+
"""
|
83
|
+
かつ ブロックからソースコードを生成する
|
84
|
+
|
85
|
+
ならば テキストエディタのプログラムは以下であること:
|
86
|
+
"""
|
87
|
+
require "smalruby"
|
88
|
+
|
89
|
+
car1 = Character.new(costume: "car4.png", x: 300, y: 200, angle: 90)
|
90
|
+
car1.move(10)
|
91
|
+
|
92
|
+
car1.move(5)
|
93
|
+
|
94
|
+
"""
|
95
|
+
|
96
|
+
シナリオ: 複数のキャラクターのブロックとその内部にキャラクターの操作ブロックを配置する
|
97
|
+
前提 "ブロック" タブを表示する
|
98
|
+
かつ 次のキャラクターを追加する:
|
99
|
+
| name | costumes | x | y | angle |
|
100
|
+
| car1 | car4.png | 300 | 200 | 90 |
|
101
|
+
| cat1 | cat2.png | 100 | 400 | 180 |
|
102
|
+
|
103
|
+
もし 次のブロックを配置する:
|
104
|
+
"""
|
105
|
+
%block{:type => "character_new", :x => "0", :y => "0"}
|
106
|
+
%field{:name => "NAME"}<
|
107
|
+
car1
|
108
|
+
%statement{:name => "DO"}
|
109
|
+
%block{:type => "motion_move", :x => "0", :y => "0"}
|
110
|
+
%value{:name => "STEP"}
|
111
|
+
%block{:type => "math_number"}
|
112
|
+
%field{:name => "NUM"}<
|
113
|
+
10
|
114
|
+
%block{:type => "character_new", :x => "0", :y => "30"}
|
115
|
+
%field{:name => "NAME"}<
|
116
|
+
cat1
|
117
|
+
%statement{:name => "DO"}
|
118
|
+
%block{:type => "motion_move", :x => "0", :y => "0"}
|
119
|
+
%value{:name => "STEP"}
|
120
|
+
%block{:type => "math_number"}
|
121
|
+
%field{:name => "NUM"}<
|
122
|
+
5
|
123
|
+
"""
|
124
|
+
かつ ブロックからソースコードを生成する
|
125
|
+
|
126
|
+
ならば テキストエディタのプログラムは以下であること:
|
127
|
+
"""
|
128
|
+
require "smalruby"
|
129
|
+
|
130
|
+
car1 = Character.new(costume: "car4.png", x: 300, y: 200, angle: 90)
|
131
|
+
cat1 = Character.new(costume: "cat2.png", x: 100, y: 400, angle: 180)
|
132
|
+
car1.move(10)
|
133
|
+
|
134
|
+
cat1.move(5)
|
135
|
+
|
136
|
+
"""
|