From 71ed4f60d7e1683976b93606c2563f23cbcd07ac Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 14 Jul 2015 14:21:33 +0300 Subject: [PATCH] more transition --- config/app.rb | 132 ----------------------------- config/base/index.html | 20 ----- config/initializers/boot_salama.rb | 3 - lib/main_view.rb | 1 + lib/parse_task.rb | 11 +++ lib/point.rb | 7 ++ lib/space_view.rb | 2 +- 7 files changed, 20 insertions(+), 156 deletions(-) delete mode 100644 config/app.rb delete mode 100644 config/base/index.html delete mode 100644 config/initializers/boot_salama.rb create mode 100644 lib/parse_task.rb create mode 100644 lib/point.rb diff --git a/config/app.rb b/config/app.rb deleted file mode 100644 index 770e613..0000000 --- a/config/app.rb +++ /dev/null @@ -1,132 +0,0 @@ -# app.rb is used to configure your app. This code is only run on the server, -# then any config options in config.public are passed to the client as well. - -Volt.configure do |config| - # Setup your global app config here. - - ####################################### - # Basic App Info (stuff you should set) - ####################################### - config.domain = 'salama-vm.org' - config.app_name = 'Salama-debugger' - config.mailer.from = 'Salama-debugger ' - - ############ - # App Secret - ############ - # Your app secret is used for signing things like the user cookie so it can't - # be tampered with. A random value is generated on new projects that will work - # without the need to customize. Make sure this value doesn't leave your server. - # - # For added security we recommend moving the app secret into an environment. You can - # setup that like so: - # - # config.app_secret = ENV['APP_SECRET'] - # - config.app_secret = 'pKDKhKInTaI5EVH9WmyN-cJSYnJt8PmDogwW63Zqr_ieUNqYvh1KybeWJoslylzFgsU' - - ############### - # Log Filtering - ############### - # Data updates from the client come in via Tasks. The task dispatcher logs all calls to tasks. - # By default hashes in the arguments can be filtered based on keys. So any hash with a key of - # password will be filtered. You can add more fields to filter below: - config.filter_keys = [:password] - - ########## - # Database - ########## - # Database config all start with db_ and can be set either in the config - # file or with an environment variable (DB_NAME for example). - - # config.db_driver = 'mongo' - # config.db_name = (config.app_name + '_' + Volt.env.to_s) - # config.db_host = 'localhost' - # config.db_port = 27017 - - ##################### - # Compression options - ##################### - # If you are not running behind something like nginx in production, you can - # have rack deflate all files. - # config.deflate = true - - ####################### - # Public configurations - ####################### - # Anything under config.public will be sent to the client as well as the server, - # so be sure no private data ends up under public - - # Use username instead of email as the login - # config.public.auth.use_username = true - - ##################### - # Compression Options - ##################### - # Disable or enable css/js compression. Default is to only run in production. - # if Volt.env.production? - # config.compress_javascript = true - # config.compress_css = true - # end - - ################ - # Mailer options - ################ - # The volt-mailer gem uses pony (https://github.com/benprew/pony) to deliver e-mail. Any - # options you would pass to pony can be setup below. - # NOTE: The from address is setup at the top - - # Normally pony uses /usr/sbin/sendmail if one is installed. You can specify smtp below: - # config.mailer.via = :smtp - # config.mailer.via_options = { - # :address => 'smtp.yourserver.com', - # :port => '25', - # :user_name => 'user', - # :password => 'password', - # :authentication => :plain, # :plain, :login, :cram_md5, no auth by default - # :domain => "localhost.localdomain" # the HELO domain provided by the client to the server - # } - - ############# - # Message Bus - ############# - # Volt provides a "Message Bus" out of the box. The message bus provides - # a pub/sub service between any volt instance (server, client, runner, etc..) - # that share the same database. The message bus can be used by app code. It - # is also used internally to push data to any listening clients. - # - # The default message bus (called "peer_to_peer") uses the database to sync - # socket ip's/ports. - # config.message_bus.bus_name = 'peer_to_peer' - # - # Encrypt message bus - messages on the message bus are encrypted by default - # but this is meant to be used locally by a developer - config.message_bus.disable_encryption = true - # - # ## MessageBus Server -- the message bus binds to a port and ip which the - # other volt instances need to be able to connect to. You can customize - # the server below: - # - # Port range - you can specify a range of ports that an instance can bind the - # message bus on. You can specify a range, an array of Integers, or an array - # of ranges. - # config.message_bus.bind_port_ranges = (58000..61000) - # - # Bind Ip - specifies the ip address the message bus server should bind on. - # config.message_bus.bind_ip = '127.0.0.1' - - ############# - # Concurrency - ############# - # Volt provides a thread worker pool for incoming task requests (and all - # database requests, since those use tasks to do their work.) The following - # lets you control the size of the worker pool. Threads are only created as - # needed, and are removed after a certain amount of inactivity. - # config.min_worker_threads = 1 - # config.max_worker_threads = 10 - # - # You can also specify the amount of time a Task should run for before it - # timeout's. Setting this to short can cause unexpected results, currently - # we recomend it be at least 10 seconds. - # config.worker_timeout = 60 -end diff --git a/config/base/index.html b/config/base/index.html deleted file mode 100644 index 3b3e895..0000000 --- a/config/base/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - <%# IMPORTANT: Please read before changing! %> - <%# This file is rendered on the server using ERB, so it does NOT use Volt's %> - <%# normal template system. You can add to it, but keep in mind the template %> - <%# language difference. This file handles auto-loading all JS/Opal and CSS. %> - - - <% javascript_files.each do |javascript_file| %> - - <% end %> - - <% css_files.each do |css_file| %> - - <% end %> - - - - - diff --git a/config/initializers/boot_salama.rb b/config/initializers/boot_salama.rb deleted file mode 100644 index b83f91a..0000000 --- a/config/initializers/boot_salama.rb +++ /dev/null @@ -1,3 +0,0 @@ -#require "salama" - -Virtual::Machine.boot diff --git a/lib/main_view.rb b/lib/main_view.rb index 2c1a521..be68244 100644 --- a/lib/main_view.rb +++ b/lib/main_view.rb @@ -1,6 +1,7 @@ require 'browser' require 'native' require "salama" +require "point" require_relative "registers_view" require_relative "object_view" diff --git a/lib/parse_task.rb b/lib/parse_task.rb new file mode 100644 index 0000000..de612cb --- /dev/null +++ b/lib/parse_task.rb @@ -0,0 +1,11 @@ +require "salama-reader" + +class ParseTask + def parse(num) + string_input = '"Hello again".putstring()' + parser = Parser::Salama.new + out = parser.parse(string_input) + parts = Parser::Transform.new.apply(out) + parts.to_basic + end +end diff --git a/lib/point.rb b/lib/point.rb new file mode 100644 index 0000000..12bfec7 --- /dev/null +++ b/lib/point.rb @@ -0,0 +1,7 @@ +class Point + def initialize x = 0 , y = 0 + @x = x + @y = y + end + attr_accessor :x , :y +end diff --git a/lib/space_view.rb b/lib/space_view.rb index 9795124..e77b417 100644 --- a/lib/space_view.rb +++ b/lib/space_view.rb @@ -21,7 +21,7 @@ Point.class_eval do end end -class SpaceView < Graphics +class SpaceView include Sof::Util def initialize