atome 0.5.6.3.6 → 0.5.6.4.0
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/atome.gemspec +99 -0
- data/lib/atome/atome.rb +42 -30
- data/lib/atome/genesis/{atome.rb → atomes.rb} +14 -0
- data/lib/atome/genesis/genesis.rb +25 -6
- data/lib/atome/genesis/particles/hierarchy.rb +12 -1
- data/lib/atome/genesis/particles/identity.rb +9 -8
- data/lib/atome/genesis/particles/utility.rb +1 -0
- data/lib/atome/genesis/sparkle.rb +2 -2
- data/lib/atome/kernel/universe.rb +8 -3
- data/lib/atome/presets/atome.rb +9 -2
- data/lib/atome/version.rb +1 -2
- data/lib/atome.rb +1 -1
- data/lib/atome_relative.rb +1 -1
- data/lib/molecules/init.rb +1 -1
- data/lib/renderers/html/html.rb +15 -0
- data/lib/renderers/html/property.rb +23 -7
- data/vendor/assets/application/examples/border.rb +33 -2
- data/vendor/assets/application/examples/gradient.rb +6 -2
- data/vendor/assets/application/examples/paint.rb +9 -3
- data/vendor/assets/application/examples/test.rb +2 -1
- data/vendor/assets/server/eDen.rb +19 -9
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 155b40eec80fff72a131cbe7477280a2b199e36f443f55d754eb740277af3925
|
4
|
+
data.tar.gz: 252b75fca3bcef7e79d5e0b0d91b38fa1f13dbac75facc46e69807277c325c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 762b8f9035bc10f086d5686f7986f230d8ea37760d99585370462265c5baac244e1ba9cede31b4b194491f7d92fc6779df267e72e1e965909603599a20bf444a
|
7
|
+
data.tar.gz: aabaf5a1ee343093b1f89b0991296567a01e60ec2170cf2d6f2c52c1b8e7f603b57f131bddd13407b068f687a5f35cdb1e4b98aeda03f5058b49f77ea67515c1
|
data/atome.gemspec
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/atome/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'atome'
|
7
|
+
spec.version = Atome::VERSION
|
8
|
+
spec.authors = ['Jean-Eric Godard']
|
9
|
+
spec.email = ['jeezs@atome.one']
|
10
|
+
|
11
|
+
spec.summary = 'the creative framework'
|
12
|
+
spec.description = 'the creative framework.'
|
13
|
+
spec.homepage = 'https://atome.one'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 3.1'
|
16
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/atomecorp/atome'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/atomecorp/atome/changelog'
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
|
25
|
+
# spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
# `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
# (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
# spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
31
|
+
# # Utilisez git ls-files pour récupérer les fichiers, puis filtrez-les selon vos besoins
|
32
|
+
# git_files = `git ls-files -z`.split("\x0").reject do |f|
|
33
|
+
# (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# # Ajoutez manuellement les fichiers du dossier lib/eVe
|
37
|
+
# eve_files = Dir['lib/eVe/**/*']
|
38
|
+
#
|
39
|
+
# # Combine les deux listes de fichiers
|
40
|
+
# git_files + eve_files
|
41
|
+
# end
|
42
|
+
|
43
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
44
|
+
# Utilisez git ls-files pour récupérer les fichiers, puis filtrez-les selon vos besoins
|
45
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
46
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
spec.bindir = 'exe'
|
51
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
52
|
+
spec.require_paths = ['lib']
|
53
|
+
|
54
|
+
|
55
|
+
spec.add_runtime_dependency 'artoo', '~> 1.8.2'
|
56
|
+
# spec.add_runtime_dependency 'arduino_firmata', '~> 0.3'
|
57
|
+
# spec.add_runtime_dependency 'eVe', '~> 0.1.0'
|
58
|
+
spec.add_runtime_dependency 'eventmachine', '~> 1.2.7'
|
59
|
+
spec.add_runtime_dependency 'faye-websocket', '~> 0.1'
|
60
|
+
spec.add_runtime_dependency 'geocoder', '~> 1.8'
|
61
|
+
spec.add_runtime_dependency 'guard', '~> 2.1'
|
62
|
+
# spec.add_runtime_dependency 'guard-shell', '~> 0.7.2'
|
63
|
+
# spec.add_runtime_dependency 'guard-puma', '~> 0.8.1'
|
64
|
+
# spec.add_runtime_dependency 'shotgun', '~> 0.9.2'
|
65
|
+
spec.add_runtime_dependency 'gems', '~> 1.2'
|
66
|
+
spec.add_runtime_dependency 'guard-rake', '~> 1.0'
|
67
|
+
# spec.add_runtime_dependency 'rerun', '~> 0.14.0'
|
68
|
+
spec.add_runtime_dependency 'image_size', '~> 3.0'
|
69
|
+
spec.add_runtime_dependency 'mail', '~> 2.1'
|
70
|
+
spec.add_runtime_dependency 'net-ping', '~> 2.0'
|
71
|
+
spec.add_runtime_dependency "opal", "~> 1.8"
|
72
|
+
spec.add_runtime_dependency 'parser', '~> 3.1'
|
73
|
+
spec.add_runtime_dependency 'puma', '~> 6.0'
|
74
|
+
spec.add_runtime_dependency 'rack', '~> 2.2'
|
75
|
+
spec.add_runtime_dependency 'rack-unreloader', '~> 1.8'
|
76
|
+
spec.add_runtime_dependency 'rake', '~> 13.0'
|
77
|
+
spec.add_runtime_dependency 'roda', '~> 3.5'
|
78
|
+
spec.add_runtime_dependency 'ruby2js', '~> 5.0'
|
79
|
+
spec.add_runtime_dependency 'rufus-scheduler', '~> 3.8'
|
80
|
+
spec.add_runtime_dependency 'securerandom', '~> 0.2'
|
81
|
+
spec.add_runtime_dependency 'sequel', '~> 5.5'
|
82
|
+
spec.add_runtime_dependency 'sqlite3', '~> 1.4'
|
83
|
+
spec.add_runtime_dependency 'uglifier', '~> 0.1'
|
84
|
+
# spec.add_runtime_dependency 'atome_eVe', '>= 0.1.0.0.7'
|
85
|
+
# spec.add_runtime_dependency 'webrick', '~> 1.7.0'
|
86
|
+
# the gem below are need to make the atome server works on Windows
|
87
|
+
spec.add_runtime_dependency 'tzinfo-data', '~> 1.2023.4'
|
88
|
+
spec.add_runtime_dependency 'win32-security', '~> 0.5.0'
|
89
|
+
spec.add_runtime_dependency 'wdm', '>= 0.1.0' if Gem.win_platform?
|
90
|
+
|
91
|
+
# patch because guard have bad dependency
|
92
|
+
# spec.add_runtime_dependency 'pry', '>= 0.14.2'
|
93
|
+
|
94
|
+
# Uncomment to register a new dependency of your gem
|
95
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
96
|
+
|
97
|
+
# For more information and examples about making a new gem, check out our
|
98
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
99
|
+
end
|
data/lib/atome/atome.rb
CHANGED
@@ -7,40 +7,52 @@ class Atome
|
|
7
7
|
def aid(_v=nil)
|
8
8
|
@aid
|
9
9
|
end
|
10
|
+
|
10
11
|
def initialize(new_atome = {}, &atomes_proc)
|
11
12
|
# TODO: atome format should always be as followed : {value: 0.44, unit: :px, opt1: 554}
|
12
13
|
# when using optimised version of atome you must type eg : a.set({left: {value: 33, unit: '%', reference: :center}})
|
14
|
+
# if Universe.atomes[new_atome[:id]]
|
15
|
+
# # puts "------ 2 #{new_atome[:id]} => #{Universe.atomes[new_atome[:id]]}"
|
16
|
+
# # puts 'atome_id already exist'
|
17
|
+
# # old_atome= grab(new_atome[:id])
|
18
|
+
# # new_atome.each do |element, value|
|
19
|
+
# # old_atome.send(element, value)
|
20
|
+
# # end
|
21
|
+
# # return false
|
22
|
+
# alert "atome found : #{ grab(new_atome[:id])}"
|
23
|
+
# grab(new_atome[:id])
|
24
|
+
# else
|
25
|
+
# the keys :renderers, :type and :id should be placed in the first position in the hash
|
26
|
+
@history = {}
|
27
|
+
# @language = :english
|
28
|
+
# @callback = {}
|
29
|
+
@tag = {}
|
30
|
+
@selected = false
|
31
|
+
#@metrics = {}
|
32
|
+
@unit = {}
|
33
|
+
@collect = {}
|
34
|
+
@collect = {}
|
35
|
+
@int8= {}
|
36
|
+
@css = {}
|
37
|
+
@aid = identity_generator(:a)
|
38
|
+
Universe.add_to_atomes( @aid, self)
|
39
|
+
@id = new_atome[:id] || @aid
|
40
|
+
Universe.id_to_aid(@id,@aid)
|
41
|
+
@type = new_atome[:type] || :element
|
42
|
+
@attached = []
|
43
|
+
@category = []
|
44
|
+
# @display = { mode: :default }
|
45
|
+
# @backup={} # mainly used to restore particle when using grid /table /list display mode
|
46
|
+
@html = HTML.new(@id, self)
|
47
|
+
@headless = Headless.new(@id, self)
|
48
|
+
# now we store the proc in a an atome's property called :bloc
|
49
|
+
new_atome[:code] = atomes_proc if atomes_proc
|
50
|
+
# we reorder the hash
|
51
|
+
reordered_atome =reorder_particles(new_atome)
|
52
|
+
# FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
|
53
|
+
collapse(reordered_atome)
|
54
|
+
# end
|
13
55
|
|
14
|
-
# the keys :renderers, :type and :id should be placed in the first position in the hash
|
15
|
-
@history = {}
|
16
|
-
# @language = :english
|
17
|
-
# @callback = {}
|
18
|
-
@tag = {}
|
19
|
-
@selected = false
|
20
|
-
#@metrics = {}
|
21
|
-
@unit = {}
|
22
|
-
@collect = {}
|
23
|
-
@collect = {}
|
24
|
-
@int8= {}
|
25
|
-
@css = {}
|
26
|
-
@aid = identity_generator(:a)
|
27
|
-
Universe.add_to_atomes( @aid, self)
|
28
|
-
@id = new_atome[:id] || @aid
|
29
|
-
Universe.id_to_aid(@id,@aid)
|
30
|
-
@type = new_atome[:type] || :element
|
31
|
-
@attached = []
|
32
|
-
@category = []
|
33
|
-
# @display = { mode: :default }
|
34
|
-
# @backup={} # mainly used to restore particle when using grid /table /list display mode
|
35
|
-
@html = HTML.new(@id, self)
|
36
|
-
@headless = Headless.new(@id, self)
|
37
|
-
# now we store the proc in a an atome's property called :bloc
|
38
|
-
new_atome[:code] = atomes_proc if atomes_proc
|
39
|
-
# we reorder the hash
|
40
|
-
reordered_atome =reorder_particles(new_atome)
|
41
|
-
|
42
|
-
# FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
|
43
|
-
collapse(reordered_atome)
|
44
56
|
end
|
45
57
|
|
46
58
|
def js
|
@@ -1,5 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
new({ atome: :color, type: :hash })
|
4
|
+
|
5
|
+
# new({ atome: :color, type: :hash })do |params|
|
6
|
+
# puts "1 #{params}______"
|
7
|
+
# params
|
8
|
+
# end
|
9
|
+
|
10
|
+
# new ({post: :color}) do |params|
|
11
|
+
# # # TODO : hack must call it properly thru renderer
|
12
|
+
# # params[:affect].each do |affected|
|
13
|
+
# # grab(affected).html.reset_background
|
14
|
+
# # end
|
15
|
+
# end
|
3
16
|
new({ sanitizer: :color }) do |params|
|
4
17
|
params = create_color_hash(params) unless params.instance_of? Hash
|
5
18
|
# the condition below is to prevent the creation of multiple unwanted colors with same property and no ID specified
|
@@ -22,6 +35,7 @@ new({ sanitizer: :image }) do |params|
|
|
22
35
|
end
|
23
36
|
# TODO : the line below should get the value from default params Essentials
|
24
37
|
params
|
38
|
+
|
25
39
|
end
|
26
40
|
new({ post: :image }) do
|
27
41
|
# we have find the size od the image to set it in the atome
|
@@ -6,7 +6,7 @@ class Genesis
|
|
6
6
|
|
7
7
|
def create_particle(element, store, render)
|
8
8
|
Atome.define_method "set_#{element}" do |params, &user_proc|
|
9
|
-
|
9
|
+
particle_creation(element, params, store, render, &user_proc)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -72,8 +72,17 @@ class Genesis
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def new_particle(element, store, render, &_method_proc)
|
75
|
+
# unless @id
|
76
|
+
# alert self.id
|
77
|
+
# end
|
78
|
+
|
75
79
|
Atome.define_method element do |params = nil, &user_proc|
|
80
|
+
# if @id
|
81
|
+
# alert "======> #{self.class}"
|
76
82
|
@history[element] ||= []
|
83
|
+
# else
|
84
|
+
# alert "======> #{self.inspect}"
|
85
|
+
# end
|
77
86
|
if (params || params == false) && write_auth(element)
|
78
87
|
params = particle_sanitizer(element, params, &user_proc)
|
79
88
|
# the line below execute the main code when creating a new particle
|
@@ -87,7 +96,7 @@ class Genesis
|
|
87
96
|
end
|
88
97
|
end
|
89
98
|
|
90
|
-
computed_params= send("set_#{element}", params, &user_proc) # sent to : create_particle / Atome.define_method "set_#{element}"
|
99
|
+
computed_params = send("set_#{element}", params, &user_proc) # sent to : create_particle / Atome.define_method "set_#{element}"
|
91
100
|
|
92
101
|
# we historicize all write action below
|
93
102
|
# we add the changes to the stack that must be synchronised
|
@@ -108,7 +117,9 @@ class Genesis
|
|
108
117
|
else
|
109
118
|
"send a valid password to read #{element} value"
|
110
119
|
end
|
111
|
-
|
120
|
+
# else
|
121
|
+
#
|
122
|
+
# end
|
112
123
|
end
|
113
124
|
end
|
114
125
|
|
@@ -150,8 +161,9 @@ class Genesis
|
|
150
161
|
collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
|
151
162
|
end
|
152
163
|
end
|
153
|
-
|
154
|
-
|
164
|
+
# TODO/ FIXME : potential problem with group here"
|
165
|
+
# group({ collect: collected_atomes })
|
166
|
+
collected_atomes
|
155
167
|
end
|
156
168
|
end
|
157
169
|
|
@@ -161,7 +173,14 @@ class Genesis
|
|
161
173
|
# Object.const_set(element, Module.new)
|
162
174
|
# we add the newly created atome to the list of "child in it's category, eg if it's a shape we add the new atome
|
163
175
|
# to the shape particles list : @!atome[:shape] << params[:id]
|
164
|
-
Atome.new(params, &user_proc)
|
176
|
+
# Atome.new(params, &user_proc)
|
177
|
+
|
178
|
+
if Universe.atomes[params[:id]]
|
179
|
+
# if atome id already exist we grab the previous one
|
180
|
+
grab(params[:id])
|
181
|
+
else
|
182
|
+
Atome.new(params, &user_proc)
|
183
|
+
end
|
165
184
|
# Now we return the newly created atome instead of the current atome that is the parent cf: b=box; c=b.circle
|
166
185
|
end
|
167
186
|
|
@@ -51,6 +51,8 @@ end
|
|
51
51
|
|
52
52
|
new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
|
53
53
|
# TODO: optimize the 2 lines below:
|
54
|
+
# html.reset_background
|
55
|
+
# alert :ok
|
54
56
|
@apply ||= []
|
55
57
|
parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
|
56
58
|
parents_ids.each do |parent_id|
|
@@ -81,8 +83,17 @@ end
|
|
81
83
|
new({ particle: :affect, category: :hierarchy, type: :string, render: false }) do |children_ids, &user_proc|
|
82
84
|
children_ids = [children_ids] unless children_ids.instance_of? Array
|
83
85
|
children_ids.each do |child_id|
|
86
|
+
# params[:affect].each do |affected|
|
87
|
+
# end
|
88
|
+
|
84
89
|
child_found = grab(child_id)
|
85
|
-
child_found
|
90
|
+
# alert "must exist : #{child_found.id}"
|
91
|
+
# puts "correct condition below #{id}"
|
92
|
+
#FIXME : found why it crash when removing the conditon below
|
93
|
+
unless child_found.id == :black_matter
|
94
|
+
child_found.remove({all: :paint})
|
95
|
+
end
|
96
|
+
child_found&.apply([id], &user_proc)
|
86
97
|
end
|
87
98
|
children_ids
|
88
99
|
end
|
@@ -2,24 +2,25 @@
|
|
2
2
|
|
3
3
|
new({ particle: :real, category: :identity, type: :string })
|
4
4
|
new({ particle: :type, category: :identity, type: :string })
|
5
|
-
new({ particle: :id, category: :identity, type: :
|
5
|
+
new({ particle: :id, category: :identity, type: :string })
|
6
6
|
new({ sanitizer: :id }) do |params|
|
7
7
|
# first we sanitize the the id below
|
8
8
|
|
9
9
|
params = params.to_sym
|
10
|
-
# we check id is already assign
|
11
|
-
if Universe.atomes[params]
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
# # we check id is already assign
|
11
|
+
# if Universe.atomes[params]
|
12
|
+
# # we reassign the old id
|
13
|
+
# puts "the id : #{params} is already used"
|
14
|
+
# params = @id
|
15
|
+
# # return false
|
16
|
+
# else
|
16
17
|
if @id.to_sym != params
|
17
18
|
Universe.update_atome_id(params, self, @id)
|
18
19
|
else
|
19
20
|
Universe.add_to_atomes(params, self)
|
20
21
|
end
|
21
22
|
|
22
|
-
end
|
23
|
+
# end
|
23
24
|
params
|
24
25
|
end
|
25
26
|
new({ particle: :name, category: :identity, type: :string })
|
@@ -60,6 +60,7 @@ new({ particle: :delete, category: :utility, type: :boolean, render: false }) do
|
|
60
60
|
# we check if the params passed is an atome to treat it in a different way
|
61
61
|
puts "write code here : #{apply} , #{attached}"
|
62
62
|
else
|
63
|
+
# alert grab(params).delete(true)
|
63
64
|
send(params, 0) unless params == :id
|
64
65
|
end
|
65
66
|
end
|
@@ -103,8 +103,8 @@ Atome.new({ renderers: [:html], id: :selector, collect: [], type: :group, tag: {
|
|
103
103
|
# atome infos
|
104
104
|
def atome_infos
|
105
105
|
puts "atome version: #{Atome::VERSION}"
|
106
|
-
puts "device identity: #{
|
107
|
-
puts "application identity: #{
|
106
|
+
puts "device identity: #{Atome::aui}"
|
107
|
+
puts "application identity: #{Universe.app_identity}"
|
108
108
|
puts "host framework: #{Atome::host}"
|
109
109
|
puts "engine: #{Universe.engine}"
|
110
110
|
puts "users: #{Universe.users}"
|
@@ -123,10 +123,15 @@ class Universe
|
|
123
123
|
end
|
124
124
|
collected_id
|
125
125
|
end
|
126
|
-
|
126
|
+
def generate_uuid
|
127
|
+
uuid = SecureRandom.uuid.gsub('-','')
|
128
|
+
formatted_time = Time.now.strftime("%Y%m%d%H%M%S")
|
129
|
+
"#{uuid}#{formatted_time}"
|
130
|
+
end
|
127
131
|
def app_identity
|
128
|
-
# each app hav its own identity, this allow to generate new user identities from
|
129
|
-
|
132
|
+
# each app hav its own identity, this allow to generate new user identities from the
|
133
|
+
# unique_id = generate_unique_id_with_timestamp
|
134
|
+
@app_identity = generate_uuid
|
130
135
|
# the identity is define as follow : parentsCreatorID_softwareInstanceID_objetID
|
131
136
|
# in this case parents is eve so 0, Software instance number is main eVe server which is also 0,
|
132
137
|
# and finally the object is 3 as this the third object created by the main server
|
data/lib/atome/presets/atome.rb
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
# additional Atome methods
|
9
9
|
class Atome
|
10
10
|
def atome_common(atome_preset, params)
|
11
|
+
|
11
12
|
basic_params = { renderers: [] }
|
12
13
|
# TODO : remove Essentials.default_params[atome_preset] || {} as it is
|
13
14
|
# applied twice because preset is now a particle
|
@@ -15,12 +16,13 @@ class Atome
|
|
15
16
|
|
16
17
|
basic_params[:type] = preset_params[:type] || :element
|
17
18
|
# basic_params[:aid] = identity_generator(:a)
|
18
|
-
basic_params[:id] = params[:id]
|
19
|
+
basic_params[:id] = params[:id]|| identity_generator(atome_preset)
|
19
20
|
basic_params[:renderers] = @renderers || preset_params[:renderers]
|
20
21
|
essential_params = basic_params.merge(preset_params)
|
22
|
+
#
|
21
23
|
reordered_params = essential_params.reject { |key, _| params.has_key?(key) }
|
22
24
|
params = reordered_params.merge(params)
|
23
|
-
|
25
|
+
params[:id]=params[:id].to_sym
|
24
26
|
# condition to handle color/shadow/paint atomes that shouldn't be attach to view
|
25
27
|
# TODO : add category for atome( material/physical vs modifier : color, shadow, .. vs shape, image ..)
|
26
28
|
# then add condition same things fo code in genesis new_atome
|
@@ -43,7 +45,12 @@ class Atome
|
|
43
45
|
def preset_common(params, &bloc)
|
44
46
|
## if an atome with current id exist we update the ID in the params
|
45
47
|
# params[:id] = "#{params[:id]}_#{Universe.atomes.length}" if grab(params[:id])
|
48
|
+
# if Universe.atomes[params[:id]]
|
49
|
+
# alert "atome found : #{ grab(params[:id])}"
|
50
|
+
# grab(params[:id])
|
51
|
+
# else
|
46
52
|
Atome.new(params, &bloc)
|
53
|
+
# end
|
47
54
|
end
|
48
55
|
|
49
56
|
def box(params = {}, &bloc)
|
data/lib/atome/version.rb
CHANGED
data/lib/atome.rb
CHANGED
@@ -13,7 +13,7 @@ require 'atome/helpers/color_helper/color'
|
|
13
13
|
require 'atome/extensions/atome'
|
14
14
|
require 'atome/extensions/mathematics'
|
15
15
|
require 'atome/atome'
|
16
|
-
require 'atome/genesis/
|
16
|
+
require 'atome/genesis/atomes'
|
17
17
|
require 'atome/presets/atome'
|
18
18
|
require 'atome/genesis/particles/atome'
|
19
19
|
require 'atome/genesis/particles/communication'
|
data/lib/atome_relative.rb
CHANGED
@@ -12,7 +12,7 @@ require_relative './atome/helpers/color_helper/color'
|
|
12
12
|
require_relative './atome/extensions/atome'
|
13
13
|
require_relative './atome/extensions/mathematics'
|
14
14
|
require_relative './atome/atome'
|
15
|
-
require_relative './atome/genesis/
|
15
|
+
require_relative './atome/genesis/atomes'
|
16
16
|
require_relative './atome/presets/atome'
|
17
17
|
require_relative './atome/genesis/particles/atome'
|
18
18
|
require_relative './atome/genesis/particles/communication'
|
data/lib/molecules/init.rb
CHANGED
data/lib/renderers/html/html.rb
CHANGED
@@ -1445,6 +1445,21 @@ class HTML
|
|
1445
1445
|
end
|
1446
1446
|
end
|
1447
1447
|
|
1448
|
+
def reset_background
|
1449
|
+
style(:background, 'black')
|
1450
|
+
end
|
1451
|
+
|
1452
|
+
def remove(params)
|
1453
|
+
#TODO: FIXME: "html : must create a case here #{params} (#{@original_atome.id})"
|
1454
|
+
|
1455
|
+
# puts @original_atome.color[0]
|
1456
|
+
|
1457
|
+
reset_background
|
1458
|
+
# style(:background, '')
|
1459
|
+
# style(:background, 'black')
|
1460
|
+
# @original_atome.color(:red)
|
1461
|
+
# @original_atome.apply(@original_atome.color[0])
|
1462
|
+
end
|
1448
1463
|
# atomisation!
|
1449
1464
|
def atomized(html_object)
|
1450
1465
|
html_object = html_object[0] if html_object.instance_of? Array
|
@@ -25,14 +25,29 @@ end
|
|
25
25
|
new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
|
26
26
|
thickness = value[:thickness] || 5
|
27
27
|
type = value[:pattern] || :solid
|
28
|
-
color = if value[:color]
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# color = if value[:color]
|
29
|
+
# color_found = value[:color]
|
30
|
+
# "#{color_found.red * 255},#{color_found.green * 255},#{color_found.blue * 255},#{color_found.alpha} "
|
31
|
+
# else
|
32
|
+
# "0,0,0,1"
|
33
|
+
# end
|
34
|
+
if value[:color].instance_of? Atome
|
35
|
+
color_found= value[:color]
|
36
|
+
else
|
37
|
+
color_found=grab('black_matter').color(value[:color])
|
38
|
+
end
|
34
39
|
|
35
|
-
|
40
|
+
# alert "atome found 2 : #{color_found}"
|
41
|
+
red = color_found.red* 255
|
42
|
+
green = color_found.green* 255
|
43
|
+
blue = color_found.blue* 255
|
44
|
+
alpha = color_found.alpha
|
45
|
+
# alert "rgba(#{red},#{green},#{blue},#{alpha})"
|
46
|
+
# color_found= "#{1 * 255},#{color_found.green * 255},#{0 * 255},#{0.3} "
|
47
|
+
|
48
|
+
html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
49
|
+
# html.style(:border, "#{type} #{thickness}px rgba(#{color_found})")
|
50
|
+
# html.style(:border, "solid 12px rgba(255, 255, 120, 0,3)")
|
36
51
|
end
|
37
52
|
|
38
53
|
new({ method: :clean, renderer: :html, type: :hash }) do |params|
|
@@ -45,6 +60,7 @@ end
|
|
45
60
|
|
46
61
|
new({ method: :remove, renderer: :html, type: :hash }) do |params|
|
47
62
|
html.table_remove(params)
|
63
|
+
html.remove(params)
|
48
64
|
end
|
49
65
|
|
50
66
|
new({ method: :sort, renderer: :html, type: :hash }) do |params|
|
@@ -1,6 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
|
4
|
-
|
4
|
+
col=color({red: 1, blue: 1, id: :the_col})
|
5
5
|
c=circle
|
6
|
-
|
6
|
+
b=box({left: 333})
|
7
|
+
c2=circle({top: 190, width: 99, height: 99})
|
8
|
+
# let's add the border
|
9
|
+
c2.border({ thickness: 5, color: :blue, pattern: :dotted })
|
10
|
+
c.border({ thickness: 5, color: col, pattern: :dotted })
|
11
|
+
b.border({ thickness: 5, color: col, pattern: :dotted })
|
12
|
+
|
13
|
+
wait 3 do
|
14
|
+
c2.border({ thickness: 5, color: :green, pattern: :dotted })
|
15
|
+
c.border({ thickness: 5, color: :green, pattern: :dotted })
|
16
|
+
b.border({ thickness: 5, color: :green, pattern: :dotted })
|
17
|
+
end
|
18
|
+
|
19
|
+
b.touch(true) do
|
20
|
+
|
21
|
+
b.border({ thickness: 5, color: { red: 1, green: 0 }, pattern: :dotted })
|
22
|
+
|
23
|
+
end
|
24
|
+
# wait 6 do
|
25
|
+
# iamge(:red_planet)
|
26
|
+
# end
|
27
|
+
|
28
|
+
# # frozen_string_literal: true
|
29
|
+
#
|
30
|
+
# col=color({red: 1, blue: 1, id: :the_col})
|
31
|
+
#
|
32
|
+
#
|
33
|
+
# c=circle
|
34
|
+
# b=box({left: 333})
|
35
|
+
# # b.attached([col.id])
|
36
|
+
# c.border({ thickness: 5, pattern: :dotted })
|
37
|
+
# b.border({ thickness: 5, attached: col.id, pattern: :dotted })
|
@@ -17,8 +17,12 @@ wait 0.5 do
|
|
17
17
|
wait 0.5 do
|
18
18
|
painter = circ.paint({ id: :the_painter2, gradient: [col_1.id, col_2.id, col_3.id], direction: :left })
|
19
19
|
wait 0.5 do
|
20
|
-
circ.color(:blue)
|
20
|
+
# circ.color(:blue)
|
21
21
|
circ.paint({ gradient: [col_4.id, col_5.id], diffusion: :conic })
|
22
|
+
wait 1 do
|
23
|
+
circ.color(:blue)
|
24
|
+
# circ.paint({ gradient: [col_5.id, col_5.id], diffusion: :conic })
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -32,4 +36,4 @@ the_text.left(333)
|
|
32
36
|
|
33
37
|
the_text.paint({ gradient: [col_1.id, col_2.id], direction: :left , id: :painted_love })
|
34
38
|
|
35
|
-
|
39
|
+
|
@@ -5,17 +5,23 @@ c=circle({drag: true, id: :the_circle})
|
|
5
5
|
c1=c.color(:white).id
|
6
6
|
c2=c.color(:red).id
|
7
7
|
c3=c.color(:yellow).id
|
8
|
-
color({id: :
|
8
|
+
color({id: :my_col1, red: 1 , alpha: 0.5})
|
9
9
|
wait 0.5 do
|
10
10
|
c.paint({ gradient: [c1,c2], direction: :left })
|
11
11
|
wait 0.5 do
|
12
|
-
c.paint({ gradient: [c1,c2, c3], direction: :left })
|
13
12
|
wait 0.5 do
|
14
13
|
c.paint({ gradient: [c1,c2], diffusion: :radial })
|
15
14
|
wait 0.5 do
|
16
|
-
c.paint({ gradient: [c1,c2, c3], diffusion: :conic })
|
15
|
+
cc= c.paint({ gradient: [c1,c2, c3], diffusion: :conic })
|
17
16
|
wait 0.5 do
|
17
|
+
# cc.delete(true)
|
18
|
+
# alert c.paint
|
18
19
|
c.remove({all: :paint})
|
20
|
+
# alert c.paint
|
21
|
+
wait 0.6 do
|
22
|
+
c.color(:red)
|
23
|
+
end
|
24
|
+
# c.paint({ gradient: [c3, c3], diffusion: :conic })
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
puts 'hello'
|
2
|
+
puts Universe.particle_list
|
@@ -107,20 +107,30 @@ class EDen
|
|
107
107
|
|
108
108
|
def insert(data, message_id)
|
109
109
|
table = data['table'].to_sym
|
110
|
-
|
111
|
-
|
110
|
+
particles = data['particles']
|
111
|
+
|
112
112
|
if db_access.table_exists?(table)
|
113
113
|
schema = db_access.schema(table)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
114
|
+
insert_data = {}
|
115
|
+
|
116
|
+
particles.each do |particle, value|
|
117
|
+
particle_sym = particle.to_sym
|
118
|
+
if schema.any? { |col_def| col_def.first == particle_sym }
|
119
|
+
insert_data[particle_sym] = value
|
120
|
+
else
|
121
|
+
return { data: { message: "column not found: #{particle}" }, message_id: message_id }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
if insert_data.any?
|
126
|
+
identity_table = db_access[table]
|
127
|
+
identity_table.insert(insert_data)
|
128
|
+
{ data: { message: "Data inserted in table: #{table}" }, message_id: message_id }
|
118
129
|
else
|
119
|
-
{ data: { message: "
|
130
|
+
{ data: { message: "No valid columns provided" }, message_id: message_id }
|
120
131
|
end
|
121
132
|
else
|
122
|
-
{ data: { message: "table not found: #{table
|
123
|
-
|
133
|
+
{ data: { message: "table not found: #{table}" }, message_id: message_id }
|
124
134
|
end
|
125
135
|
end
|
126
136
|
|
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.5.6.
|
4
|
+
version: 0.5.6.4.0
|
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: 2024-02-
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: artoo
|
@@ -374,6 +374,7 @@ files:
|
|
374
374
|
- LICENSE.txt
|
375
375
|
- README.md
|
376
376
|
- Rakefile
|
377
|
+
- atome.gemspec
|
377
378
|
- documentation/atome.md
|
378
379
|
- documentation/basic.md
|
379
380
|
- documentation/database.JPG
|
@@ -419,7 +420,7 @@ files:
|
|
419
420
|
- lib/atome/extensions/mathematics.rb
|
420
421
|
- lib/atome/extensions/ping.rb
|
421
422
|
- lib/atome/extensions/sha.rb
|
422
|
-
- lib/atome/genesis/
|
423
|
+
- lib/atome/genesis/atomes.rb
|
423
424
|
- lib/atome/genesis/genesis.rb
|
424
425
|
- lib/atome/genesis/particles/atome.rb
|
425
426
|
- lib/atome/genesis/particles/communication.rb
|