lib/win32/autogui/application.rb in win32-autogui-0.4.3 vs lib/win32/autogui/application.rb in win32-autogui-0.5.0

- old
+ new

@@ -22,11 +22,12 @@ # Clipboard text setter # # @param [String] str text to load onto the clipboard # def text=(str) - Win32::Clipboard.set_data(str) + data = str.nil? ? "" : str.dup + Win32::Clipboard.set_data(data) end end # The Application class wraps a binary application so @@ -273,10 +274,10 @@ # @calculator.edit_window.text.strip.should == "12,345." # # @return [Clipboard] # def clipboard - @clipboard || Autogui::Clipboard.new + @clipboard ||= Autogui::Clipboard.new end private # @overload raise_error(exception, message)