weel 1.99.55 → 1.99.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weel.rb +30 -10
- data/weel.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4cdf62385cfec6d6ef0af98c8a76d8d52259796
|
4
|
+
data.tar.gz: 26fc6450ac38515a53833be35da736019fab71f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30efad55aea47e8d445c9bd079e539f2f8474d76647dff7f952f874296c03298f62b9cacf4ff619fb6766a6622d959ea6e80c69481835de2565523bf18be1973
|
7
|
+
data.tar.gz: 6d5d7c4d9475c6c8e4b3e9e8ca6b55db3d4149a0de3fd45e15dd843d6c6186ba83ff421be2ac7b433c6090df31e3bb6a2b4b527c08e07377f7896cea84b8dab8
|
data/lib/weel.rb
CHANGED
@@ -81,21 +81,35 @@ class WEEL
|
|
81
81
|
class ManipulateStructure # {{{
|
82
82
|
def initialize(data,endpoints,status)
|
83
83
|
@__weel_data = data
|
84
|
+
@__weel_data_orig = @__weel_data.transform_values{|val| Marshal.dump(val) }
|
84
85
|
@__weel_endpoints = endpoints
|
86
|
+
@__weel_endpoints_orig = @__weel_endpoints.transform_values{|val| Marshal.dump(val) }
|
85
87
|
@__weel_status = status
|
86
88
|
@changed_status = status.id
|
87
89
|
@changed_data = []
|
90
|
+
@touched_data = []
|
88
91
|
@changed_endpoints = []
|
92
|
+
@touched_endpoints = []
|
89
93
|
end
|
90
94
|
|
91
|
-
|
95
|
+
def changed_data
|
96
|
+
@touched_data.each do |e|
|
97
|
+
if Marshal.dump(@__weel_data[e]) != @__weel_data_orig[e]
|
98
|
+
@changed_data << e
|
99
|
+
end
|
100
|
+
end
|
101
|
+
@changed_data
|
102
|
+
end
|
103
|
+
def changed_endpoints
|
104
|
+
@changed_endpoints
|
105
|
+
end
|
92
106
|
|
93
107
|
def original_data
|
94
|
-
@
|
108
|
+
@__weel_data_orig.transform_values{|val| Marshal.load(val) }
|
95
109
|
end
|
96
110
|
|
97
111
|
def original_endpoints
|
98
|
-
@
|
112
|
+
@__weel_endpoints_orig.transform_values{|val| Marshal.load(val) }
|
99
113
|
end
|
100
114
|
|
101
115
|
def changed_status
|
@@ -103,43 +117,49 @@ class WEEL
|
|
103
117
|
end
|
104
118
|
|
105
119
|
def data
|
106
|
-
ManipulateHash.new(@__weel_data,@changed_data)
|
120
|
+
ManipulateHash.new(@__weel_data,@touched_data,@changed_data)
|
107
121
|
end
|
108
122
|
def endpoints
|
109
|
-
ManipulateHash.new(@__weel_endpoints,@changed_endpoints)
|
123
|
+
ManipulateHash.new(@__weel_endpoints,@touched_endpoints,@changed_endpoints)
|
110
124
|
end
|
111
125
|
def status
|
112
126
|
@__weel_status
|
113
127
|
end
|
114
128
|
end # }}}
|
115
129
|
class ManipulateHash # {{{
|
116
|
-
|
130
|
+
attr_reader :__weel_touched, :__weel_changed
|
131
|
+
|
132
|
+
def initialize(values,touched,changed)
|
117
133
|
@__weel_values = values
|
118
|
-
@
|
134
|
+
@__weel_touched = touched
|
135
|
+
@__weel_changed = changed
|
119
136
|
end
|
120
137
|
|
121
138
|
def delete(value)
|
122
139
|
if @__weel_values.key?(value)
|
123
|
-
@
|
140
|
+
@__weel_changed << value
|
124
141
|
@__weel_values.delete(value)
|
125
142
|
end
|
126
143
|
end
|
127
144
|
|
128
145
|
def clear
|
129
|
-
@
|
146
|
+
@__weel_changed += @__weel_values.keys
|
130
147
|
@__weel_values.clear
|
131
148
|
end
|
132
149
|
|
133
150
|
def method_missing(name,*args)
|
134
151
|
if args.empty? && @__weel_values.key?(name)
|
152
|
+
@__weel_touched << name
|
135
153
|
@__weel_values[name]
|
136
154
|
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
137
155
|
temp = name.to_s[0..-2]
|
138
|
-
@
|
156
|
+
@__weel_changed << temp.to_sym
|
139
157
|
@__weel_values[temp.to_sym] = args[0]
|
140
158
|
elsif name.to_s == "[]=" && args.length == 2
|
159
|
+
@__weel_changed << args[0]
|
141
160
|
@__weel_values[args[0]] = args[1]
|
142
161
|
elsif name.to_s == "[]" && args.length == 1
|
162
|
+
@__weel_touched << args[0]
|
143
163
|
@__weel_values[args[0]]
|
144
164
|
else
|
145
165
|
nil
|
data/weel.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.99.
|
4
|
+
version: 1.99.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-03-
|
12
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|