rhodes 2.2.6 → 2.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -0
- data/README.md +46 -0
- data/Rakefile +85 -80
- data/bin/rhodes +2 -2
- data/bin/rhogen +1 -1
- data/doc/application.txt +277 -0
- data/doc/bb-css.txt +209 -0
- data/doc/build.txt +785 -0
- data/doc/configuration.txt +236 -0
- data/doc/connect-to-web-services.txt +282 -0
- data/doc/contributing.txt +64 -0
- data/doc/css-framework.txt +144 -0
- data/doc/device-caps.txt +1152 -0
- data/doc/extensions.txt +528 -0
- data/doc/files.txt +4 -0
- data/doc/generator.txt +141 -0
- data/doc/install.txt +35 -0
- data/doc/introduction.txt +88 -0
- data/doc/rhom.txt +826 -0
- data/doc/standard-css.txt +392 -0
- data/doc/synchronization.txt +542 -0
- data/doc/test-log-debug.txt +148 -0
- data/doc/tutorial.txt +136 -0
- data/doc/ui.txt +766 -0
- data/installer/EnvVarUpdate.nsh +328 -0
- data/installer/README.html +81 -0
- data/installer/RHOSYNC-LICENSE.txt +675 -0
- data/installer/icon.ico +0 -0
- data/installer/instant-rhodes.nsi +427 -0
- data/lib/build/jake.rb +15 -1
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
- data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
- data/lib/extensions/digest-sha1/ext/build.bat +1 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
- data/lib/extensions/esri/ext/build +17 -0
- data/lib/extensions/esri/ext/build.bat +29 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
- data/lib/extensions/esri/ext.yml +3 -0
- data/lib/extensions/net-http/monitor.rb +265 -0
- data/lib/extensions/net-http/net/ftp.rb +981 -0
- data/lib/extensions/net-http/thread.rb +367 -0
- data/lib/extensions/rhocgi/cgi.rb +16 -0
- data/lib/extensions/rhospec/rhospec.rb +118 -0
- data/lib/framework/base64.rb +91 -0
- data/lib/framework/builtinME.rb +13 -10
- data/lib/framework/ostruct.rb +145 -0
- data/lib/framework/res/back_btn.wm.png +0 -0
- data/lib/framework/res/blue_pushpin.wm.png +0 -0
- data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
- data/lib/framework/res/callout.wm.png +0 -0
- data/lib/framework/res/callout_link.wm.png +0 -0
- data/lib/framework/res/forward_btn.wm.png +0 -0
- data/lib/framework/res/home_btn.wm.png +0 -0
- data/lib/framework/res/options_btn.wm.png +0 -0
- data/lib/framework/res/refresh_btn.wm.png +0 -0
- data/lib/framework/rho/render.rb +5 -2
- data/lib/framework/rho/rho.rb +320 -50
- data/lib/framework/rho/rhoapplication.rb +48 -10
- data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
- data/lib/framework/rho/rhosupport.rb +15 -1
- data/lib/framework/rho/rhotabbar.rb +29 -0
- data/lib/framework/rho/rhotoolbar.rb +17 -0
- data/lib/framework/rho/rhoutils.rb +22 -6
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +4 -3
- data/lib/framework/rholang/rhomsg_en.rb +1 -0
- data/lib/framework/rholang/rhomsg_es.rb +1 -0
- data/lib/framework/rholang/rhomsg_it.rb +1 -0
- data/lib/framework/rhom/rhom.rb +31 -10
- data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
- data/lib/framework/rhom/rhom_object_factory.rb +465 -249
- data/lib/framework/rhom/rhom_source.rb +22 -7
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +83 -20
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
- data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
- data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
- data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
- data/platform/android/Rhodes/jni/src/event.cpp +9 -15
- data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
- data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
- data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
- data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
- data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
- data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
- data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
- data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
- data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
- data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
- data/platform/android/Rhodes/res/drawable/callout.png +0 -0
- data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
- data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
- data/platform/android/Rhodes/res/layout/signature.xml +24 -17
- data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
- data/platform/android/Rhodes/res/values/strings.xml +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
- data/platform/android/build/RhodesSRC_build.files +32 -23
- data/platform/android/build/android.rake +28 -11
- data/platform/android/build/androidcommon.rb +2 -0
- data/platform/android/build/librhocommon_build.files +9 -5
- data/platform/android/build/librhodes_build.files +1 -0
- data/platform/android/build/libruby_build.files +1 -0
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
- data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
- data/platform/bb/RubyVM/RubyVM.jdp +3 -0
- data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
- data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
- data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
- data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
- data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
- data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
- data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
- data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
- data/platform/bb/build/RubyVM_build.files +3 -0
- data/platform/bb/build/bb.rake +140 -62
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -0
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
- data/platform/bb/rhodes/resources/mappin.png +0 -0
- data/platform/bb/rhodes/rhodes.jdp +3 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
- data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
- data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
- data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
- data/platform/iphone/Classes/DateTime.h +4 -0
- data/platform/iphone/Classes/DateTime.m +1 -1
- data/platform/iphone/Classes/DateTimePicker.m +8 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
- data/platform/iphone/Classes/Event/Event.m +2 -2
- data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
- data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
- data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
- data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
- data/platform/iphone/Classes/NativeBar.h +34 -0
- data/platform/iphone/Classes/NativeBar.m +131 -26
- data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
- data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
- data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
- data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
- data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
- data/platform/iphone/Classes/RhoAlert.m +3 -3
- data/platform/iphone/Classes/RhoMainView.h +3 -0
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +47 -79
- data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
- data/platform/iphone/Classes/SimpleMainView.h +18 -1
- data/platform/iphone/Classes/SimpleMainView.m +180 -35
- data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
- data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
- data/platform/iphone/Classes/TabbedMainView.h +25 -3
- data/platform/iphone/Classes/TabbedMainView.m +340 -14
- 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/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
- data/platform/iphone/rbuild/iphone.rake +100 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
- data/platform/shared/SyncClient/SyncClient.cpp +29 -3
- data/platform/shared/SyncClient/SyncClient.h +2 -1
- data/platform/shared/common/IRhoClassFactory.h +3 -0
- data/platform/shared/common/IRhoCrypt.h +16 -0
- data/platform/shared/common/IRhoThreadImpl.h +1 -0
- data/platform/shared/common/RhoAppAdapter.h +2 -0
- data/platform/shared/common/RhoConf.cpp +97 -46
- data/platform/shared/common/RhoConf.h +14 -13
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMath.cpp +43 -0
- data/platform/shared/common/RhoMath.h +27 -0
- data/platform/shared/common/RhoNativeViewManager.h +27 -1
- data/platform/shared/common/RhoPort.h +11 -0
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +1 -1
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +381 -139
- data/platform/shared/common/RhodesApp.h +24 -10
- data/platform/shared/common/RhodesAppBase.cpp +72 -1
- data/platform/shared/common/RhodesAppBase.h +5 -1
- data/platform/shared/common/SplashScreen.h +4 -4
- data/platform/shared/common/ThreadQueue.cpp +44 -17
- data/platform/shared/common/ThreadQueue.h +4 -0
- data/platform/shared/common/app_build_configs.c +0 -1
- data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
- data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
- data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
- data/platform/shared/common/map/ESRIMapEngine.h +255 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
- data/platform/shared/common/map/GoogleMapEngine.h +52 -0
- data/platform/shared/common/map/MapEngine.cpp +304 -0
- data/platform/shared/common/map/MapEngine.h +214 -0
- data/platform/shared/db/DBAdapter.cpp +147 -18
- data/platform/shared/db/DBAdapter.h +38 -12
- data/platform/shared/db/DBAttrManager.cpp +4 -3
- data/platform/shared/db/DBAttrManager.h +7 -7
- data/platform/shared/db/res/db/syncdb.triggers +0 -5
- data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
- data/platform/shared/json/JSONIterator.cpp +11 -1
- data/platform/shared/json/JSONIterator.h +1 -0
- data/platform/shared/logging/RhoLogConf.cpp +29 -12
- data/platform/shared/net/CURLNetRequest.cpp +80 -25
- data/platform/shared/net/CURLNetRequest.h +6 -2
- data/platform/shared/net/HttpServer.cpp +12 -6
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/net/INetRequest.h +1 -0
- data/platform/shared/ruby/ext/alert/alert.i +5 -0
- data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
- data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
- data/platform/shared/ruby/ext/rho/extensions.c +0 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
- data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
- data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
- data/platform/shared/rubyext/System.cpp +9 -0
- data/platform/shared/rubyext/WebView.h +1 -0
- data/platform/shared/sqlite/crypto.c +907 -0
- data/platform/shared/sqlite/sqlite3.c +6 -0
- data/platform/shared/sync/SyncEngine.cpp +49 -19
- data/platform/shared/sync/SyncEngine.h +0 -1
- data/platform/shared/sync/SyncNotify.cpp +14 -5
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncSource.cpp +79 -33
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +26 -11
- data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
- data/platform/wm/build/wm.rake +6 -0
- data/platform/wm/rhodes/Alert.cpp +4 -3
- data/platform/wm/rhodes/Alert.h +1 -1
- data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
- data/platform/wm/rhodes/DateTimePicker.h +9 -1
- data/platform/wm/rhodes/MainWindow.cpp +121 -61
- data/platform/wm/rhodes/MainWindow.h +29 -4
- data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
- data/platform/wm/rhodes/MapView/Graphics.h +136 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
- data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
- data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
- data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
- data/platform/wm/rhodes/Rhodes.cpp +94 -102
- data/platform/wm/rhodes/Rhodes.rc +27 -0
- data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
- data/platform/wm/rhodes/camera/Camera.cpp +36 -15
- data/platform/wm/rhodes/camera/Camera.h +0 -4
- data/platform/wm/rhodes/resource.h +10 -2
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +38 -2
- data/platform/wm/rhodes/stdafx.h +2 -1
- data/platform/wm/rubylib/rubylib.vcproj +12 -0
- data/rakefile.rb +85 -80
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/templates/application/app/application.rb +2 -2
- data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
- data/res/generators/templates/application/public/css/android.css +1 -0
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
- data/res/generators/templates/application/rhoconfig.txt +66 -14
- data/rhodes.gemspec +3 -3
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
- data/spec/framework_spec/build.yml +1 -1
- data/spec/phone_spec/Rakefile +1 -0
- data/spec/phone_spec/app/Account/account.rb +2 -0
- data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
- data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
- data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
- data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
- data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
- data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
- data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
- data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
- data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
- data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
- data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
- data/spec/phone_spec/app/spec_runner.rb +15 -7
- data/spec/phone_spec/build.yml +2 -2
- metadata +154 -25
- data/README.textile +0 -45
- data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
- data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
- data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
- data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
@@ -0,0 +1,302 @@
|
|
1
|
+
#require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'
|
2
|
+
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes.rb'
|
3
|
+
|
4
|
+
describe "String#split with String" do
|
5
|
+
it "returns an array of substrings based on splitting on the given string" do
|
6
|
+
"mellow yellow".split("ello").should == ["m", "w y", "w"]
|
7
|
+
end
|
8
|
+
|
9
|
+
it "suppresses trailing empty fields when limit isn't given or 0" do
|
10
|
+
"1,2,,3,4,,".split(',').should == ["1", "2", "", "3", "4"]
|
11
|
+
"1,2,,3,4,,".split(',', 0).should == ["1", "2", "", "3", "4"]
|
12
|
+
" a b c\nd ".split(" ").should == ["", "a", "b", "c\nd"]
|
13
|
+
"hai".split("hai").should == []
|
14
|
+
",".split(",").should == []
|
15
|
+
",".split(",", 0).should == []
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns an array with one entry if limit is 1: the original string" do
|
19
|
+
"hai".split("hai", 1).should == ["hai"]
|
20
|
+
"x.y.z".split(".", 1).should == ["x.y.z"]
|
21
|
+
"hello world ".split(" ", 1).should == ["hello world "]
|
22
|
+
"hi!".split("", 1).should == ["hi!"]
|
23
|
+
end
|
24
|
+
|
25
|
+
it "returns at most limit fields when limit > 1" do
|
26
|
+
"hai".split("hai", 2).should == ["", ""]
|
27
|
+
|
28
|
+
"1,2,,3,4,,".split(',', 2).should == ["1", "2,,3,4,,"]
|
29
|
+
"1,2,,3,4,,".split(',', 3).should == ["1", "2", ",3,4,,"]
|
30
|
+
"1,2,,3,4,,".split(',', 4).should == ["1", "2", "", "3,4,,"]
|
31
|
+
"1,2,,3,4,,".split(',', 5).should == ["1", "2", "", "3", "4,,"]
|
32
|
+
"1,2,,3,4,,".split(',', 6).should == ["1", "2", "", "3", "4", ","]
|
33
|
+
|
34
|
+
"x".split('x', 2).should == ["", ""]
|
35
|
+
"xx".split('x', 2).should == ["", "x"]
|
36
|
+
"xx".split('x', 3).should == ["", "", ""]
|
37
|
+
"xxx".split('x', 2).should == ["", "xx"]
|
38
|
+
"xxx".split('x', 3).should == ["", "", "x"]
|
39
|
+
"xxx".split('x', 4).should == ["", "", "", ""]
|
40
|
+
end
|
41
|
+
|
42
|
+
it "doesn't suppress or limit fields when limit is negative" do
|
43
|
+
"1,2,,3,4,,".split(',', -1).should == ["1", "2", "", "3", "4", "", ""]
|
44
|
+
"1,2,,3,4,,".split(',', -5).should == ["1", "2", "", "3", "4", "", ""]
|
45
|
+
" a b c\nd ".split(" ", -1).should == ["", "a", "b", "c\nd", ""]
|
46
|
+
",".split(",", -1).should == ["", ""]
|
47
|
+
end
|
48
|
+
|
49
|
+
it "defaults to $; when string isn't given or nil" do
|
50
|
+
begin
|
51
|
+
old_fs = $;
|
52
|
+
|
53
|
+
[",", ":", "", "XY", nil].each do |fs|
|
54
|
+
$; = fs
|
55
|
+
|
56
|
+
["x,y,z,,,", "1:2:", "aXYbXYcXY", ""].each do |str|
|
57
|
+
expected = str.split(fs || " ")
|
58
|
+
|
59
|
+
str.split(nil).should == expected
|
60
|
+
str.split.should == expected
|
61
|
+
|
62
|
+
str.split(nil, -1).should == str.split(fs || " ", -1)
|
63
|
+
str.split(nil, 0).should == str.split(fs || " ", 0)
|
64
|
+
str.split(nil, 2).should == str.split(fs || " ", 2)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
ensure
|
68
|
+
$; = old_fs
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it "ignores leading and continuous whitespace when string is a single space" do
|
73
|
+
" now's the time ".split(' ').should == ["now's", "the", "time"]
|
74
|
+
#" now's the time ".split(' ', -1).should == ["now's", "the", "time", ""]
|
75
|
+
|
76
|
+
#"\t\n a\t\tb \n\r\r\nc\v\vd\v ".split(' ').should == ["a", "b", "c", "d"]
|
77
|
+
"a\x00a b".split(' ').should == ["a\x00a", "b"]
|
78
|
+
end
|
79
|
+
|
80
|
+
it "splits between characters when its argument is an empty string" do
|
81
|
+
"hi!".split("").should == ["h", "i", "!"]
|
82
|
+
#"hi!".split("", -1).should == ["h", "i", "!", ""]
|
83
|
+
"hi!".split("", 2).should == ["h", "i!"]
|
84
|
+
end
|
85
|
+
=begin
|
86
|
+
it "tries converting its pattern argument to a string via to_str" do
|
87
|
+
obj = mock('::')
|
88
|
+
obj.should_receive(:to_str).and_return("::")
|
89
|
+
|
90
|
+
"hello::world".split(obj).should == ["hello", "world"]
|
91
|
+
end
|
92
|
+
|
93
|
+
it "tries converting limit to an integer via to_int" do
|
94
|
+
obj = mock('2')
|
95
|
+
obj.should_receive(:to_int).and_return(2)
|
96
|
+
|
97
|
+
"1.2.3.4".split(".", obj).should == ["1", "2.3.4"]
|
98
|
+
end
|
99
|
+
=end
|
100
|
+
it "doesn't set $~" do
|
101
|
+
$~ = nil
|
102
|
+
"x.y.z".split(".")
|
103
|
+
$~.should == nil
|
104
|
+
end
|
105
|
+
|
106
|
+
it "returns subclass instances based on self" do
|
107
|
+
["", "x.y.z.", " x y "].each do |str|
|
108
|
+
["", ".", " "].each do |pat|
|
109
|
+
[-1, 0, 1, 2].each do |limit|
|
110
|
+
StringSpecs::MyString.new(str).split(pat, limit).each do |x|
|
111
|
+
x.class.should == StringSpecs::MyString
|
112
|
+
end
|
113
|
+
|
114
|
+
str.split(StringSpecs::MyString.new(pat), limit).each do |x|
|
115
|
+
x.class.should == String
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it "does not call constructor on created subclass instances" do
|
123
|
+
# can't call should_not_receive on an object that doesn't yet exist
|
124
|
+
# so failure here is signalled by exception, not expectation failure
|
125
|
+
|
126
|
+
s = StringSpecs::StringWithRaisingConstructor.new('silly:string')
|
127
|
+
s.split(':').first.should == 'silly'
|
128
|
+
end
|
129
|
+
=begin
|
130
|
+
it "taints the resulting strings if self is tainted" do
|
131
|
+
["", "x.y.z.", " x y "].each do |str|
|
132
|
+
["", ".", " "].each do |pat|
|
133
|
+
[-1, 0, 1, 2].each do |limit|
|
134
|
+
str.dup.taint.split(pat).each do |x|
|
135
|
+
x.tainted?.should == true
|
136
|
+
end
|
137
|
+
|
138
|
+
str.split(pat.dup.taint).each do |x|
|
139
|
+
x.tainted?.should == false
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
=end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe "String#split with Regexp" do
|
149
|
+
it "divides self on regexp matches" do
|
150
|
+
" now's the time".split(/ /).should == ["", "now's", "", "the", "time"]
|
151
|
+
" x\ny ".split(/ /).should == ["", "x\ny"]
|
152
|
+
"1, 2.34,56, 7".split(/,\s*/).should == ["1", "2.34", "56", "7"]
|
153
|
+
#"1x2X3".split(/x/i).should == ["1", "2", "3"]
|
154
|
+
end
|
155
|
+
|
156
|
+
it "treats negative limits as no limit" do
|
157
|
+
"".split(%r!/+!, -1).should == []
|
158
|
+
end
|
159
|
+
|
160
|
+
it "suppresses trailing empty fields when limit isn't given or 0" do
|
161
|
+
"1,2,,3,4,,".split(/,/).should == ["1", "2", "", "3", "4"]
|
162
|
+
"1,2,,3,4,,".split(/,/, 0).should == ["1", "2", "", "3", "4"]
|
163
|
+
" a b c\nd ".split(/\s+/).should == ["", "a", "b", "c", "d"]
|
164
|
+
"hai".split(/hai/).should == []
|
165
|
+
",".split(/,/).should == []
|
166
|
+
",".split(/,/, 0).should == []
|
167
|
+
end
|
168
|
+
|
169
|
+
it "returns an array with one entry if limit is 1: the original string" do
|
170
|
+
"hai".split(/hai/, 1).should == ["hai"]
|
171
|
+
"xAyBzC".split(/[A-Z]/, 1).should == ["xAyBzC"]
|
172
|
+
"hello world ".split(/\s+/, 1).should == ["hello world "]
|
173
|
+
"hi!".split(//, 1).should == ["hi!"]
|
174
|
+
end
|
175
|
+
|
176
|
+
it "returns at most limit fields when limit > 1" do
|
177
|
+
"hai".split(/hai/, 2).should == ["", ""]
|
178
|
+
|
179
|
+
"1,2,,3,4,,".split(/,/, 2).should == ["1", "2,,3,4,,"]
|
180
|
+
"1,2,,3,4,,".split(/,/, 3).should == ["1", "2", ",3,4,,"]
|
181
|
+
"1,2,,3,4,,".split(/,/, 4).should == ["1", "2", "", "3,4,,"]
|
182
|
+
"1,2,,3,4,,".split(/,/, 5).should == ["1", "2", "", "3", "4,,"]
|
183
|
+
"1,2,,3,4,,".split(/,/, 6).should == ["1", "2", "", "3", "4", ","]
|
184
|
+
|
185
|
+
"x".split(/x/, 2).should == ["", ""]
|
186
|
+
"xx".split(/x/, 2).should == ["", "x"]
|
187
|
+
"xx".split(/x/, 3).should == ["", "", ""]
|
188
|
+
"xxx".split(/x/, 2).should == ["", "xx"]
|
189
|
+
"xxx".split(/x/, 3).should == ["", "", "x"]
|
190
|
+
"xxx".split(/x/, 4).should == ["", "", "", ""]
|
191
|
+
end
|
192
|
+
|
193
|
+
it "doesn't suppress or limit fields when limit is negative" do
|
194
|
+
#"1,2,,3,4,,".split(/,/, -1).should == ["1", "2", "", "3", "4", "", ""]
|
195
|
+
#"1,2,,3,4,,".split(/,/, -5).should == ["1", "2", "", "3", "4", "", ""]
|
196
|
+
#" a b c\nd ".split(/\s+/, -1).should == ["", "a", "b", "c", "d", ""]
|
197
|
+
" a b c\nd".split(/\s+/, -1).should == ["", "a", "b", "c", "d"]
|
198
|
+
#",".split(/,/, -1).should == ["", ""]
|
199
|
+
end
|
200
|
+
|
201
|
+
it "defaults to $; when regexp isn't given or nil" do
|
202
|
+
begin
|
203
|
+
old_fs = $;
|
204
|
+
|
205
|
+
[/,/, /:/, //, /XY/, /./].each do |fs|
|
206
|
+
$; = fs
|
207
|
+
|
208
|
+
["x,y,z,,,", "1:2:", "aXYbXYcXY", ""].each do |str|
|
209
|
+
expected = str.split(fs)
|
210
|
+
|
211
|
+
str.split(nil).should == expected
|
212
|
+
str.split.should == expected
|
213
|
+
|
214
|
+
str.split(nil, -1).should == str.split(fs, -1)
|
215
|
+
str.split(nil, 0).should == str.split(fs, 0)
|
216
|
+
str.split(nil, 2).should == str.split(fs, 2)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
ensure
|
220
|
+
$; = old_fs
|
221
|
+
end
|
222
|
+
end
|
223
|
+
=begin
|
224
|
+
it "splits between characters when regexp matches a zero-length string" do
|
225
|
+
"hello".split(//).should == ["h", "e", "l", "l", "o"]
|
226
|
+
"hello".split(//, -1).should == ["h", "e", "l", "l", "o", ""]
|
227
|
+
"hello".split(//, 2).should == ["h", "ello"]
|
228
|
+
|
229
|
+
"hi mom".split(/\s*/).should == ["h", "i", "m", "o", "m"]
|
230
|
+
end
|
231
|
+
=end
|
232
|
+
it "includes all captures in the result array" do
|
233
|
+
"hello".split(/(el)/).should == ["h", "el", "lo"]
|
234
|
+
#"hi!".split(/()/).should == ["h", "", "i", "", "!"]
|
235
|
+
#"hi!".split(/()/, -1).should == ["h", "", "i", "", "!", "", ""]
|
236
|
+
#"hello".split(/((el))()/).should == ["h", "el", "el", "", "lo"]
|
237
|
+
"AabB".split(/([a-z])+/).should == ["A", "b", "B"]
|
238
|
+
end
|
239
|
+
|
240
|
+
it "does not include non-matching captures in the result array" do
|
241
|
+
"hello".split(/(el)|(xx)/).should == ["h", "el", "lo"]
|
242
|
+
end
|
243
|
+
|
244
|
+
# it "tries converting limit to an integer via to_int" do
|
245
|
+
# obj = mock('2')
|
246
|
+
# obj.should_receive(:to_int).and_return(2)
|
247
|
+
|
248
|
+
# "1.2.3.4".split(".", obj).should == ["1", "2.3.4"]
|
249
|
+
# end
|
250
|
+
|
251
|
+
it "returns a type error if limit can't be converted to an integer" do
|
252
|
+
lambda {"1.2.3.4".split(".", "three")}.should raise_error(TypeError)
|
253
|
+
lambda {"1.2.3.4".split(".", nil) }.should raise_error(TypeError)
|
254
|
+
end
|
255
|
+
|
256
|
+
it "doesn't set $~" do
|
257
|
+
$~ = nil
|
258
|
+
"x:y:z".split(/:/)
|
259
|
+
$~.should == nil
|
260
|
+
end
|
261
|
+
|
262
|
+
it "returns the original string if no matches are found" do
|
263
|
+
"foo".split("\n").should == ["foo"]
|
264
|
+
end
|
265
|
+
|
266
|
+
it "returns subclass instances based on self" do
|
267
|
+
["", "x:y:z:", " x y "].each do |str|
|
268
|
+
[//, /:/, /\s+/].each do |pat|
|
269
|
+
[-1, 0, 1, 2].each do |limit|
|
270
|
+
StringSpecs::MyString.new(str).split(pat, limit).each do |x|
|
271
|
+
x.class.should == StringSpecs::MyString
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
it "does not call constructor on created subclass instances" do
|
279
|
+
# can't call should_not_receive on an object that doesn't yet exist
|
280
|
+
# so failure here is signalled by exception, not expectation failure
|
281
|
+
|
282
|
+
s = StringSpecs::StringWithRaisingConstructor.new('silly:string')
|
283
|
+
s.split(/:/).first.should == 'silly'
|
284
|
+
end
|
285
|
+
=begin
|
286
|
+
it "taints the resulting strings if self is tainted" do
|
287
|
+
["", "x:y:z:", " x y "].each do |str|
|
288
|
+
[//, /:/, /\s+/].each do |pat|
|
289
|
+
[-1, 0, 1, 2].each do |limit|
|
290
|
+
str.dup.taint.split(pat).each do |x|
|
291
|
+
x.tainted?.should == true
|
292
|
+
end
|
293
|
+
|
294
|
+
str.split(pat.dup.taint).each do |x|
|
295
|
+
x.tainted?.should == false
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
end
|
301
|
+
=end
|
302
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'
|
3
|
+
#require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes.rb'
|
4
|
+
|
5
|
+
ruby_version_is '1.8.7' do
|
6
|
+
describe "String#start_with?" do
|
7
|
+
it "returns true only if beginning match" do
|
8
|
+
s = "hello"
|
9
|
+
s.start_with?('h').should be_true
|
10
|
+
s.start_with?('hel').should be_true
|
11
|
+
s.start_with?('el').should be_false
|
12
|
+
end
|
13
|
+
|
14
|
+
it "returns true only if any beginning match" do
|
15
|
+
"hello".start_with?('x', 'y', 'he', 'z').should be_true
|
16
|
+
end
|
17
|
+
|
18
|
+
# it "converts its argument using :to_str" do
|
19
|
+
# s = "hello"
|
20
|
+
# find = mock('h')
|
21
|
+
# find.should_receive(:to_str).and_return("h")
|
22
|
+
# s.start_with?(find).should be_true
|
23
|
+
# end
|
24
|
+
|
25
|
+
it "ignores arguments not convertible to string" do
|
26
|
+
"hello".start_with?().should be_false
|
27
|
+
"hello".start_with?(1).should be_false
|
28
|
+
"hello".start_with?(["h"]).should be_false
|
29
|
+
"hello".start_with?(1, nil, "h").should be_true
|
30
|
+
end
|
31
|
+
|
32
|
+
# it "uses only the needed arguments" do
|
33
|
+
# find = mock('h')
|
34
|
+
# find.should_not_receive(:to_str)
|
35
|
+
# "hello".start_with?("h",find).should be_true
|
36
|
+
# end
|
37
|
+
|
38
|
+
it "works for multibyte strings" do
|
39
|
+
old_kcode = $KCODE
|
40
|
+
begin
|
41
|
+
$KCODE = "UTF-8"
|
42
|
+
"céréale".start_with?("cér").should be_true
|
43
|
+
ensure
|
44
|
+
$KCODE = old_kcode
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
File without changes
|
@@ -44,6 +44,10 @@ def getCustomer_str
|
|
44
44
|
'Customer'
|
45
45
|
end
|
46
46
|
|
47
|
+
def getTestDB
|
48
|
+
::Rho::RHO.get_db_partitions['user']
|
49
|
+
end
|
50
|
+
|
47
51
|
SYNC_SERVER_URL = 'http://rhodes-store-server.heroku.com/application'
|
48
52
|
#SYNC_SERVER_URL = 'http://localhost:9292/application'
|
49
53
|
|
@@ -56,6 +60,8 @@ describe "SyncEngine_test" do
|
|
56
60
|
|
57
61
|
SyncEngine.set_syncserver(SYNC_SERVER_URL)
|
58
62
|
|
63
|
+
Rho::RHO.load_all_sources()
|
64
|
+
|
59
65
|
@save_sync_types = ::Rho::RHO.get_user_db().select_from_table('sources','name, sync_type')
|
60
66
|
::Rho::RHO.get_user_db().update_into_table('sources',{'sync_type'=>'none'})
|
61
67
|
::Rho::RHO.get_user_db().update_into_table('sources',{'sync_type'=>'incremental'}, {'name'=>getProduct_str})
|
@@ -107,6 +113,7 @@ describe "SyncEngine_test" do
|
|
107
113
|
#uniq_sources.should == Rho::RhoConfig::sources.values
|
108
114
|
end
|
109
115
|
=end
|
116
|
+
|
110
117
|
it "should login" do
|
111
118
|
|
112
119
|
res = ::Rho::RhoSupport::parse_query_parameters SyncEngine.login('lars', 'larspass', "/app/Settings/login_callback")
|
@@ -173,6 +180,10 @@ describe "SyncEngine_test" do
|
|
173
180
|
SyncEngine.logged_in.should == 1
|
174
181
|
|
175
182
|
item = getProduct.create({:name => 'Test'})
|
183
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
184
|
+
records.length.should == 1
|
185
|
+
records[0]['attrib'].should == 'object'
|
186
|
+
|
176
187
|
item2 = getProduct.find(item.object)
|
177
188
|
item2.vars.should == item.vars
|
178
189
|
|
@@ -320,7 +331,25 @@ describe "SyncEngine_test" do
|
|
320
331
|
dbRes[0]['client_id'].length().should > 0
|
321
332
|
end
|
322
333
|
end
|
323
|
-
|
334
|
+
|
335
|
+
it "should reset data after login with different user" do
|
336
|
+
SyncEngine.logged_in.should == 1
|
337
|
+
|
338
|
+
item = getProduct.create({:name => 'Test1'})
|
339
|
+
item2 = getProduct.find(item.object)
|
340
|
+
item2.vars.should == item.vars
|
341
|
+
|
342
|
+
SyncEngine.logout
|
343
|
+
SyncEngine.logged_in.should == 0
|
344
|
+
|
345
|
+
res = ::Rho::RhoSupport::parse_query_parameters SyncEngine.login('lars1', 'larspass', "/app/Settings/login_callback")
|
346
|
+
res['error_code'].to_i.should == ::Rho::RhoError::ERR_NONE
|
347
|
+
SyncEngine.logged_in.should == 1
|
348
|
+
|
349
|
+
item2 = getProduct.find(item.object)
|
350
|
+
item2.should be_nil
|
351
|
+
end
|
352
|
+
|
324
353
|
it "should logout" do
|
325
354
|
SyncEngine.logout()
|
326
355
|
|
@@ -3,10 +3,18 @@ require 'rhospec'
|
|
3
3
|
class SpecRunner < MSpecScript
|
4
4
|
def initialize
|
5
5
|
config[:files] = []
|
6
|
+
|
7
|
+
config[:files] << "spec/string/end_with_spec"
|
8
|
+
config[:files] << "spec/string/start_with_spec"
|
9
|
+
config[:files] << "spec/string/replace_spec"
|
10
|
+
config[:files] << "spec/string/split_spec"
|
11
|
+
config[:files] << "spec/string/strip_spec"
|
12
|
+
config[:files] << "spec/string/rstrip_spec"
|
13
|
+
config[:files] << "spec/string/lstrip_spec"
|
14
|
+
config[:files] << "spec/string/slice_spec"
|
15
|
+
config[:files] << "spec/array/pack_spec"
|
6
16
|
|
7
|
-
config[:files] << "spec/
|
8
|
-
config[:files] << "spec/rstrip_spec"
|
9
|
-
config[:files] << "spec/lstrip_spec"
|
17
|
+
config[:files] << "spec/rho_spec"
|
10
18
|
|
11
19
|
config[:files] << "spec/asynchttp_spec"
|
12
20
|
config[:files] << "spec/crypt_spec"
|
@@ -15,8 +23,7 @@ class SpecRunner < MSpecScript
|
|
15
23
|
config[:files] << "spec/rhofile_spec"
|
16
24
|
config[:files] << "spec/date_spec"
|
17
25
|
config[:files] << "spec/bsearch_spec"
|
18
|
-
|
19
|
-
config[:files] << "spec/array_pack_spec"
|
26
|
+
|
20
27
|
config[:files] << "spec/rho_controller_spec"
|
21
28
|
|
22
29
|
config[:files] << [ "spec/rhom_object_spec",
|
@@ -24,12 +31,13 @@ class SpecRunner < MSpecScript
|
|
24
31
|
{:schema_model=>false, :sync_model=>true}, {:schema_model=>false, :sync_model=>false} ] ]
|
25
32
|
|
26
33
|
config[:files] << "spec/contacts_spec" unless System.get_property('device_name') == 'Win32'
|
34
|
+
|
27
35
|
# Disable events specs on Android because emulator doesn't contain Calendar provider
|
28
36
|
config[:files] << "spec/events_spec" unless System.get_property('device_name') == 'Win32' or (System.get_property('platform') == 'ANDROID' and System.get_property('is_emulator'))
|
29
|
-
|
37
|
+
|
30
38
|
config[:files] << "spec/barcode_spec" unless System.get_property('device_name') == 'Win32'
|
31
39
|
config[:files] << "spec/mapview_spec" unless System.get_property('platform') == 'WINDOWS'
|
32
|
-
config[:files] << "spec/nativebar_spec" if System.get_property('platform')
|
40
|
+
config[:files] << "spec/nativebar_spec" if System.get_property('platform') != 'Blackberry'
|
33
41
|
config[:files] << "spec/navbar_spec" if System.get_property('platform') == 'APPLE' || System.get_property('platform') == 'ANDROID'
|
34
42
|
|
35
43
|
config[:files] << "spec/xruby_spec" if defined? RHO_ME
|
data/spec/phone_spec/build.yml
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
name: phone_spec
|
3
3
|
bbver: 5.0
|
4
4
|
sdk: /Users/crystax/work/rhomobile/rhodes
|
5
|
-
applog: rholog.txt
|
5
|
+
#applog: rholog.txt
|
6
6
|
version: 1.0.0
|
7
7
|
vendor: rhomobile
|
8
8
|
sdkversion: 1.4
|
9
9
|
wmsdk: "Windows Mobile 6 Professional SDK (ARMV4I)"
|
10
10
|
iphone:
|
11
|
-
sdk: iphonesimulator4.
|
11
|
+
sdk: iphonesimulator4.2
|
12
12
|
entitlements: ""
|
13
13
|
codesignidentity: ""
|
14
14
|
configuration: Release
|