shenmegui 0.1 → 0.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/shenmegui/core.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 513b4854e956ae69775c6d0492a5fbac43ca61fc
4
- data.tar.gz: f3de44280511211b66ba205b45063df0dfdf711e
3
+ metadata.gz: c38ef5862647ab909f11fa11b3bf389c54932027
4
+ data.tar.gz: fab359c72a15195ea45d20b051e10dbd352f2259
5
5
  SHA512:
6
- metadata.gz: 2d33936c411a35517e1e039db1c81a3924592e36f5a4be555267f568706484ae3f0b506ca98a4ee2250e33c430910c44988b95a19c92772a3d4c846ecf4bf199
7
- data.tar.gz: 89f421ca760489d439502a5db51afef59c077008745e42d8bbbb8f933fa7c88fe4c627a77adc40e868fbccf3c07e5380eaea51095e1fd3920fb4148f77264ca4
6
+ metadata.gz: d87aad2fba95e372fb42facf1ef21f770cb249f808546cb90b0c62cce8cfb7bd9cb07cd323008d5f213eed9bc0834aff02590a847f92be294051be7c2d504d20
7
+ data.tar.gz: 7a7bbec78f76afbab4f39a0656c12bb34248cd497a245530a0bd9acafac81ed2f661b981228d146462e4582c822d1ef8bf925cb27eb3e6699c9e03a2ef82a25a
@@ -38,17 +38,17 @@ module ShenmeGUI
38
38
  end
39
39
 
40
40
  end
41
-
41
+
42
42
  class << self
43
43
  attr_accessor :elements, :socket
44
44
  attr_reader :this
45
45
 
46
- def hook(obj)
46
+ def hook(obj, target)
47
47
  case obj
48
48
  when String
49
- HookedString.new(obj, self)
49
+ HookedString.new(obj, target)
50
50
  when Array
51
- HookedArray.new(obj, self)
51
+ HookedArray.new(obj, target)
52
52
  else
53
53
  obj
54
54
  end
@@ -58,11 +58,11 @@ module ShenmeGUI
58
58
  match_data = msg.match(/(.+?):(\d+)(?:->)?({.+?})?/)
59
59
  command = match_data[1].to_sym
60
60
  id = match_data[2].to_i
61
+ target = elements[id]
61
62
  if match_data[3]
62
63
  data = JSON.parse(match_data[3])
63
- data = Hash[data.keys.collect(&:to_sym).zip(data.values.collect{|x| hook x})]
64
+ data = Hash[data.keys.collect(&:to_sym).zip(data.values.collect{|x| hook(x, target)})]
64
65
  end
65
- target = elements[id]
66
66
  case command
67
67
  when :sync
68
68
  target.properties.update(data)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shenmegui
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CicholGricenchos