atome 0.5.6.3.6 → 0.5.6.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20722d91d136a2fd78db940d9e88b1f03acc424d1c24f2c1ee1d320155850c54
4
- data.tar.gz: 556db76963cf17c7efc5c0cc5fc04be69968b551dd5e1046c10980b273745dab
3
+ metadata.gz: 50aa2e035c24b8f040b78e9c89d21f24a6b01c85964648144ca824ff233660b7
4
+ data.tar.gz: 39f4bb9912f2ab249b9b9ab243a11e56ba8849e8a6c5d58a0cc5a8030b4c9ac4
5
5
  SHA512:
6
- metadata.gz: 15415de0349a7164ce7df84aff2b3d6f54662273f711800344b6ba20299782f0bc113c1af7b8a71dcc5a44b018089118368d1bc34ab674619dc9fe217215ff1a
7
- data.tar.gz: ec830d22185342e871e2989726356cd69b8a44d50550c3970ab6eaf8cabca64ccd0bf807a52291b8ddc79c7420199ad095a2b69c80926cfd3d99a70c63cde19f
6
+ metadata.gz: f3ed175fb148279bf81a429537d72fe34ed764a70faef89752a023287ea4ff8326fa91043fa435e52b6a5df748e608d74e0e7f61c729124b5166555b5b73f623
7
+ data.tar.gz: 6c63feaf029082134e92ea2477fed7bd53ae6bcc22d310a112199bcb4f18fd0cfa9c3bf1a2a5686479b6b9d2e2fbcc30cac53b400786e640d404ad60ff0fdcf9
Binary file
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
@@ -1,5 +1,20 @@
1
1
  # frozen_string_literal: true
2
- new({ atome: :color, type: :hash })
2
+ new({ atome: :color, type: :hash }) do |params|
3
+ # # TODO : hack must call it properly thru renderer
4
+ # if params[:affect]
5
+ # params[:affect].each do |affected|
6
+ # grab(affected).html.reset_background
7
+ # end
8
+ # end
9
+
10
+ end
11
+
12
+ # new ({post: :color}) do |params|
13
+ # # # TODO : hack must call it properly thru renderer
14
+ # # params[:affect].each do |affected|
15
+ # # grab(affected).html.reset_background
16
+ # # end
17
+ # end
3
18
  new({ sanitizer: :color }) do |params|
4
19
  params = create_color_hash(params) unless params.instance_of? Hash
5
20
  # the condition below is to prevent the creation of multiple unwanted colors with same property and no ID specified
@@ -150,8 +150,9 @@ class Genesis
150
150
  collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
151
151
  end
152
152
  end
153
- group({ collect: collected_atomes })
154
-
153
+ # TODO/ FIXME : potential problem with group here"
154
+ # group({ collect: collected_atomes })
155
+ collected_atomes
155
156
  end
156
157
  end
157
158
 
@@ -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&.apply([id], &user_proc)
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,7 +2,7 @@
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: :int })
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
 
@@ -12,6 +12,7 @@ new({ sanitizer: :id }) do |params|
12
12
  # we reassign the old id
13
13
  puts "the id : #{params} is already used"
14
14
  params = @id
15
+ # return false
15
16
  else
16
17
  if @id.to_sym != params
17
18
  Universe.update_atome_id(params, self, @id)
@@ -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: #{Universe.app_identity}"
107
- puts "application identity: #{Atome::aui}"
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 th
129
- @app_identity = 369
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
@@ -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] || identity_generator(atome_preset)
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
data/lib/atome/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.3.6'
5
+ VERSION = '0.5.6.3.9'
6
6
  end
7
7
 
@@ -38,7 +38,7 @@ module Molecule
38
38
  end
39
39
 
40
40
  # tests
41
- new({application: :compose, header: true, footer: true })
41
+ # new({application: :compose, header: true, footer: true })
42
42
  #
43
43
  # new(page: {name: :home, application: :compose, attach: :root })
44
44
  #
@@ -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
@@ -45,6 +45,7 @@ end
45
45
 
46
46
  new({ method: :remove, renderer: :html, type: :hash }) do |params|
47
47
  html.table_remove(params)
48
+ html.remove(params)
48
49
  end
49
50
 
50
51
  new({ method: :sort, renderer: :html, type: :hash }) do |params|
@@ -1,6 +1,22 @@
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
- c.border({ thickness: 5, color: color(:blue), pattern: :dotted })
6
+ b=box({left: 333})
7
+ c2=circle({top: 190, width: 99, height: 99})
8
+ c2.border({ thickness: 5, color: color(:blue), pattern: :dotted })
9
+ c.border({ thickness: 5, color: col, pattern: :dotted })
10
+ b.border({ thickness: 5, color: col, pattern: :dotted })
11
+
12
+
13
+ # # frozen_string_literal: true
14
+ #
15
+ # col=color({red: 1, blue: 1, id: :the_col})
16
+ #
17
+ #
18
+ # c=circle
19
+ # b=box({left: 333})
20
+ # # b.attached([col.id])
21
+ # c.border({ thickness: 5, pattern: :dotted })
22
+ # 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
@@ -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: :toto, red: 1 , alpha: 0.5})
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
- # frozen_string_literal: true
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
- particle = data['particle'].to_sym
111
- data = data['data']
110
+ particles = data['particles']
111
+
112
112
  if db_access.table_exists?(table)
113
113
  schema = db_access.schema(table)
114
- if schema.any? { |col_def| col_def.first == particle }
115
- identity_table = db_access[table.to_sym]
116
- identity_table.insert(particle => data)
117
- { data: { message: "column : #{particle}, in table : #{table}, updated with : #{data}" }, message_id: message_id }
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: "column not found: #{particle.class}" }, message_id: message_id }
130
+ { data: { message: "No valid columns provided" }, message_id: message_id }
120
131
  end
121
132
  else
122
- { data: { message: "table not found: #{table.class}" }, message_id: message_id }
123
-
133
+ { data: { message: "table not found: #{table}" }, message_id: message_id }
124
134
  end
125
135
  end
126
136
 
@@ -123,6 +123,6 @@ const communication = {
123
123
 
124
124
 
125
125
  function controller_message(msg) {
126
- let json_msg = JSON.parse(msg);
127
- console.log(json_msg);
126
+ // let json_msgs = JSON.parse(msg);
127
+ rubyVMCallback("A.receptor("+msg+")")
128
128
  }
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.3.6
4
+ version: 0.5.6.3.9
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-27 00:00:00.000000000 Z
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,8 @@ files:
374
374
  - LICENSE.txt
375
375
  - README.md
376
376
  - Rakefile
377
+ - atome-0.5.6.2.7.gem
378
+ - atome.gemspec
377
379
  - documentation/atome.md
378
380
  - documentation/basic.md
379
381
  - documentation/database.JPG