atome 0.1.00003 → 0.1.00005
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.
- checksums.yaml +4 -4
- data/app_builder_helpers/Rakefile +63 -0
- data/exe/atome +31 -20
- data/lib/atome/kernel/atome_genesis.rb +1 -43
- data/lib/atome/kernel/properties/geometry.rb +2 -112
- data/lib/atome/renderers/headless/headless.rb +0 -4
- data/lib/atome/renderers/headless/properties/generator.rb +0 -6
- data/lib/atome/renderers/opal/opal_browser.rb +3 -5
- data/lib/atome/renderers/opal/opal_parser.rb +1 -0
- data/lib/atome/renderers/opal/properties/generator.rb +0 -6
- data/lib/atome/version.rb +1 -1
- data/lib/atome.rb +3 -26
- data/vendor/assets/index.rb +5 -34
- data/vendor/assets/server/atome_server.rb +5 -6
- data/{run_helpers/start_server.ru → vendor/assets/server/config.ru} +1 -1
- metadata +4 -4
- data/run_helpers/Rakefile +0 -150
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f6420aa5eb2c2e138e62926290c79f2935e7660b00b8a1aea77667cd9e9dbe6
|
|
4
|
+
data.tar.gz: fcffc2e81baa1f1f17c6e553e662395c5d9382df821587047672c0e47d63342c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ad7bf10643391d1ede8c50679996479c3ef0638ca517d355de2a22471bab1011ab66fe5b024ea5703c909b1b3a72daeb237f626c2a47ece1fcadac6449a1427
|
|
7
|
+
data.tar.gz: 113c039e4eec47334191b6280a87eab6b7eda2d9a8c939078ac97b181383d7f0049136fb70728fe340caab9281930977445e64087eb497af0c90a24843909dde
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'opal'
|
|
4
|
+
require 'opal-jquery'
|
|
5
|
+
require 'opal-browser'
|
|
6
|
+
require 'parser'
|
|
7
|
+
require 'uglifier'
|
|
8
|
+
|
|
9
|
+
Opal.append_path 'app'
|
|
10
|
+
|
|
11
|
+
def build_opal_browser(user_project_path)
|
|
12
|
+
browser_js = "#{user_project_path}/build/js/opal/opal_browser.js"
|
|
13
|
+
browser_content= Opal::Builder.build('../lib/atome/renderers/opal/opal_browser.rb').to_s
|
|
14
|
+
browser_content.gsub!("$$$('STDERR')['$write_proc='](typeof(process) === 'object' && typeof(process.stderr) === 'object' ? function(s){process.stderr.write(s)} : function(s){console.warn(s)});","$$$('STDERR')['$write_proc='](typeof(process) === 'object' && typeof(process.stderr) === 'object' ? function(s){process.stderr.write(s)} : function(s){});")
|
|
15
|
+
uglified = Uglifier.new.compile(browser_content)
|
|
16
|
+
File.open(browser_js, 'w') do |f|
|
|
17
|
+
f.puts uglified
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def build_atome_kernel(user_project_path, gem_location)
|
|
22
|
+
kernel_js = "#{user_project_path}/build/js/atome/kernel.js"
|
|
23
|
+
builder = Opal::Builder.new
|
|
24
|
+
builder.append_paths("#{gem_location}/../lib/")
|
|
25
|
+
kernel_content=builder.build("#{gem_location}/../lib/atome.rb").to_s
|
|
26
|
+
uglified = Uglifier.new.compile(kernel_content)
|
|
27
|
+
File.open(kernel_js, 'w') do |f|
|
|
28
|
+
f.puts uglified
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def build_opal_parser(user_project_path)
|
|
33
|
+
parser_js = "#{user_project_path}/build/js/opal/opal_parser.js"
|
|
34
|
+
parser_content = Opal::Builder.build('../lib/atome/renderers/opal/opal_parser.rb').to_s
|
|
35
|
+
uglified = Uglifier.new.compile(parser_content)
|
|
36
|
+
File.open(parser_js, 'w') do |f|
|
|
37
|
+
f.puts uglified
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def build_user_code(user_project_path)
|
|
42
|
+
application_js = "#{user_project_path}/build/js/application.js"
|
|
43
|
+
application_content= Opal::Builder.build('../vendor/assets/index.rb').to_s
|
|
44
|
+
uglified = Uglifier.new.compile(application_content)
|
|
45
|
+
File.open(application_js, 'w') do |f|
|
|
46
|
+
f.puts uglified
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
task :system_builder do
|
|
51
|
+
user_project_path = ARGV[1]
|
|
52
|
+
gem_location = File.join(File.dirname(__FILE__))
|
|
53
|
+
build_atome_kernel(user_project_path, gem_location)
|
|
54
|
+
build_opal_browser(user_project_path)
|
|
55
|
+
build_opal_parser(user_project_path)
|
|
56
|
+
build_user_code(user_project_path)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
task :build do
|
|
60
|
+
puts 'nothing for now'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
task default: :build
|
data/exe/atome
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
require 'atome'
|
|
5
4
|
require 'fileutils'
|
|
6
5
|
|
|
6
|
+
def run option = :browser, location = nil
|
|
7
|
+
case option
|
|
8
|
+
when :server
|
|
9
|
+
require 'atome'
|
|
10
|
+
puts "######"
|
|
11
|
+
if location
|
|
12
|
+
`cd ./#{location}/server;rackup --server puma --port 9292 --env production`
|
|
13
|
+
else
|
|
14
|
+
`cd ./server;rackup --server puma --port 9292 --env production`
|
|
15
|
+
end
|
|
16
|
+
else
|
|
17
|
+
# nothing for now
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
7
22
|
case ARGV[0]
|
|
8
23
|
when 'create'
|
|
9
24
|
project_name = ARGV[1]
|
|
10
25
|
Dir.mkdir project_name.to_s
|
|
11
26
|
current_path = `pwd`.chomp
|
|
12
27
|
gem_assets_location = File.join(File.dirname(__FILE__), '../vendor/assets/')
|
|
13
|
-
|
|
28
|
+
app_builder_helpers = File.join(File.dirname(__FILE__), '../app_builder_helpers')
|
|
14
29
|
target_template_location = "#{current_path}/#{project_name}"
|
|
15
30
|
Dir.entries(gem_assets_location).select do |entry|
|
|
16
31
|
if File.join(entry) && !%w[. ..].include?(entry)
|
|
@@ -19,26 +34,22 @@ when 'create'
|
|
|
19
34
|
end
|
|
20
35
|
end
|
|
21
36
|
# now run the rake task to build the needed libraries (atome, renderers, etc...)
|
|
22
|
-
`cd #{
|
|
23
|
-
|
|
24
|
-
# `cd #{project_name};bundle install`
|
|
25
|
-
# `cd #{project_name};bundle exec guard`
|
|
37
|
+
`cd #{app_builder_helpers};rake system_builder #{current_path}/#{project_name}`
|
|
38
|
+
run(:server, project_name)
|
|
26
39
|
when 'run'
|
|
27
|
-
case ARGV[
|
|
28
|
-
when
|
|
29
|
-
when
|
|
30
|
-
when
|
|
31
|
-
when
|
|
32
|
-
when
|
|
33
|
-
when
|
|
34
|
-
when
|
|
35
|
-
|
|
40
|
+
case ARGV[1]
|
|
41
|
+
when 'android'
|
|
42
|
+
when 'browser'
|
|
43
|
+
when 'freebsd'
|
|
44
|
+
when 'ios'
|
|
45
|
+
when 'linux'
|
|
46
|
+
when 'osx'
|
|
47
|
+
when 'server'
|
|
48
|
+
run(:server)
|
|
49
|
+
when 'windows'
|
|
36
50
|
else
|
|
37
51
|
# type code here
|
|
38
52
|
end
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# puts "first parameter is : #{ARGV[1]}"
|
|
42
|
-
# puts "second parameter is : #{ARGV[2]}"
|
|
43
|
-
# puts 'run command'
|
|
53
|
+
else
|
|
54
|
+
# type code here
|
|
44
55
|
end
|
|
@@ -1,44 +1,2 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# this class hold all created atomes
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Universe
|
|
7
|
-
def self.initialize
|
|
8
|
-
Atome.new({ type: :user })
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def self.atomes_add(new_atome)
|
|
12
|
-
@atomes << new_atome
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
class << self
|
|
16
|
-
attr_reader :atomes
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def self.connected
|
|
20
|
-
true
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# this class build atomes
|
|
25
|
-
class Atome
|
|
26
|
-
include AtomeDummyMethods
|
|
27
|
-
|
|
28
|
-
def initialize(params = {})
|
|
29
|
-
puts "the object id is : #{object_id} , #{params}"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def properties_common(value, current_property, stack_property, optional_processor)
|
|
33
|
-
puts "#{value}, #{current_property}, #{stack_property}, #{optional_processor}"
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
# Universe.initialize
|
|
37
|
-
Universe.connected
|
|
38
|
-
|
|
39
|
-
puts Universe.atomes
|
|
40
|
-
|
|
41
|
-
Atome.new({ top: 22 })
|
|
42
|
-
Atome.new({ top: 22 })
|
|
43
|
-
a = Atome.new({ top: 22 })
|
|
44
|
-
a.left(33)
|
|
2
|
+
# here is the atome kernel
|
|
@@ -1,112 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# def dummy(value = nil, stack_property = nil)
|
|
5
|
-
# property = :dummy
|
|
6
|
-
# optional_processor = { pre_process: true, post_process: true, store_atome: false, render_atome: false }
|
|
7
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
8
|
-
# end
|
|
9
|
-
def universe(value = nil, stack_property = nil)
|
|
10
|
-
property = :universe
|
|
11
|
-
optional_processor = {}
|
|
12
|
-
properties_common(property, value, stack_property, optional_processor)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def parent(value = nil, stack_property = nil)
|
|
16
|
-
property = :parent
|
|
17
|
-
optional_processor = { pre_process: true, post_process: true }
|
|
18
|
-
properties_common(property, value, stack_property, optional_processor)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def left(value = nil, stack_property = nil)
|
|
22
|
-
property = :left
|
|
23
|
-
optional_processor = {}
|
|
24
|
-
properties_common(property, value, stack_property, optional_processor)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def top(value = nil, stack_property = nil)
|
|
28
|
-
property = :top
|
|
29
|
-
optional_processor = {}
|
|
30
|
-
properties_common(property, value, stack_property, optional_processor)
|
|
31
|
-
end
|
|
32
|
-
#
|
|
33
|
-
# def bottom(value = nil, stack_property = nil)
|
|
34
|
-
# property = :bottom
|
|
35
|
-
# optional_processor = {}
|
|
36
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
37
|
-
# end
|
|
38
|
-
#
|
|
39
|
-
def right(value = nil, stack_property = nil)
|
|
40
|
-
property = :right
|
|
41
|
-
optional_processor = {}
|
|
42
|
-
properties_common(property, value, stack_property, optional_processor)
|
|
43
|
-
end
|
|
44
|
-
#
|
|
45
|
-
# def child(value = nil, stack_property = nil)
|
|
46
|
-
# property = :child
|
|
47
|
-
# optional_processor = {}
|
|
48
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
49
|
-
# end
|
|
50
|
-
#
|
|
51
|
-
# def id(value = nil, stack_property = nil)
|
|
52
|
-
# property = :id
|
|
53
|
-
# optional_processor = {}
|
|
54
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
55
|
-
# end
|
|
56
|
-
#
|
|
57
|
-
# def name(value = nil, stack_property = nil)
|
|
58
|
-
# property = :name
|
|
59
|
-
# optional_processor = {}
|
|
60
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
61
|
-
# end
|
|
62
|
-
#
|
|
63
|
-
# def view(value = nil, stack_property = nil)
|
|
64
|
-
# property = :view
|
|
65
|
-
# optional_processor = {}
|
|
66
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
67
|
-
# end
|
|
68
|
-
#
|
|
69
|
-
# def type(value = nil, stack_property = nil)
|
|
70
|
-
# property = :type
|
|
71
|
-
# optional_processor = {}
|
|
72
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
73
|
-
# end
|
|
74
|
-
#
|
|
75
|
-
# def preset(value = nil, stack_property = nil)
|
|
76
|
-
# property = :preset
|
|
77
|
-
# optional_processor = {}
|
|
78
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
79
|
-
# end
|
|
80
|
-
#
|
|
81
|
-
|
|
82
|
-
#
|
|
83
|
-
# def red(value = nil, stack_property = nil)
|
|
84
|
-
# property = :red
|
|
85
|
-
# optional_processor = {}
|
|
86
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
87
|
-
# end
|
|
88
|
-
#
|
|
89
|
-
# def green(value = nil, stack_property = nil)
|
|
90
|
-
# property = :green
|
|
91
|
-
# optional_processor = {}
|
|
92
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
93
|
-
# end
|
|
94
|
-
#
|
|
95
|
-
# def blue(value = nil, stack_property = nil)
|
|
96
|
-
# property = :blue
|
|
97
|
-
# optional_processor = {}
|
|
98
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
99
|
-
# end
|
|
100
|
-
#
|
|
101
|
-
# def alpha(value = nil, stack_property = nil)
|
|
102
|
-
# property = :alpha
|
|
103
|
-
# optional_processor = {}
|
|
104
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
105
|
-
# end
|
|
106
|
-
#
|
|
107
|
-
# def radiation(value = nil, stack_property = nil)
|
|
108
|
-
# property = :radiation
|
|
109
|
-
# optional_processor = {}
|
|
110
|
-
# properties_common(property, value, stack_property, optional_processor)
|
|
111
|
-
# end
|
|
112
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# here are the geometry properties of atome
|
data/lib/atome/version.rb
CHANGED
data/lib/atome.rb
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'fileutils'
|
|
4
|
-
require 'atome/version
|
|
5
|
-
require 'atome/kernel/properties/geometry
|
|
6
|
-
require 'atome/kernel/atome_genesis
|
|
7
|
-
puts "look why this file code is executed\n"*9
|
|
8
|
-
# current_path_location = `pwd`.chomp
|
|
9
|
-
# temp_location = '/tmp/com.atome.one'
|
|
10
|
-
# user_script_location=File.join(File.dirname(__FILE__), '../tmp/')
|
|
11
|
-
# Dir.exist?( user_script_location )
|
|
12
|
-
#
|
|
13
|
-
# FileUtils.mkdir_p temp_location
|
|
14
|
-
#
|
|
15
|
-
# guard_content = <<~STR
|
|
16
|
-
# guard 'rake', :task => 'build' do
|
|
17
|
-
# watch(%r{^#{current_path_location}})
|
|
18
|
-
# end
|
|
19
|
-
# STR
|
|
20
|
-
#
|
|
21
|
-
# rakefile_content = <<~STR
|
|
22
|
-
# task :build do
|
|
23
|
-
#
|
|
24
|
-
# end
|
|
25
|
-
# STR
|
|
26
|
-
# File.open("#{temp_location}/Guardfile", 'w') { |f| f.write(guard_content) }
|
|
27
|
-
# File.open("#{temp_location}/Rakefile", 'w') { |f| f.write(rakefile_content) }
|
|
28
|
-
# user_code = File.read("#{temp_location}/Guardfile")
|
|
29
|
-
|
|
4
|
+
require 'atome/version'
|
|
5
|
+
require 'atome/kernel/properties/geometry'
|
|
6
|
+
require 'atome/kernel/atome_genesis'
|
data/vendor/assets/index.rb
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
# require "opal-jquery"
|
|
2
|
-
|
|
3
|
-
# class Element
|
|
4
|
-
# def self.create(tag = 'div', opt = {})
|
|
5
|
-
# `jQuery('<'+tag+'/>',opt.$to_n())`
|
|
6
|
-
# end
|
|
7
|
-
# end
|
|
8
|
-
#
|
|
9
|
-
# def box(params = {})
|
|
10
|
-
# # el = Element.new(:div)
|
|
11
|
-
# el = Element.create(:div, { id: 'some_big_id',
|
|
12
|
-
# class: 'some-class some-other-class',
|
|
13
|
-
# title: 'now this div has a title!' })
|
|
14
|
-
# # el.text("kjh")
|
|
15
|
-
# Element.find('#user_view').append(el)
|
|
16
|
-
# el.css(:color, :red).css( "box-shadow": "0px 0px 9px red")
|
|
17
|
-
# .css(:width, 33).css(:height, 33).css(:position, "absolute").css(:left, "33px").css(:top, "33px")
|
|
18
|
-
# .css( 'border-radius', '3px 6px 3px 6px')
|
|
19
|
-
#
|
|
20
|
-
# el.on(:click) do
|
|
21
|
-
# el.css("background-color", "yellowgreen")
|
|
22
|
-
# el.text(el.css("background-color"))
|
|
23
|
-
# end
|
|
24
|
-
# end
|
|
25
|
-
# alert :kool
|
|
26
|
-
# box({ width: 33, height: 33, smooth: 6, shadow: { blur: 6, x: 6, y: 6, invert: false, thickness: 0, bounding: true, color: :black } })
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
1
|
def toto(e)
|
|
31
2
|
e.prevent
|
|
32
3
|
e.on.inner_text = "Super Clicked!"
|
|
@@ -41,11 +12,11 @@ end
|
|
|
41
12
|
|
|
42
13
|
verif = <<-STR
|
|
43
14
|
$document.ready do
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
15
|
+
DOM {
|
|
16
|
+
div.info {
|
|
17
|
+
span.red "Opal eval cooked up!"
|
|
18
|
+
}
|
|
19
|
+
}.append_to($document.body)
|
|
49
20
|
end
|
|
50
21
|
STR
|
|
51
22
|
|
|
@@ -20,7 +20,7 @@ require "securerandom"
|
|
|
20
20
|
require "mail"
|
|
21
21
|
require "digest"
|
|
22
22
|
require "filewatcher"
|
|
23
|
-
|
|
23
|
+
require "artoo"
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class String
|
|
@@ -51,14 +51,13 @@ class App < Roda
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
index_content = File.read("../
|
|
54
|
+
index_content = File.read("../build/index.html")
|
|
55
55
|
|
|
56
56
|
# index_content = index_content.gsub('<script type="text/javascript" src="../cordova.js"></script>', "")
|
|
57
57
|
# below an attempt to load atome in pure ruby not opal
|
|
58
|
-
require
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
plugin :static, %w[/css /js /medias], root: '../view'
|
|
58
|
+
require 'atome'
|
|
59
|
+
opts[:root] = '../build'
|
|
60
|
+
plugin :static, %w[/css /js /medias], root: '../build'
|
|
62
61
|
# plugin "faye/websocket"
|
|
63
62
|
route do |r|
|
|
64
63
|
if Faye::WebSocket.websocket?(env)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: atome
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.00005
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean-Eric Godard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-04-
|
|
11
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: artoo
|
|
@@ -289,6 +289,7 @@ files:
|
|
|
289
289
|
- LICENSE.txt
|
|
290
290
|
- README.md
|
|
291
291
|
- Rakefile
|
|
292
|
+
- app_builder_helpers/Rakefile
|
|
292
293
|
- exe/atome
|
|
293
294
|
- lib/atome.rb
|
|
294
295
|
- lib/atome/kernel/atome_genesis.rb
|
|
@@ -300,8 +301,6 @@ files:
|
|
|
300
301
|
- lib/atome/renderers/opal/properties/generator.rb
|
|
301
302
|
- lib/atome/renderers/server/server.rb
|
|
302
303
|
- lib/atome/version.rb
|
|
303
|
-
- run_helpers/Rakefile
|
|
304
|
-
- run_helpers/start_server.ru
|
|
305
304
|
- sig/atome.rbs
|
|
306
305
|
- vendor/assets/build/css/style.css
|
|
307
306
|
- vendor/assets/build/index.html
|
|
@@ -314,6 +313,7 @@ files:
|
|
|
314
313
|
- vendor/assets/build/js/third_parties/popmotion.min.js
|
|
315
314
|
- vendor/assets/index.rb
|
|
316
315
|
- vendor/assets/server/atome_server.rb
|
|
316
|
+
- vendor/assets/server/config.ru
|
|
317
317
|
homepage: https://atome.one
|
|
318
318
|
licenses:
|
|
319
319
|
- MIT
|
data/run_helpers/Rakefile
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
require 'opal'
|
|
2
|
-
require 'opal-jquery'
|
|
3
|
-
require 'opal-browser'
|
|
4
|
-
require 'parser'
|
|
5
|
-
require 'uglifier'
|
|
6
|
-
|
|
7
|
-
Opal.append_path "app"
|
|
8
|
-
|
|
9
|
-
def build_opal_browser(user_project_path)
|
|
10
|
-
puts "###### browser path : #{`pwd`} ######"
|
|
11
|
-
opal_browser = "#{user_project_path}/build/js/opal/opal_browser.js"
|
|
12
|
-
File.binwrite opal_browser, Opal::Builder.build("../lib/atome/renderers/opal/opal_browser.rb").to_s
|
|
13
|
-
uglified = Uglifier.new.compile(File.read(opal_browser))
|
|
14
|
-
File.open(opal_browser, "w") do |f|
|
|
15
|
-
f.puts uglified
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def build_atome_kernel(user_project_path,gem_location)
|
|
20
|
-
atome_kernel = "#{user_project_path}/build/js/atome/kernel.js"
|
|
21
|
-
builder = Opal::Builder.new
|
|
22
|
-
builder.append_paths("#{gem_location}/../lib/")
|
|
23
|
-
File.binwrite atome_kernel, builder.build("#{gem_location}/../lib/atome.rb").to_s
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def build_opal_parser(user_project_path)
|
|
27
|
-
opal_parser = "#{user_project_path}/build/js/opal/opal_parser.js"
|
|
28
|
-
File.binwrite opal_parser, Opal::Builder.build("../lib/atome/renderers/opal/opal_parser.rb").to_s
|
|
29
|
-
uglified = Uglifier.new.compile(File.read(opal_parser))
|
|
30
|
-
File.open(opal_parser, "w") do |f|
|
|
31
|
-
f.puts uglified
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def build_user_code(user_project_path)
|
|
36
|
-
application = "#{user_project_path}/build/js/application.js"
|
|
37
|
-
File.binwrite application, Opal::Builder.build("../vendor/assets/index.rb").to_s
|
|
38
|
-
uglified = Uglifier.new.compile(File.read(application))
|
|
39
|
-
File.open(application, "w") do |f|
|
|
40
|
-
f.puts uglified
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
task :system_builder do
|
|
45
|
-
user_project_path=ARGV[1]
|
|
46
|
-
gem_location = File.join(File.dirname(__FILE__))
|
|
47
|
-
build_atome_kernel(user_project_path,gem_location)
|
|
48
|
-
build_opal_browser(user_project_path)
|
|
49
|
-
build_opal_parser(user_project_path)
|
|
50
|
-
build_user_code(user_project_path)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
task :build do
|
|
54
|
-
# code_to_debug = File.read("./app/app.rb")
|
|
55
|
-
|
|
56
|
-
# ############# start of the patch
|
|
57
|
-
# class Element
|
|
58
|
-
# def self.create(tag = 'div', opt = {})
|
|
59
|
-
# `jQuery('<'+tag+'/>',opt.$to_n())`
|
|
60
|
-
# end
|
|
61
|
-
#
|
|
62
|
-
# def self.find(val)
|
|
63
|
-
# puts val
|
|
64
|
-
# end
|
|
65
|
-
# end
|
|
66
|
-
#
|
|
67
|
-
# def box(params = {})
|
|
68
|
-
# # el = Element.new(:div)
|
|
69
|
-
# el = Element.create(:div, { id: 'some_big_id',
|
|
70
|
-
# class: 'some-class some-other-class',
|
|
71
|
-
# title: 'now this div has a title!' })
|
|
72
|
-
# # el.text("kjh")
|
|
73
|
-
# Element.find('#user_view').append(el)
|
|
74
|
-
# el.css(:color, :red).css("box-shadow": "0px 0px 9px red")
|
|
75
|
-
# .css(:width, 33).css(:height, 33).css(:position, "absolute").css(:left, "33px").css(:top, "33px")
|
|
76
|
-
# .css('border-radius', '3px 6px 3px 6px')
|
|
77
|
-
#
|
|
78
|
-
# el.on(:click) do
|
|
79
|
-
# el.css("background-color", "yellowgreen")
|
|
80
|
-
# el.text(el.css("background-color"))
|
|
81
|
-
# end
|
|
82
|
-
# end
|
|
83
|
-
#
|
|
84
|
-
# ############# end of the patch
|
|
85
|
-
# `ruby ./app/index.rb`
|
|
86
|
-
# eval code_to_debug
|
|
87
|
-
# build the python
|
|
88
|
-
# html_file = File.read(html_page)
|
|
89
|
-
# python_code = File.read(python_file)
|
|
90
|
-
# html_file = html_file.gsub("#**python**#", python_code)
|
|
91
|
-
# File.open("../view/index.html", "w") do |f|
|
|
92
|
-
# f.puts html_file
|
|
93
|
-
# end
|
|
94
|
-
# now the ruby
|
|
95
|
-
# File.binwrite application, Opal::Builder.build("./atome/lib/atome.rb").to_s
|
|
96
|
-
# File.binwrite html_render_lib, Opal::Builder.build("./atome/lib/html_render_lib.rb").to_s
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
# uncomment below for production
|
|
101
|
-
# uglified = Uglifier.new().compile(File.read(application))
|
|
102
|
-
# File.open(application, "w") do |f|
|
|
103
|
-
# f.puts uglified
|
|
104
|
-
# end
|
|
105
|
-
# # now we open the page
|
|
106
|
-
# system("open", index)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
task :default => :build
|
|
110
|
-
|
|
111
|
-
opal_jquery = "./view/js/opal_jquery.js"
|
|
112
|
-
opal_browser = "./view/js/opal_browser.js"
|
|
113
|
-
opal_parser = "./view/js/opal_parser.js"
|
|
114
|
-
|
|
115
|
-
task :server do
|
|
116
|
-
Dir.chdir("app") do
|
|
117
|
-
require "rack"
|
|
118
|
-
# Thread.new do
|
|
119
|
-
# sleep 2
|
|
120
|
-
# system("open", "http://127.0.0.1:9292")
|
|
121
|
-
# end
|
|
122
|
-
sh "rackup"
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
task :jquery do
|
|
127
|
-
File.binwrite opal_jquery, Opal::Builder.build("./opal/opal_jquery_libs.rb").to_s
|
|
128
|
-
uglified = Uglifier.new.compile(File.read(opal_jquery))
|
|
129
|
-
File.open(opal_jquery, "w") do |f|
|
|
130
|
-
f.puts uglified
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
task :browser do
|
|
135
|
-
File.binwrite opal_browser, Opal::Builder.build("./opal/opal_browser_libs.rb").to_s
|
|
136
|
-
uglified = Uglifier.new.compile(File.read(opal_browser))
|
|
137
|
-
File.open(opal_browser, "w") do |f|
|
|
138
|
-
f.puts uglified
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
task :parser do
|
|
143
|
-
File.binwrite opal_parser, Opal::Builder.build("./opal/opal_parser_libs.rb").to_s
|
|
144
|
-
uglified = Uglifier.new.compile(File.read(opal_parser))
|
|
145
|
-
File.open(opal_parser, "w") do |f|
|
|
146
|
-
f.puts uglified
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
end
|
|
150
|
-
|