lib/plugins/guiparser.rb in rsence-2.0.0.5.pre vs lib/plugins/guiparser.rb in rsence-2.0.0.6.pre
- old
+ new
@@ -1,13 +1,15 @@
-## Riassence Framework
+## RSence
# Copyright 2009 Riassence Inc.
# http://riassence.com/
#
# You should have received a copy of the GNU General Public License along
# with this software package. If not, contact licensing@riassence.com
##
+module ::RSence
+module Plugins
# This class automatically loads a YAML file from "gui" subdirectory of a plugin.
# Extend your plugin from the GUIPlugin class instead of the Plugin class to make
# this work automatically.
# = Usage:
# Initialize like this from inside a plugin method. This will load the "gui/my_gui.yaml" file.
@@ -36,11 +38,12 @@
js_src = @parent.read_js_once( msg, js_file )
msg.reply( js_src )
end
end
gui_name = @parent.name
- msg.reply( "JSONRenderer.nu(#{gui_data.to_json});", true )
+ json_data = JSON.dump( gui_data )
+ msg.reply( "JSONRenderer.nu(#{json_data});", true )
end
# Use this method to extract all the value id's of the +ses+ hash.
def values( ses )
ids = {}
@@ -109,6 +112,7 @@
@parent = parent
@yaml_src = yaml_src
end
end
-
+end
+end