weel 1.99.127 → 1.99.128
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 +46 -0
- data/weel.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db2306d1398c142ad06651d1a9db48e0c9a4943133f9bd6571b5bc2471a0c2a2
|
4
|
+
data.tar.gz: c181a1d7ef50b406e97dbefff98d3cd326323c3aaf77e87605ab2c6eeae3397d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d0c335a5e58548963d9e5fa22ef985534670bc26f077636065f558ffb159210b38e27b6262f2ba0dffe45c8f593d8e905315ca6cafd09c72d9c38cdcbea267
|
7
|
+
data.tar.gz: d65d56e15a65ccbb609e5a205743a59dbede363d4b3772432a5ee04a1ecc39e2f4402dce911f1a0922aa3b166a5e037b88f1f2ec1fc982386d20be15f9c2c0b7
|
data/lib/weel.rb
CHANGED
@@ -290,6 +290,42 @@ class WEEL
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
end # }}}
|
293
|
+
class ReadOnlyHash # {{{
|
294
|
+
def initialize(values)
|
295
|
+
@__weel_values = values.transform_values do |v|
|
296
|
+
if Object.const_defined?(:XML) && XML.const_defined?(:Smart) && v.is_a?(XML::Smart::Dom)
|
297
|
+
v.root.to_doc
|
298
|
+
else
|
299
|
+
begin
|
300
|
+
Marshal.load(Marshal.dump(v))
|
301
|
+
rescue
|
302
|
+
v.to_s rescue nil
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
def to_json(*args)
|
309
|
+
@__weel_values.to_json(*args)
|
310
|
+
end
|
311
|
+
|
312
|
+
def method_missing(name,*args)
|
313
|
+
if args.empty? && @__weel_values.key?(name)
|
314
|
+
@__weel_values[name]
|
315
|
+
elsif args.empty? && @__weel_values.key?(name.to_s)
|
316
|
+
@__weel_values[name.to_s]
|
317
|
+
elsif name.to_s[-1..-1] == "=" && args.length == 1
|
318
|
+
temp = name.to_s[0..-2]
|
319
|
+
@__weel_values[temp.to_sym] = args[0]
|
320
|
+
elsif name.to_s == "[]=" && args.length == 2
|
321
|
+
@__weel_values[args[0]] = args[1]
|
322
|
+
elsif name.to_s == "[]" && args.length == 1
|
323
|
+
@__weel_values[args[0]]
|
324
|
+
else
|
325
|
+
nil
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end # }}}
|
293
329
|
|
294
330
|
class ProcString #{{{
|
295
331
|
attr_reader :code
|
@@ -718,6 +754,16 @@ class WEEL
|
|
718
754
|
self.__weel_state = :stopping
|
719
755
|
end #}}}
|
720
756
|
|
757
|
+
def status # {{{
|
758
|
+
@__weel_status
|
759
|
+
end # }}}
|
760
|
+
def data # {{{
|
761
|
+
ReadOnlyHash.new(@__weel_data)
|
762
|
+
end # }}}
|
763
|
+
def endpoints # {{{
|
764
|
+
ReadHash.new(@__weel_endpoints)
|
765
|
+
end # }}}
|
766
|
+
|
721
767
|
private
|
722
768
|
def __weel_protect_yield(*local) #{{{
|
723
769
|
begin
|
data/weel.gemspec
CHANGED