rhodes 3.3.3.beta.4 → 3.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -5
- data/CREDITS +2215 -0
- data/Rakefile +225 -59
- data/bin/c2dm.rb +0 -0
- data/bin/get-rhodes-info.bat +0 -0
- data/bin/migrate-rhodes-app +0 -0
- data/bin/migrate-rhodes-app.bat +0 -0
- data/bin/rhodes +0 -0
- data/bin/rhodes-setup +0 -0
- data/bin/rhodes-setup.bat +0 -0
- data/bin/rhogen +0 -0
- data/bin/rhogen.bat +0 -0
- data/bin/set-rhodes-sdk +0 -0
- data/bin/set-rhodes-sdk.bat +0 -0
- data/bin/upgrade-rhodes-app +0 -0
- data/bin/upgrade-rhodes-app.bat +0 -0
- data/doc/build.txt +20 -9
- data/doc/configuration.txt +8 -8
- data/doc/connect-to-web-services.txt +1 -1
- data/doc/device-caps.txt +63 -26
- data/doc/extensions.txt +14 -2
- data/doc/install.txt +28 -19
- data/doc/introduction.txt +6 -3
- data/doc/jqt-jqm-transition.txt +10 -9
- data/doc/release.txt +5 -1
- data/doc/rhodes-command-line.txt +130 -0
- data/doc/rhom.txt +16 -11
- data/doc/rhostudio-eclipse.txt +3 -3
- data/doc/simulator.txt +28 -31
- data/doc/syncengine-ajax-api.txt +246 -0
- data/doc/synchronization.txt +21 -3
- data/doc/test-log-debug.txt +3 -1
- data/doc/ui.txt +16 -16
- data/ext/extconf.rb +8 -0
- data/lib/build/jake.rb +5 -5
- data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +9 -9
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp +81 -1
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/CaptureActivityHandler.java +6 -13
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/DecodeHandler.java +2 -6
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +12 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/run.bat +0 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.h +2 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +36 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.h +0 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +15 -5
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +64 -1
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode.i +35 -1
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +126 -2
- data/lib/extensions/barcode/ext/barcode/shared/src/zbar.c +18 -1
- data/lib/extensions/barcode/ext/build +0 -0
- data/lib/extensions/barcode/ext/build.bat +0 -0
- data/lib/extensions/digest-md5/ext/Rakefile +12 -10
- data/lib/extensions/digest-md5/ext/build +0 -0
- data/lib/extensions/digest-md5/ext/build.bat +0 -0
- data/lib/extensions/digest-md5/ext/digest-md5.sln +2 -2
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +41 -28
- data/lib/extensions/digest-sha1/ext/Rakefile +11 -10
- data/lib/extensions/digest-sha1/ext/build +0 -0
- data/lib/extensions/digest-sha1/ext/build.bat +0 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.sln +2 -2
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +41 -28
- data/lib/extensions/digest/ext/Rakefile +12 -11
- data/lib/extensions/digest/ext/build +0 -0
- data/lib/extensions/digest/ext/build.bat +0 -0
- data/lib/extensions/digest/ext/digest.sln +44 -0
- data/lib/extensions/digest/ext/digest.vcproj +40 -27
- data/lib/extensions/esri/ext/build +0 -0
- data/lib/extensions/esri/ext/build.bat +0 -0
- data/lib/extensions/fcntl/ext/Rakefile +10 -9
- data/lib/extensions/fcntl/ext/build +0 -0
- data/lib/extensions/fcntl/ext/build.bat +0 -0
- data/lib/extensions/fcntl/ext/fcntl.vcproj +1 -1
- data/lib/extensions/nfc/ext/build +0 -0
- data/lib/extensions/nfc/ext/build.bat +0 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +11 -11
- data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +0 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +12 -10
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +16 -9
- data/lib/extensions/pdf-writer/color.rb +145 -0
- data/lib/extensions/pdf-writer/color/cmyk.rb +279 -0
- data/lib/extensions/pdf-writer/color/css.rb +28 -0
- data/lib/extensions/pdf-writer/color/grayscale.rb +212 -0
- data/lib/extensions/pdf-writer/color/hsl.rb +221 -0
- data/lib/extensions/pdf-writer/color/palette.rb +16 -0
- data/lib/extensions/pdf-writer/color/palette/adobecolor.rb +272 -0
- data/lib/extensions/pdf-writer/color/palette/gimp.rb +116 -0
- data/lib/extensions/pdf-writer/color/palette/monocontrast.rb +180 -0
- data/lib/extensions/pdf-writer/color/rgb-colors.rb +355 -0
- data/lib/extensions/pdf-writer/color/rgb.rb +453 -0
- data/lib/extensions/pdf-writer/color/rgb/metallic.rb +43 -0
- data/lib/extensions/pdf-writer/color/yiq.rb +84 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/color/Licence.txt +27 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/color/README.txt +32 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/pdf-writer/LICENCE +131 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/pdf-writer/README +33 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/transaction-simple/Licence.txt +25 -0
- data/lib/extensions/pdf-writer/ext/LICENSES/transaction-simple/Readme.txt +204 -0
- data/lib/extensions/pdf-writer/pdf/charts.rb +13 -0
- data/lib/extensions/pdf-writer/pdf/charts/stddev.rb +430 -0
- data/lib/extensions/pdf-writer/pdf/math.rb +108 -0
- data/lib/extensions/pdf-writer/pdf/quickref.rb +332 -0
- data/lib/extensions/pdf-writer/pdf/simpletable.rb +947 -0
- data/lib/extensions/pdf-writer/pdf/techbook.rb +901 -0
- data/lib/extensions/pdf-writer/pdf/writer.rb +2729 -0
- data/lib/extensions/pdf-writer/pdf/writer/arc4.rb +63 -0
- data/lib/extensions/pdf-writer/pdf/writer/fontmetrics.rb +203 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-Bold.afm +342 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-BoldOblique.afm +342 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-Oblique.afm +342 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier.afm +342 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-Bold.afm +2827 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-BoldOblique.afm +2827 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-Oblique.afm +3051 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica.afm +3051 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/MustRead.html +19 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Symbol.afm +213 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Bold.afm +2588 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-BoldItalic.afm +2384 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Italic.afm +2667 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Roman.afm +2419 -0
- data/lib/extensions/pdf-writer/pdf/writer/fonts/ZapfDingbats.afm +225 -0
- data/lib/extensions/pdf-writer/pdf/writer/graphics.rb +813 -0
- data/lib/extensions/pdf-writer/pdf/writer/graphics/imageinfo.rb +365 -0
- data/lib/extensions/pdf-writer/pdf/writer/lang.rb +43 -0
- data/lib/extensions/pdf-writer/pdf/writer/lang/en.rb +99 -0
- data/lib/extensions/pdf-writer/pdf/writer/object.rb +23 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/action.rb +35 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/annotation.rb +42 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/catalog.rb +39 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/contents.rb +65 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/destination.rb +40 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/encryption.rb +53 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/font.rb +72 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/fontdescriptor.rb +34 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/fontencoding.rb +40 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/image.rb +304 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/info.rb +51 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/outline.rb +30 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/outlines.rb +30 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/page.rb +195 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/pages.rb +115 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/procset.rb +46 -0
- data/lib/extensions/pdf-writer/pdf/writer/object/viewerpreferences.rb +74 -0
- data/lib/extensions/pdf-writer/pdf/writer/ohash.rb +58 -0
- data/lib/extensions/pdf-writer/pdf/writer/oreader.rb +25 -0
- data/lib/extensions/pdf-writer/pdf/writer/state.rb +48 -0
- data/lib/extensions/pdf-writer/pdf/writer/strokestyle.rb +138 -0
- data/lib/extensions/pdf-writer/transaction/simple.rb +486 -0
- data/lib/extensions/pdf-writer/transaction/simple/group.rb +146 -0
- data/lib/extensions/pdf-writer/transaction/simple/threadsafe.rb +68 -0
- data/lib/extensions/pdf-writer/transaction/simple/threadsafe/group.rb +36 -0
- data/lib/framework/builtinME.rb +0 -0
- data/lib/framework/dateOrig.rb +8 -2
- data/lib/framework/rational.rb +0 -0
- data/lib/framework/res/esri.wm.png +0 -0
- data/lib/framework/rho/rho.rb +6 -0
- data/lib/framework/rho/rhobluetooth.rb +0 -0
- data/lib/framework/rho/rhofsconnector.rb +0 -0
- data/lib/framework/rho/rhonativeviewmanager.rb +0 -0
- data/lib/framework/rhofsconnector.rb +0 -0
- data/lib/framework/rhom/rhom_object_factory.rb +8 -0
- data/lib/framework/rhomotoapi.rb +3 -2
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +9 -1
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +1 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +26 -2
- data/platform/android/Rhodes/jni/src/callbacks.cpp +0 -5
- data/platform/android/Rhodes/jni/src/camera.cpp +1 -1
- data/platform/android/Rhodes/jni/src/fileapi.cpp +39 -19
- data/platform/android/Rhodes/jni/src/geolocation.cpp +3 -3
- data/platform/android/Rhodes/jni/src/mapview.cpp +206 -64
- data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/rhodes.cpp +13 -0
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +20 -0
- data/platform/android/Rhodes/jni/src/rhodessystem.cpp +36 -3
- data/platform/android/Rhodes/jni/src/signature.cpp +22 -2
- data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
- data/platform/android/Rhodes/res/drawable/esri.png +0 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +17 -16
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/MemoryInfoCollector.java +67 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +139 -114
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +106 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +11 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +71 -16
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +22 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/Config.java +243 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +19 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +9 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/{RhodesActivityListener.java → extmanager/IRhoListener.java} +16 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +63 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +239 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhodesStartupListeners.java +9 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/WebkitExtension.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +27 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +124 -62
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +49 -137
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +84 -114
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +75 -82
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +3 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Callout.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java +124 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +232 -43
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java +193 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/IRhoCustomView.java +13 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +32 -23
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoVideoView.java +74 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +6 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +37 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +14 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +51 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +9 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +48 -31
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +15 -16
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +52 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +20 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +77 -34
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/IRhoWebView.java +9 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebChromeClient.java +105 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +1 -1
- data/platform/android/build/RhodesSRC_build.files +8 -7
- data/platform/android/build/android.rake +326 -216
- data/platform/android/build/androidcommon.rb +27 -13
- data/platform/bb/RubyVM/src/com/rho/file/SimpleFile.java +27 -1
- data/platform/bb/RubyVM/src/j2me/io/File.java +104 -38
- data/platform/bb/build/bb.rake +1 -0
- data/platform/bb/build/runRAPC.bat +0 -0
- data/platform/bb/rhodes/resources/background.png +0 -0
- data/platform/bb/rhodes/resources/esri.png +0 -0
- data/platform/bb/rhodes/resources/mappin.png +0 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +5 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +2 -2
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +0 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +0 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +0 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +0 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +0 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +7 -1
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +9 -0
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +75 -4
- data/platform/iphone/Classes/GeoLocation/LocationController.h +8 -2
- data/platform/iphone/Classes/GeoLocation/LocationController.m +74 -76
- data/platform/iphone/Classes/InitMemoryInfoCollector.h +33 -0
- data/platform/iphone/Classes/InitMemoryInfoCollector.mm +52 -0
- data/platform/iphone/Classes/NativeView/NVViewController.h +0 -0
- data/platform/iphone/Classes/NativeView/NVViewController.m +34 -2
- data/platform/iphone/Classes/Rhodes.m +22 -2
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +19 -0
- data/platform/iphone/Classes/Signature/SignatureViewController.h +0 -0
- data/platform/iphone/Classes/Signature/SignatureViewController.m +0 -0
- data/platform/iphone/Classes/SimpleMainView.h +0 -0
- data/platform/iphone/Classes/SimpleMainView.m +3 -3
- data/platform/iphone/ESRI/BluePushpin.png +0 -0
- data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
- data/platform/iphone/ESRI/esri.png +0 -0
- data/platform/iphone/ESRI/esri@2x.png +0 -0
- data/platform/iphone/rbuild/iphone.rake +75 -7
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +13 -4
- data/platform/linux/target/compiler/rubylinux +0 -0
- data/platform/mac/target/compiler/RubyMac +0 -0
- data/platform/osx/Rhodes Launcher/rhorunner.app/rhorunner b/data/platform/osx/Rhodes → Launcher/rhorunner.app/rhorunner +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtga.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_inspector.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
- data/platform/osx/build/osx.rake +6 -8
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +165 -33
- data/platform/shared/RhoConnectClient/RhoConnectClient.h +10 -1
- data/platform/shared/common/BundleManager.cpp +27 -16
- data/platform/shared/common/ExtManager.h +15 -2
- data/platform/shared/common/RhoConf.cpp +17 -2
- data/platform/shared/common/RhoConf.h +3 -1
- data/platform/shared/common/RhoDefs.h +6 -6
- data/platform/shared/common/RhoFatalError.h +1 -1
- data/platform/shared/common/RhoFile.cpp +9 -9
- data/platform/shared/common/RhoFilePath.h +7 -3
- data/platform/shared/common/RhoPort.h +3 -3
- data/platform/shared/common/RhoSystem.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +426 -26
- data/platform/shared/common/RhodesApp.h +11 -3
- data/platform/shared/common/RhodesAppBase.cpp +4 -1
- data/platform/shared/common/StringConverter.h +3 -3
- data/platform/shared/common/app_build_capabilities.h +8 -0
- data/platform/shared/common/map/BaseMapEngine.cpp +302 -21
- data/platform/shared/common/map/BaseMapEngine.h +132 -6
- data/platform/shared/common/map/ESRIMapEngine.cpp +2 -1
- data/platform/shared/common/map/GeocodingMapEngine.cpp +22 -4
- data/platform/shared/common/map/GeocodingMapEngine.h +40 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +13 -1
- data/platform/shared/common/map/MapEngine.h +7 -0
- data/platform/shared/common/map/OSMMapEngine.cpp +12 -1
- data/platform/shared/json/JSONIterator.cpp +1 -1
- data/platform/shared/json/RJSONTokener.c +2 -0
- data/platform/shared/json/config.h +3 -3
- data/platform/shared/logging/RhoLog.cpp +12 -3
- data/platform/shared/logging/RhoLog.h +2 -1
- data/platform/shared/logging/RhoLogConf.cpp +147 -11
- data/platform/shared/logging/RhoLogConf.h +39 -1
- data/platform/shared/logging/RhoLogSink.cpp +1 -1
- data/platform/shared/net/HttpServer.cpp +8 -4
- data/platform/shared/net/INetRequest.cpp +7 -0
- data/platform/shared/net/INetRequest.h +2 -0
- data/platform/shared/net/RawSocket.cpp +1 -1
- data/platform/shared/qt/pbxproj2pro.pl +0 -0
- data/platform/shared/qt/pro_vcproj_diff.pl +0 -0
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +1 -1
- data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.h +2 -2
- data/platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp +2 -2
- data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +11 -1
- data/platform/shared/qt/rhodes/main.cpp +5 -5
- data/platform/shared/ruby/ext/alert/alert_wrap.c +8 -8
- data/platform/shared/ruby/ext/bluetooth/bluetooth.i +0 -0
- data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +16 -9
- data/platform/shared/ruby/ext/camera/camera.i +2 -2
- data/platform/shared/ruby/ext/camera/camera_wrap.c +18 -3
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +37 -8
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +8 -8
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +16 -9
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +16 -9
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +0 -0
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +16 -9
- data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +8 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +7 -1
- data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +16 -9
- data/platform/shared/ruby/ext/signature/signature.i +0 -0
- data/platform/shared/ruby/ext/signature/signature_wrap.c +9 -9
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +16 -9
- data/platform/shared/ruby/ext/system/system_wrap.c +16 -9
- data/platform/shared/ruby/ext/webview/webview_wrap.c +16 -9
- data/platform/shared/ruby/gc.c +1 -0
- data/platform/shared/ruby/regint.h +6 -4
- data/platform/shared/ruby/vm.c +1 -0
- data/platform/shared/ruby/wince/wince.h +1 -1
- data/platform/shared/rubyext/System.cpp +1 -1
- data/platform/shared/shttpd/src/rdispatcher.c +3 -3
- data/platform/shared/shttpd/src/std_includes.h +1 -1
- data/platform/shared/sqlite/sqlite3.c +1 -0
- data/platform/shared/statistic/test/TestProfiling.cpp +1 -1
- data/platform/shared/stlport/build/lib/configure +0 -0
- data/platform/shared/stlport/build/lib/configure.bat +0 -0
- data/platform/shared/sync/SyncEngine.cpp +9 -12
- data/platform/shared/sync/SyncNotify.cpp +36 -3
- data/platform/shared/sync/SyncNotify.h +11 -4
- data/platform/shared/sync/SyncSource.cpp +32 -16
- data/platform/shared/sync/SyncSource.h +2 -3
- data/platform/shared/sync/SyncThread.cpp +13 -4
- data/platform/shared/sync/SyncThread.h +4 -0
- data/platform/shared/tcmalloc/page_heap.h +1 -1
- data/platform/shared/tcmalloc/rhomem.h +1 -1
- data/platform/shared/tcmalloc/windows/port.cpp +12 -3
- data/platform/shared/test/Tests.cpp +4 -4
- data/platform/shared/test/test_helper.cpp +4 -4
- data/platform/symbian/sqlite3/src/sqlite3.h +1 -1
- data/platform/win32/RhoSimulator/Microsoft.VC90.CRT.manifest +6 -0
- data/platform/win32/RhoSimulator/Microsoft.VC90.OpenMP.manifest +6 -0
- data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
- data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
- data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
- data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
- data/platform/win32/RhoSimulator/libeay32.dll +0 -0
- data/platform/win32/RhoSimulator/msvcm90.dll +0 -0
- data/platform/win32/RhoSimulator/msvcp90.dll +0 -0
- data/platform/win32/RhoSimulator/msvcr90.dll +0 -0
- data/platform/win32/RhoSimulator/phonon4.dll +0 -0
- data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
- data/platform/win32/RhoSimulator/vcomp90.dll +0 -0
- data/platform/win32/target/replaceicon/replaceicon.exe +0 -0
- data/platform/win32/target/updateresstring/updateresstring.exe +0 -0
- data/platform/wm/RhoLib/RhoLib.vcproj +394 -69
- data/platform/wm/build/build_inf.js +83 -23
- data/platform/wm/build/wm.rake +127 -81
- data/platform/wm/rhodes.sln +6 -6
- data/platform/wm/rhodes/DateTimePicker.h +2 -2
- data/platform/wm/rhodes/IBrowserEngine.h +3 -0
- data/platform/wm/rhodes/IEBrowserEngine.cpp +34 -2
- data/platform/wm/rhodes/IEBrowserEngine.h +4 -1
- data/platform/wm/rhodes/LicenseStub.cpp +73 -0
- data/platform/{android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java → wm/rhodes/LogMemory.cpp} +32 -20
- data/platform/{android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettings.java → wm/rhodes/LogMemory.h} +11 -8
- data/platform/wm/rhodes/LogOptionsDlg.h +1 -1
- data/platform/wm/rhodes/LogView.cpp +10 -10
- data/platform/wm/rhodes/LogView.h +10 -10
- data/platform/wm/rhodes/MainWindow.cpp +431 -173
- data/platform/wm/rhodes/MainWindow.h +37 -19
- data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
- data/platform/wm/rhodes/OkCancelModalDialog.h +1 -1
- data/platform/wm/rhodes/Rhodes.cpp +210 -47
- data/platform/wm/rhodes/Rhodes.rc +38 -0
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +2 -2
- data/platform/wm/rhodes/bluetooth/Bluetooth.h +3 -3
- data/platform/wm/rhodes/camera/Camera.cpp +2 -1
- data/platform/wm/rhodes/camera/Camera.h +1 -1
- data/platform/wm/rhodes/resource.h +1 -1
- data/platform/wm/rhodes/rho/common/ExtManager.cpp +93 -5
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +2 -2
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +2 -2
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +13 -7
- data/platform/wm/rhodes/rhodes.vcproj +1409 -1008
- data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
- data/platform/wm/rhodes/stdafx.h +2 -2
- data/platform/wm/rhoelements.sln +7 -9
- data/platform/wm/rubylib/rubylib.vcproj +62 -1
- data/platform/wm/sqlite3/sqlite3.vcproj +62 -1
- data/platform/wm/syncengine/syncengine.vcproj +62 -1
- data/platform/wm/tcmalloc/tcmalloc.vcproj +72 -53
- data/platform/wm/tools/detool/detool.cpp +1435 -1357
- data/platform/wp7/RhoRubyExtGen/GenerateInitializers.cmd +0 -0
- data/platform/wp7/RhoRubyLib/common/RhoLicense.cs +105 -0
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +23 -5
- data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +5 -0
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +22 -3
- data/platform/wp7/build/wp.rake +1 -0
- data/platform/wp7/rhodes/MainPage.xaml.cs +11 -0
- data/rakefile.rb +225 -59
- data/res/build-tools/7za.exe +0 -0
- data/res/build-tools/RhoAppRunner.exe +0 -0
- data/res/build-tools/RhoLogServer.exe +0 -0
- data/res/build-tools/RhoRuby.exe +0 -0
- data/res/build-tools/RubyMac +0 -0
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +1 -1
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim_43 +0 -0
- data/res/build-tools/license_rc.dll +0 -0
- data/res/build-tools/make.exe +0 -0
- data/res/build-tools/rubylinux +0 -0
- data/res/build-tools/swig_patch/Lib/typemaps/fragments.swg +235 -0
- data/res/build-tools/wmdc_connect.exe +0 -0
- data/res/build-tools/wp7explorer.exe +0 -0
- data/res/generators/rhogen.rb +2 -2
- data/res/generators/templates/application/app/Settings/controller.rb +1 -1
- data/res/generators/templates/application/app/layout.erb +1 -1
- data/res/generators/templates/application/app/loading.png +0 -0
- data/res/generators/templates/application/public/css/re_webkit.css +736 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +0 -0
- data/res/generators/templates/application/public/images/listArrow.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
- data/res/generators/templates/application/public/js/syncengine.js +409 -52
- data/res/generators/templates/extension/extensions/montana/ext/build +0 -0
- data/res/generators/templates/extension/extensions/montana/ext/build.bat +0 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/android/Rakefile +10 -10
- data/res/generators/templates/spec/app/SpecRunner/controller.rb +2 -0
- data/res/libs/motorolalicence/android/MotorolaLicence.h +13 -0
- data/res/libs/motorolalicence/android/libMotorolaLicence.a +0 -0
- data/res/libs/motorolalicence/iphone/MotorolaLicence.h +13 -0
- data/res/libs/motorolalicence/iphone/libMotorolaLicence.a +0 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/SpecRunner/controller.rb +2 -0
- data/spec/phone_spec/app/SpecRunner/controller.rb +2 -0
- data/version +1 -1
- metadata +487 -412
- data/Manifest.txt +0 -7960
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityStartupListeners.java +0 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +0 -52
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +0 -62
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
- data/platform/win32/RhoSimulator/Microsoft.VC80.CRT.manifest +0 -8
- data/platform/win32/RhoSimulator/Microsoft.VC80.OpenMP.manifest +0 -7
- data/platform/win32/RhoSimulator/msvcm80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcp80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcr80.dll +0 -0
- data/platform/win32/RhoSimulator/vcomp.dll +0 -0
- data/rhomobile-debug-1.0.6.gem +0 -0
@@ -0,0 +1,486 @@
|
|
1
|
+
# :title: Transaction::Simple -- Active Object Transaction Support for Ruby
|
2
|
+
# :main: Readme.txt
|
3
|
+
|
4
|
+
#--
|
5
|
+
# Transaction::Simple
|
6
|
+
# Simple object transaction support for Ruby
|
7
|
+
# http://rubyforge.org/projects/trans-simple/
|
8
|
+
# Version 1.4.0
|
9
|
+
#
|
10
|
+
# Licensed under a MIT-style licence. See Licence.txt in the main
|
11
|
+
# distribution for full licensing information.
|
12
|
+
#
|
13
|
+
# Copyright (c) 2003 - 2007 Austin Ziegler
|
14
|
+
#
|
15
|
+
# $Id: simple.rb 50 2007-02-03 20:26:19Z austin $
|
16
|
+
#++
|
17
|
+
|
18
|
+
# The "Transaction" namespace can be used for additional transaction support
|
19
|
+
# objects and modules.
|
20
|
+
module Transaction
|
21
|
+
# A standard exception for transaction errors.
|
22
|
+
class TransactionError < StandardError; end
|
23
|
+
# The TransactionAborted exception is used to indicate when a transaction
|
24
|
+
# has been aborted in the block form.
|
25
|
+
class TransactionAborted < Exception; end
|
26
|
+
# The TransactionCommitted exception is used to indicate when a
|
27
|
+
# transaction has been committed in the block form.
|
28
|
+
class TransactionCommitted < Exception; end
|
29
|
+
|
30
|
+
te = "Transaction Error: %s"
|
31
|
+
|
32
|
+
Messages = { #:nodoc:
|
33
|
+
:bad_debug_object => te % "the transaction debug object must respond to #<<.",
|
34
|
+
:unique_names => te % "named transactions must be unique.",
|
35
|
+
:no_transaction_open => te % "no transaction open.",
|
36
|
+
:cannot_rewind_no_transaction => te % "cannot rewind; there is no current transaction.",
|
37
|
+
:cannot_rewind_named_transaction => te % "cannot rewind to transaction %s because it does not exist.",
|
38
|
+
:cannot_rewind_transaction_before_block => te % "cannot rewind a transaction started before the execution block.",
|
39
|
+
:cannot_abort_no_transaction => te % "cannot abort; there is no current transaction.",
|
40
|
+
:cannot_abort_transaction_before_block => te % "cannot abort a transaction started before the execution block.",
|
41
|
+
:cannot_abort_named_transaction => te % "cannot abort nonexistant transaction %s.",
|
42
|
+
:cannot_commit_no_transaction => te % "cannot commit; there is no current transaction.",
|
43
|
+
:cannot_commit_transaction_before_block => te % "cannot commit a transaction started before the execution block.",
|
44
|
+
:cannot_commit_named_transaction => te % "cannot commit nonexistant transaction %s.",
|
45
|
+
:cannot_start_empty_block_transaction => te % "cannot start a block transaction with no objects.",
|
46
|
+
:cannot_obtain_transaction_lock => te % "cannot obtain transaction lock for #%s.",
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# = Transaction::Simple for Ruby
|
51
|
+
# Simple object transaction support for Ruby
|
52
|
+
module Transaction::Simple
|
53
|
+
TRANSACTION_SIMPLE_VERSION = '1.4.0'
|
54
|
+
|
55
|
+
class << self
|
56
|
+
# Sets the Transaction::Simple debug object. It must respond to #<<.
|
57
|
+
# Debugging will be performed automatically if there's a debug object.
|
58
|
+
def debug_io=(io)
|
59
|
+
if io.nil?
|
60
|
+
@tdi = nil
|
61
|
+
@debugging = false
|
62
|
+
else
|
63
|
+
raise Transaction::TransactionError, Transaction::Messages[:bad_debug_object] unless io.respond_to?(:<<)
|
64
|
+
@tdi = io
|
65
|
+
@debugging = true
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns +true+ if we are debugging.
|
70
|
+
def debugging?
|
71
|
+
defined? @debugging and @debugging
|
72
|
+
end
|
73
|
+
|
74
|
+
# Returns the Transaction::Simple debug object. It must respond to #<<.
|
75
|
+
def debug_io
|
76
|
+
@tdi ||= ""
|
77
|
+
@tdi
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# If +name+ is +nil+ (default), then returns +true+ if there is currently
|
82
|
+
# a transaction open. If +name+ is specified, then returns +true+ if there
|
83
|
+
# is currently a transaction known as +name+ open.
|
84
|
+
def transaction_open?(name = nil)
|
85
|
+
defined? @__transaction_checkpoint__ or @__transaction_checkpoint__ = nil
|
86
|
+
if name.nil?
|
87
|
+
Transaction::Simple.debug_io << "Transaction " << "[#{(@__transaction_checkpoint__.nil?) ? 'closed' : 'open'}]\n" if Transaction::Simple.debugging?
|
88
|
+
return (not @__transaction_checkpoint__.nil?)
|
89
|
+
else
|
90
|
+
Transaction::Simple.debug_io << "Transaction(#{name.inspect}) " << "[#{(@__transaction_checkpoint__.nil?) ? 'closed' : 'open'}]\n" if Transaction::Simple.debugging?
|
91
|
+
return ((not @__transaction_checkpoint__.nil?) and @__transaction_names__.include?(name))
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Returns the current name of the transaction. Transactions not explicitly
|
96
|
+
# named are named +nil+.
|
97
|
+
def transaction_name
|
98
|
+
raise Transaction::TransactionError, Transaction::Messages[:no_transaction_open] if @__transaction_checkpoint__.nil?
|
99
|
+
Transaction::Simple.debug_io << "#{'|' * @__transaction_level__} " << "Transaction Name: #{@__transaction_names__[-1].inspect}\n" if Transaction::Simple.debugging?
|
100
|
+
if @__transaction_names__[-1].kind_of?(String)
|
101
|
+
@__transaction_names__[-1].dup
|
102
|
+
else
|
103
|
+
@__transaction_names__[-1]
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Starts a transaction. Stores the current object state. If a transaction
|
108
|
+
# name is specified, the transaction will be named. Transaction names must
|
109
|
+
# be unique. Transaction names of +nil+ will be treated as unnamed
|
110
|
+
# transactions.
|
111
|
+
def start_transaction(name = nil)
|
112
|
+
@__transaction_level__ ||= 0
|
113
|
+
@__transaction_names__ ||= []
|
114
|
+
|
115
|
+
name = name.dup.freeze if name.kind_of?(String)
|
116
|
+
|
117
|
+
raise Transaction::TransactionError, Transaction::Messages[:unique_names] if name and @__transaction_names__.include?(name)
|
118
|
+
|
119
|
+
@__transaction_names__ << name
|
120
|
+
@__transaction_level__ += 1
|
121
|
+
|
122
|
+
if Transaction::Simple.debugging?
|
123
|
+
ss = "(#{name.inspect})"
|
124
|
+
ss = "" unless ss
|
125
|
+
|
126
|
+
Transaction::Simple.debug_io << "#{'>' * @__transaction_level__} " << "Start Transaction#{ss}\n"
|
127
|
+
end
|
128
|
+
|
129
|
+
@__transaction_checkpoint__ = Marshal.dump(self)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Rewinds the transaction. If +name+ is specified, then the intervening
|
133
|
+
# transactions will be aborted and the named transaction will be rewound.
|
134
|
+
# Otherwise, only the current transaction is rewound.
|
135
|
+
#
|
136
|
+
# After each level of transaction is rewound, if the callback method
|
137
|
+
# #_post_transaction_rewind is defined, it will be called. It is intended
|
138
|
+
# to allow a complex self-referential graph to fix itself. The simplest
|
139
|
+
# way to explain this is with an example.
|
140
|
+
#
|
141
|
+
# class Child
|
142
|
+
# attr_accessor :parent
|
143
|
+
# end
|
144
|
+
#
|
145
|
+
# class Parent
|
146
|
+
# include Transaction::Simple
|
147
|
+
#
|
148
|
+
# attr_reader :children
|
149
|
+
# def initialize
|
150
|
+
# @children = []
|
151
|
+
# end
|
152
|
+
#
|
153
|
+
# def << child
|
154
|
+
# child.parent = self
|
155
|
+
# @children << child
|
156
|
+
# end
|
157
|
+
#
|
158
|
+
# def valid?
|
159
|
+
# @children.all? { |child| child.parent == self }
|
160
|
+
# end
|
161
|
+
# end
|
162
|
+
#
|
163
|
+
# parent = Parent.new
|
164
|
+
# parent << Child.new
|
165
|
+
# parent.start_transaction
|
166
|
+
# parent << Child.new
|
167
|
+
# parent.abort_transaction
|
168
|
+
# puts parent.valid? # => false
|
169
|
+
#
|
170
|
+
# This problem can be fixed by modifying the Parent class to include the
|
171
|
+
# #_post_transaction_rewind callback.
|
172
|
+
#
|
173
|
+
# class Parent
|
174
|
+
# # Reconnect the restored children to me, instead of to the bogus me
|
175
|
+
# # that was restored to them by Marshal::load.
|
176
|
+
# def _post_transaction_rewind
|
177
|
+
# @children.each { |child| child.parent = self }
|
178
|
+
# end
|
179
|
+
# end
|
180
|
+
#
|
181
|
+
# parent = Parent.new
|
182
|
+
# parent << Child.new
|
183
|
+
# parent.start_transaction
|
184
|
+
# parent << Child.new
|
185
|
+
# parent.abort_transaction
|
186
|
+
# puts parent.valid? # => true
|
187
|
+
def rewind_transaction(name = nil)
|
188
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_rewind_no_transaction] if @__transaction_checkpoint__.nil?
|
189
|
+
|
190
|
+
# Check to see if we are trying to rewind a transaction that is
|
191
|
+
# outside of the current transaction block.
|
192
|
+
defined? @__transaction_block__ or @__transaction_block__ = nil
|
193
|
+
if @__transaction_block__ and name
|
194
|
+
nix = @__transaction_names__.index(name) + 1
|
195
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_rewind_transaction_before_block] if nix < @__transaction_block__
|
196
|
+
end
|
197
|
+
|
198
|
+
if name.nil?
|
199
|
+
checkpoint = @__transaction_checkpoint__
|
200
|
+
__rewind_this_transaction
|
201
|
+
@__transaction_checkpoint__ = checkpoint
|
202
|
+
ss = "" if Transaction::Simple.debugging?
|
203
|
+
else
|
204
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_rewind_named_transaction] % name.inspect unless @__transaction_names__.include?(name)
|
205
|
+
ss = "(#{name})" if Transaction::Simple.debugging?
|
206
|
+
|
207
|
+
while @__transaction_names__[-1] != name
|
208
|
+
@__transaction_checkpoint__ = __rewind_this_transaction
|
209
|
+
Transaction::Simple.debug_io << "#{'|' * @__transaction_level__} " << "Rewind Transaction#{ss}\n" if Transaction::Simple.debugging?
|
210
|
+
@__transaction_level__ -= 1
|
211
|
+
@__transaction_names__.pop
|
212
|
+
end
|
213
|
+
checkpoint = @__transaction_checkpoint__
|
214
|
+
__rewind_this_transaction
|
215
|
+
@__transaction_checkpoint__ = checkpoint
|
216
|
+
end
|
217
|
+
Transaction::Simple.debug_io << "#{'|' * @__transaction_level__} " << "Rewind Transaction#{ss}\n" if Transaction::Simple.debugging?
|
218
|
+
self
|
219
|
+
end
|
220
|
+
|
221
|
+
# Aborts the transaction. Rewinds the object state to what it was before
|
222
|
+
# the transaction was started and closes the transaction. If +name+ is
|
223
|
+
# specified, then the intervening transactions and the named transaction
|
224
|
+
# will be aborted. Otherwise, only the current transaction is aborted.
|
225
|
+
#
|
226
|
+
# See #rewind_transaction for information about dealing with complex
|
227
|
+
# self-referential object graphs.
|
228
|
+
#
|
229
|
+
# If the current or named transaction has been started by a block
|
230
|
+
# (Transaction::Simple.start), then the execution of the block will be
|
231
|
+
# halted with +break+ +self+.
|
232
|
+
def abort_transaction(name = nil)
|
233
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_no_transaction] if @__transaction_checkpoint__.nil?
|
234
|
+
|
235
|
+
# Check to see if we are trying to abort a transaction that is outside
|
236
|
+
# of the current transaction block. Otherwise, raise TransactionAborted
|
237
|
+
# if they are the same.
|
238
|
+
defined? @__transaction_block__ or @__transaction_block__ = nil
|
239
|
+
if @__transaction_block__ and name
|
240
|
+
nix = @__transaction_names__.index(name) + 1
|
241
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_transaction_before_block] if nix < @__transaction_block__
|
242
|
+
|
243
|
+
raise Transaction::TransactionAborted if @__transaction_block__ == nix
|
244
|
+
end
|
245
|
+
|
246
|
+
raise Transaction::TransactionAborted if @__transaction_block__ == @__transaction_level__
|
247
|
+
|
248
|
+
if name.nil?
|
249
|
+
__abort_transaction(name)
|
250
|
+
else
|
251
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_named_transaction] % name.inspect unless @__transaction_names__.include?(name)
|
252
|
+
__abort_transaction(name) while @__transaction_names__.include?(name)
|
253
|
+
end
|
254
|
+
|
255
|
+
self
|
256
|
+
end
|
257
|
+
|
258
|
+
# If +name+ is +nil+ (default), the current transaction level is closed
|
259
|
+
# out and the changes are committed.
|
260
|
+
#
|
261
|
+
# If +name+ is specified and +name+ is in the list of named transactions,
|
262
|
+
# then all transactions are closed and committed until the named
|
263
|
+
# transaction is reached.
|
264
|
+
def commit_transaction(name = nil)
|
265
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_commit_no_transaction] if @__transaction_checkpoint__.nil?
|
266
|
+
@__transaction_block__ ||= nil
|
267
|
+
|
268
|
+
# Check to see if we are trying to commit a transaction that is outside
|
269
|
+
# of the current transaction block. Otherwise, raise
|
270
|
+
# TransactionCommitted if they are the same.
|
271
|
+
if @__transaction_block__ and name
|
272
|
+
nix = @__transaction_names__.index(name) + 1
|
273
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_commit_transaction_before_block] if nix < @__transaction_block__
|
274
|
+
|
275
|
+
raise Transaction::TransactionCommitted if @__transaction_block__ == nix
|
276
|
+
end
|
277
|
+
|
278
|
+
raise Transaction::TransactionCommitted if @__transaction_block__ == @__transaction_level__
|
279
|
+
|
280
|
+
if name.nil?
|
281
|
+
ss = "" if Transaction::Simple.debugging?
|
282
|
+
__commit_transaction
|
283
|
+
Transaction::Simple.debug_io << "#{'<' * @__transaction_level__} " << "Commit Transaction#{ss}\n" if Transaction::Simple.debugging?
|
284
|
+
else
|
285
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_commit_named_transaction] % name.inspect unless @__transaction_names__.include?(name)
|
286
|
+
ss = "(#{name})" if Transaction::Simple.debugging?
|
287
|
+
|
288
|
+
while @__transaction_names__[-1] != name
|
289
|
+
Transaction::Simple.debug_io << "#{'<' * @__transaction_level__} " << "Commit Transaction#{ss}\n" if Transaction::Simple.debugging?
|
290
|
+
__commit_transaction
|
291
|
+
end
|
292
|
+
Transaction::Simple.debug_io << "#{'<' * @__transaction_level__} " << "Commit Transaction#{ss}\n" if Transaction::Simple.debugging?
|
293
|
+
__commit_transaction
|
294
|
+
end
|
295
|
+
|
296
|
+
self
|
297
|
+
end
|
298
|
+
|
299
|
+
# Alternative method for calling the transaction methods. An optional name
|
300
|
+
# can be specified for named transaction support. This method is
|
301
|
+
# deprecated and will be removed in Transaction::Simple 2.0.
|
302
|
+
#
|
303
|
+
# #transaction(:start):: #start_transaction
|
304
|
+
# #transaction(:rewind):: #rewind_transaction
|
305
|
+
# #transaction(:abort):: #abort_transaction
|
306
|
+
# #transaction(:commit):: #commit_transaction
|
307
|
+
# #transaction(:name):: #transaction_name
|
308
|
+
# #transaction:: #transaction_open?
|
309
|
+
def transaction(action = nil, name = nil)
|
310
|
+
_method = case action
|
311
|
+
when :start then :start_transaction
|
312
|
+
when :rewind then :rewind_transaction
|
313
|
+
when :abort then :abort_transaction
|
314
|
+
when :commit then :commit_transaction
|
315
|
+
when :name then :transaction_name
|
316
|
+
when nil then :transaction_open?
|
317
|
+
else nil
|
318
|
+
end
|
319
|
+
|
320
|
+
if method
|
321
|
+
warn "The #transaction method has been deprecated. Use #{method} instead."
|
322
|
+
else
|
323
|
+
warn "The #transaction method has been deprecated."
|
324
|
+
end
|
325
|
+
|
326
|
+
case method
|
327
|
+
when :transaction_name
|
328
|
+
__send__ method
|
329
|
+
when nil
|
330
|
+
nil
|
331
|
+
else
|
332
|
+
__send__ method, name
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
# Allows specific variables to be excluded from transaction support. Must
|
337
|
+
# be done after extending the object but before starting the first
|
338
|
+
# transaction on the object.
|
339
|
+
#
|
340
|
+
# vv.transaction_exclusions << "@io"
|
341
|
+
def transaction_exclusions
|
342
|
+
@transaction_exclusions ||= []
|
343
|
+
end
|
344
|
+
|
345
|
+
class << self
|
346
|
+
def __common_start(name, vars, &block)
|
347
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_start_empty_block_transaction] if vars.empty?
|
348
|
+
|
349
|
+
if block
|
350
|
+
begin
|
351
|
+
vlevel = {}
|
352
|
+
|
353
|
+
vars.each do |vv|
|
354
|
+
vv.extend(Transaction::Simple)
|
355
|
+
vv.start_transaction(name)
|
356
|
+
vlevel[vv.__id__] = vv.instance_variable_get(:@__transaction_level__)
|
357
|
+
vv.instance_variable_set(:@__transaction_block__, vlevel[vv.__id__])
|
358
|
+
end
|
359
|
+
|
360
|
+
yield(*vars)
|
361
|
+
rescue Transaction::TransactionAborted
|
362
|
+
vars.each do |vv|
|
363
|
+
if name.nil? and vv.transaction_open?
|
364
|
+
loop do
|
365
|
+
tlevel = vv.instance_variable_get(:@__transaction_level__) || -1
|
366
|
+
vv.instance_variable_set(:@__transaction_block__, -1)
|
367
|
+
break if tlevel < vlevel[vv.__id__]
|
368
|
+
vv.abort_transaction if vv.transaction_open?
|
369
|
+
end
|
370
|
+
elsif vv.transaction_open?(name)
|
371
|
+
vv.instance_variable_set(:@__transaction_block__, -1)
|
372
|
+
vv.abort_transaction(name)
|
373
|
+
end
|
374
|
+
end
|
375
|
+
rescue Transaction::TransactionCommitted
|
376
|
+
nil
|
377
|
+
ensure
|
378
|
+
vars.each do |vv|
|
379
|
+
if name.nil? and vv.transaction_open?
|
380
|
+
loop do
|
381
|
+
tlevel = vv.instance_variable_get(:@__transaction_level__) || -1
|
382
|
+
break if tlevel < vlevel[vv.__id__]
|
383
|
+
vv.instance_variable_set(:@__transaction_block__, -1)
|
384
|
+
vv.commit_transaction if vv.transaction_open?
|
385
|
+
end
|
386
|
+
elsif vv.transaction_open?(name)
|
387
|
+
vv.instance_variable_set(:@__transaction_block__, -1)
|
388
|
+
vv.commit_transaction(name)
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
392
|
+
else
|
393
|
+
vars.each do |vv|
|
394
|
+
vv.extend(Transaction::Simple)
|
395
|
+
vv.start_transaction(name)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
end
|
399
|
+
private :__common_start
|
400
|
+
|
401
|
+
# Start a named transaction in a block. The transaction will auto-commit
|
402
|
+
# when the block finishes.
|
403
|
+
def start_named(name, *vars, &block)
|
404
|
+
__common_start(name, vars, &block)
|
405
|
+
end
|
406
|
+
|
407
|
+
# Start a named transaction in a block. The transaction will auto-commit
|
408
|
+
# when the block finishes.
|
409
|
+
def start(*vars, &block)
|
410
|
+
__common_start(nil, vars, &block)
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
414
|
+
def __abort_transaction(name = nil) #:nodoc:
|
415
|
+
@__transaction_checkpoint__ = __rewind_this_transaction
|
416
|
+
|
417
|
+
if Transaction::Simple.debugging?
|
418
|
+
if name.nil?
|
419
|
+
ss = ""
|
420
|
+
else
|
421
|
+
ss = "(#{name.inspect})"
|
422
|
+
end
|
423
|
+
|
424
|
+
Transaction::Simple.debug_io << "#{'<' * @__transaction_level__} " << "Abort Transaction#{ss}\n"
|
425
|
+
end
|
426
|
+
|
427
|
+
@__transaction_level__ -= 1
|
428
|
+
@__transaction_names__.pop
|
429
|
+
if @__transaction_level__ < 1
|
430
|
+
@__transaction_level__ = 0
|
431
|
+
@__transaction_names__ = []
|
432
|
+
@__transaction_checkpoint__ = nil
|
433
|
+
end
|
434
|
+
end
|
435
|
+
|
436
|
+
SKIP_TRANSACTION_VARS = %w(@__transaction_checkpoint__ @__transaction_level__)
|
437
|
+
|
438
|
+
def __rewind_this_transaction #:nodoc:
|
439
|
+
defined? @__transaction_checkpoint__ or @__transaction_checkpoint__ = nil
|
440
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_rewind_no_transaction] if @__transaction_checkpoint__.nil?
|
441
|
+
rr = Marshal.restore(@__transaction_checkpoint__)
|
442
|
+
|
443
|
+
replace(rr) if respond_to?(:replace)
|
444
|
+
|
445
|
+
iv = rr.instance_variables - SKIP_TRANSACTION_VARS - self.transaction_exclusions
|
446
|
+
iv.each do |vv|
|
447
|
+
next if self.transaction_exclusions.include?(vv)
|
448
|
+
|
449
|
+
instance_variable_set(vv, rr.instance_variable_get(vv))
|
450
|
+
end
|
451
|
+
|
452
|
+
rest = instance_variables - rr.instance_variables - SKIP_TRANSACTION_VARS - self.transaction_exclusions
|
453
|
+
rest.each do |vv|
|
454
|
+
remove_instance_variable(vv)
|
455
|
+
end
|
456
|
+
|
457
|
+
_post_transaction_rewind if respond_to?(:_post_transaction_rewind)
|
458
|
+
|
459
|
+
w, $-w = $-w, false # 20070203 OH is this very UGLY
|
460
|
+
res = rr.instance_variable_get(:@__transaction_checkpoint__)
|
461
|
+
$-w = w # 20070203 OH is this very UGLY
|
462
|
+
res
|
463
|
+
end
|
464
|
+
|
465
|
+
def __commit_transaction #:nodoc:
|
466
|
+
defined? @__transaction_checkpoint__ or @__transaction_checkpoint__ = nil
|
467
|
+
raise Transaction::TransactionError, Transaction::Messages[:cannot_commit_no_transaction] if @__transaction_checkpoint__.nil?
|
468
|
+
old = Marshal.restore(@__transaction_checkpoint__)
|
469
|
+
w, $-w = $-w, false # 20070203 OH is this very UGLY
|
470
|
+
@__transaction_checkpoint__ = old.instance_variable_get(:@__transaction_checkpoint__)
|
471
|
+
$-w = w # 20070203 OH is this very UGLY
|
472
|
+
|
473
|
+
@__transaction_level__ -= 1
|
474
|
+
@__transaction_names__.pop
|
475
|
+
|
476
|
+
if @__transaction_level__ < 1
|
477
|
+
@__transaction_level__ = 0
|
478
|
+
@__transaction_names__ = []
|
479
|
+
@__transaction_checkpoint__ = nil
|
480
|
+
end
|
481
|
+
end
|
482
|
+
|
483
|
+
private :__abort_transaction
|
484
|
+
private :__rewind_this_transaction
|
485
|
+
private :__commit_transaction
|
486
|
+
end
|