atome 0.5.6.3.9 → 0.5.6.4.0

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: 50aa2e035c24b8f040b78e9c89d21f24a6b01c85964648144ca824ff233660b7
4
- data.tar.gz: 39f4bb9912f2ab249b9b9ab243a11e56ba8849e8a6c5d58a0cc5a8030b4c9ac4
3
+ metadata.gz: 155b40eec80fff72a131cbe7477280a2b199e36f443f55d754eb740277af3925
4
+ data.tar.gz: 252b75fca3bcef7e79d5e0b0d91b38fa1f13dbac75facc46e69807277c325c10
5
5
  SHA512:
6
- metadata.gz: f3ed175fb148279bf81a429537d72fe34ed764a70faef89752a023287ea4ff8326fa91043fa435e52b6a5df748e608d74e0e7f61c729124b5166555b5b73f623
7
- data.tar.gz: 6c63feaf029082134e92ea2477fed7bd53ae6bcc22d310a112199bcb4f18fd0cfa9c3bf1a2a5686479b6b9d2e2fbcc30cac53b400786e640d404ad60ff0fdcf9
6
+ metadata.gz: 762b8f9035bc10f086d5686f7986f230d8ea37760d99585370462265c5baac244e1ba9cede31b4b194491f7d92fc6779df267e72e1e965909603599a20bf444a
7
+ data.tar.gz: aabaf5a1ee343093b1f89b0991296567a01e60ec2170cf2d6f2c52c1b8e7f603b57f131bddd13407b068f687a5f35cdb1e4b98aeda03f5058b49f77ea67515c1
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,13 +1,11 @@
1
1
  # frozen_string_literal: true
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
2
 
10
- end
3
+ new({ atome: :color, type: :hash })
4
+
5
+ # new({ atome: :color, type: :hash })do |params|
6
+ # puts "1 #{params}______"
7
+ # params
8
+ # end
11
9
 
12
10
  # new ({post: :color}) do |params|
13
11
  # # # TODO : hack must call it properly thru renderer
@@ -37,6 +35,7 @@ new({ sanitizer: :image }) do |params|
37
35
  end
38
36
  # TODO : the line below should get the value from default params Essentials
39
37
  params
38
+
40
39
  end
41
40
  new({ post: :image }) do
42
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
- particle_creation(element, params, store, render, &user_proc)
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
 
@@ -162,7 +173,14 @@ class Genesis
162
173
  # Object.const_set(element, Module.new)
163
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
164
175
  # to the shape particles list : @!atome[:shape] << params[:id]
165
- 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
166
184
  # Now we return the newly created atome instead of the current atome that is the parent cf: b=box; c=b.circle
167
185
  end
168
186
 
@@ -7,20 +7,20 @@ 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
- # we reassign the old id
13
- puts "the id : #{params} is already used"
14
- params = @id
15
- # return false
16
- else
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
17
17
  if @id.to_sym != params
18
18
  Universe.update_atome_id(params, self, @id)
19
19
  else
20
20
  Universe.add_to_atomes(params, self)
21
21
  end
22
22
 
23
- end
23
+ # end
24
24
  params
25
25
  end
26
26
  new({ particle: :name, category: :identity, type: :string })
@@ -45,7 +45,12 @@ class Atome
45
45
  def preset_common(params, &bloc)
46
46
  ## if an atome with current id exist we update the ID in the params
47
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
48
52
  Atome.new(params, &bloc)
53
+ # end
49
54
  end
50
55
 
51
56
  def box(params = {}, &bloc)
data/lib/atome/version.rb CHANGED
@@ -2,6 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.3.9'
5
+ VERSION = '0.5.6.4.0'
6
6
  end
7
-
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/atome'
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'
@@ -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/atome'
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'
@@ -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
- 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
-
35
- html.style(:border, "#{type} #{thickness}px rgba(#{color})")
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
39
+
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|
@@ -5,10 +5,25 @@ col=color({red: 1, blue: 1, id: :the_col})
5
5
  c=circle
6
6
  b=box({left: 333})
7
7
  c2=circle({top: 190, width: 99, height: 99})
8
- c2.border({ thickness: 5, color: color(:blue), pattern: :dotted })
8
+ # let's add the border
9
+ c2.border({ thickness: 5, color: :blue, pattern: :dotted })
9
10
  c.border({ thickness: 5, color: col, pattern: :dotted })
10
11
  b.border({ thickness: 5, color: col, pattern: :dotted })
11
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
12
27
 
13
28
  # # frozen_string_literal: true
14
29
  #
@@ -36,4 +36,4 @@ the_text.left(333)
36
36
 
37
37
  the_text.paint({ gradient: [col_1.id, col_2.id], direction: :left , id: :painted_love })
38
38
 
39
- # #TODO : gradient on text!
39
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.3.9
4
+ version: 0.5.6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard
@@ -374,7 +374,6 @@ files:
374
374
  - LICENSE.txt
375
375
  - README.md
376
376
  - Rakefile
377
- - atome-0.5.6.2.7.gem
378
377
  - atome.gemspec
379
378
  - documentation/atome.md
380
379
  - documentation/basic.md
@@ -421,7 +420,7 @@ files:
421
420
  - lib/atome/extensions/mathematics.rb
422
421
  - lib/atome/extensions/ping.rb
423
422
  - lib/atome/extensions/sha.rb
424
- - lib/atome/genesis/atome.rb
423
+ - lib/atome/genesis/atomes.rb
425
424
  - lib/atome/genesis/genesis.rb
426
425
  - lib/atome/genesis/particles/atome.rb
427
426
  - lib/atome/genesis/particles/communication.rb
data/atome-0.5.6.2.7.gem DELETED
Binary file