rhodes 3.4.2 → 3.5.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/Rakefile +61 -9
- data/doc/build.txt +147 -38
- data/doc/configuration.txt +49 -33
- data/doc/connect-to-web-services.txt +32 -32
- data/doc/contributing.txt +1 -1
- data/doc/device-caps.txt +62 -311
- data/doc/extensions.txt +104 -5
- data/doc/install.txt +17 -61
- data/doc/linea.txt +11 -11
- data/doc/nfc.txt +3 -3
- data/doc/release.txt +4 -4
- data/doc/rhom.txt +7 -7
- data/doc/rhostudio-test-plan.txt +12 -12
- data/doc/simulator.txt +32 -19
- data/doc/syncengine-ajax-api.txt +1 -1
- data/doc/synchronization.txt +8 -2
- data/doc/test-log-debug.txt +34 -3
- data/doc/ui.txt +8 -3
- data/installer/icon.ico +0 -0
- data/lib/build/jake.rb +27 -6
- data/lib/extensions/audiocapture/audiocapture.rb +43 -0
- data/lib/extensions/audiocapture/ext.yml +5 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/AndroidManifest.xml +10 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/Rakefile +77 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/ext_build.files +2 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/jni/src/audiocapture.cpp +189 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/src/com/audiocapture/Audiocapture.java +236 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/android/src/com/audiocapture/ExtAudioRecorder.java +573 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/Audiocapture.files +1 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/Rakefile +97 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/audiocapture.jdp +48 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/src/com/audiocapture/Audiocapture.java +118 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Audiocapture.xcodeproj/project.pbxproj +314 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Audiocapture_Prefix.pch +7 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Classes/audioCapture.h +51 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Classes/audioCapture.m +418 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Rakefile +79 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.sln +44 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.vcproj +647 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.vsprops +15 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Rakefile +62 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/src/audiocapture_wm.cpp +40 -0
- data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/src/audiocapture_wm.h +2 -0
- data/lib/extensions/audiocapture/ext/audiocapture/shared/ruby/audiocapture.i +29 -0
- data/lib/extensions/audiocapture/ext/audiocapture/shared/ruby/audiocapture_wrap.c +2310 -0
- data/lib/extensions/audiocapture/ext/audiocapture/shared/src/audiocapture.c +26 -0
- data/lib/extensions/audiocapture/ext/build +17 -0
- data/lib/extensions/audiocapture/ext/build.bat +36 -0
- data/lib/extensions/barcode/ext.yml +5 -3
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +87 -87
- data/lib/extensions/digest-md5/ext/build +1 -1
- data/lib/extensions/digest-sha1/ext/build +1 -1
- data/lib/extensions/digest-sha2/ext/build +1 -1
- data/lib/extensions/digest/ext/build +1 -1
- data/lib/extensions/fcntl/ext/fcntl.c +5 -5
- data/lib/extensions/gcm-push/ext.yml +8 -0
- data/lib/extensions/gcm-push/ext/android/AndroidManifest.rb +5 -0
- data/lib/extensions/gcm-push/ext/android/ApplicationManifestAdds.erb +8 -0
- data/lib/extensions/gcm-push/ext/android/Rakefile +66 -0
- data/lib/extensions/gcm-push/ext/android/ext_build.files +3 -0
- data/lib/extensions/gcm-push/ext/android/jni/src/com_rhomobile_rhodes_gcm_GCMRhoListener.h +21 -0
- data/lib/extensions/gcm-push/ext/android/jni/src/gcmpushclient.cpp +173 -0
- data/lib/extensions/gcm-push/ext/android/jni/src/gcmpushclient.h +62 -0
- data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMBroadcastReceiver.java +40 -0
- data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMFacade.java +55 -0
- data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMIntentService.java +60 -0
- data/lib/extensions/gcm-push/ext/build +12 -0
- data/lib/extensions/gcm-push/ext/build.bat +8 -0
- data/lib/extensions/net-http/net/http.rb +153 -119
- data/lib/extensions/net-http/net/https.rb +4 -38
- data/lib/extensions/nfc/ext.yml +6 -4
- data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +2 -2
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +0 -1
- data/lib/extensions/openssl/openssl/ssl-internal.rb +3 -1
- data/lib/extensions/rawsensors/ext.yml +4 -0
- data/lib/extensions/rawsensors/ext/build +17 -0
- data/lib/extensions/rawsensors/ext/build.bat +36 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/android/Rakefile +77 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/android/ext_build.files +1 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/android/jni/src/rawsensors.cpp +180 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/android/src/com/rawsensors/Rawsensors.java +355 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/Rakefile +97 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/Rawsensors.files +1 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/rawsensors.jdp +48 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/src/com/rawsensors/Rawsensors.java +118 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h +66 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.m +351 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rakefile +79 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rawsensors.xcodeproj/project.pbxproj +316 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rawsensors_Prefix.pch +7 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rakefile +62 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.sln +44 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.vcproj +647 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.vsprops +15 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/src/rawsensors_wm.cpp +40 -0
- data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/src/rawsensors_wm.h +2 -0
- data/lib/extensions/rawsensors/ext/rawsensors/shared/ruby/rawsensors.i +22 -0
- data/lib/extensions/rawsensors/ext/rawsensors/shared/ruby/rawsensors_wrap.c +2308 -0
- data/lib/extensions/rawsensors/ext/rawsensors/shared/src/rawsensors.c +25 -0
- data/lib/extensions/rawsensors/rawsensors.rb +36 -0
- data/lib/framework/autocomplete/AddressBar.rb +19 -0
- data/lib/framework/autocomplete/Alarm.rb +23 -0
- data/lib/framework/autocomplete/Alert.rb +19 -0
- data/lib/framework/autocomplete/AppApplication.rb +17 -0
- data/lib/framework/autocomplete/AppSwitcher.rb +13 -0
- data/lib/framework/autocomplete/Application.rb +23 -0
- data/lib/framework/autocomplete/AudioCapture.rb +31 -0
- data/lib/framework/autocomplete/BackButton.rb +25 -0
- data/lib/framework/autocomplete/Backlight.rb +21 -0
- data/lib/framework/autocomplete/Barcode.rb +29 -0
- data/lib/framework/autocomplete/BasicSocket.rb +87 -0
- data/lib/framework/autocomplete/Battery.rb +33 -0
- data/lib/framework/autocomplete/BottomCommandArea.rb +19 -0
- data/lib/framework/autocomplete/BrowserHelper.rb +19 -0
- data/lib/framework/autocomplete/Bsearch.rb +11 -0
- data/lib/framework/autocomplete/Camera.rb +17 -0
- data/lib/framework/autocomplete/CardReader.rb +29 -0
- data/lib/framework/autocomplete/Comm.rb +45 -0
- data/lib/framework/autocomplete/Cradle.rb +15 -0
- data/lib/framework/autocomplete/Date.rb +50 -0
- data/lib/framework/autocomplete/DateTime.rb +24 -0
- data/lib/framework/autocomplete/DateTimePicker.rb +15 -0
- data/lib/framework/autocomplete/Device.rb +19 -0
- data/lib/framework/autocomplete/Digest.rb +28 -0
- data/lib/framework/autocomplete/Dir.rb +63 -0
- data/lib/framework/autocomplete/Eink.rb +19 -0
- data/lib/framework/autocomplete/EmmlProfile.rb +19 -0
- data/lib/framework/autocomplete/File.rb +301 -0
- data/lib/framework/autocomplete/FileTransfer.rb +27 -0
- data/lib/framework/autocomplete/ForwardButton.rb +25 -0
- data/lib/framework/autocomplete/GeneratorController.rb +15 -0
- data/lib/framework/autocomplete/GeoLocation.rb +27 -0
- data/lib/framework/autocomplete/Gesture.rb +71 -0
- data/lib/framework/autocomplete/GoButton.rb +25 -0
- data/lib/framework/autocomplete/HashWithIndifferentAccess.rb +51 -0
- data/lib/framework/autocomplete/History.rb +11 -0
- data/lib/framework/autocomplete/HomeButton.rb +25 -0
- data/lib/framework/autocomplete/Hourglass.rb +17 -0
- data/lib/framework/autocomplete/IPSocket.rb +65 -0
- data/lib/framework/autocomplete/Imager.rb +53 -0
- data/lib/framework/autocomplete/IoAnalog.rb +73 -0
- data/lib/framework/autocomplete/IoDigital.rb +93 -0
- data/lib/framework/autocomplete/IoSystem.rb +21 -0
- data/lib/framework/autocomplete/JSON.rb +142 -0
- data/lib/framework/autocomplete/KeyCapture.rb +25 -0
- data/lib/framework/autocomplete/KeyState.rb +23 -0
- data/lib/framework/autocomplete/Keylight.rb +17 -0
- data/lib/framework/autocomplete/Lightsensor.rb +19 -0
- data/lib/framework/autocomplete/LocalizationSimplified.rb +33 -0
- data/lib/framework/autocomplete/MapView.rb +23 -0
- data/lib/framework/autocomplete/MediaPlayer.rb +19 -0
- data/lib/framework/autocomplete/Memory.rb +17 -0
- data/lib/framework/autocomplete/MinimizeButton.rb +25 -0
- data/lib/framework/autocomplete/NativeBar.rb +31 -0
- data/lib/framework/autocomplete/NavBar.rb +15 -0
- data/lib/framework/autocomplete/Network.rb +31 -0
- data/lib/framework/autocomplete/Notification.rb +35 -0
- data/lib/framework/autocomplete/OpenSSL.rb +440 -0
- data/lib/framework/autocomplete/Phonebook.rb +39 -0
- data/lib/framework/autocomplete/PowerOn.rb +13 -0
- data/lib/framework/autocomplete/Push.rb +27 -0
- data/lib/framework/autocomplete/QuitButton.rb +25 -0
- data/lib/framework/autocomplete/RHO_APPS_DIR.rb +8 -0
- data/lib/framework/autocomplete/RHO_ERB_EXT.rb +8 -0
- data/lib/framework/autocomplete/RHO_FRAMEWORK.rb +0 -0
- data/lib/framework/autocomplete/RHO_RB_EXT.rb +8 -0
- data/lib/framework/autocomplete/RawSensors.rb +53 -0
- data/lib/framework/autocomplete/Reboot.rb +13 -0
- data/lib/framework/autocomplete/Registry.rb +25 -0
- data/lib/framework/autocomplete/ReloadButton.rb +25 -0
- data/lib/framework/autocomplete/Rfid.rb +173 -0
- data/lib/framework/autocomplete/Rho.rb +496 -0
- data/lib/framework/autocomplete/RhoBluetooth.rb +41 -0
- data/lib/framework/autocomplete/RhoConf.rb +23 -0
- data/lib/framework/autocomplete/RhoElementsExt.rb +11 -0
- data/lib/framework/autocomplete/RhoLog.rb +13 -0
- data/lib/framework/autocomplete/RhoProfiler.rb +21 -0
- data/lib/framework/autocomplete/RhoStdout.rb +19 -0
- data/lib/framework/autocomplete/Rhodes.rb +13 -0
- data/lib/framework/autocomplete/RhodesNativeViewManager.rb +15 -0
- data/lib/framework/autocomplete/Rhom.rb +198 -0
- data/lib/framework/autocomplete/Rsm.rb +135 -0
- data/lib/framework/autocomplete/SQLite3.rb +36 -0
- data/lib/framework/autocomplete/SWIG.rb +24 -0
- data/lib/framework/autocomplete/ScanError.rb +9 -0
- data/lib/framework/autocomplete/Scanner.rb +379 -0
- data/lib/framework/autocomplete/ScreenOrientation.rb +23 -0
- data/lib/framework/autocomplete/SignatureCapture.rb +47 -0
- data/lib/framework/autocomplete/SignatureTool.rb +11 -0
- data/lib/framework/autocomplete/Sip.rb +19 -0
- data/lib/framework/autocomplete/SipButton.rb +25 -0
- data/lib/framework/autocomplete/Sntp.rb +13 -0
- data/lib/framework/autocomplete/Socket.rb +356 -0
- data/lib/framework/autocomplete/SocketError.rb +9 -0
- data/lib/framework/autocomplete/StopButton.rb +25 -0
- data/lib/framework/autocomplete/StringIO.rb +139 -0
- data/lib/framework/autocomplete/StringScanner.rb +102 -0
- data/lib/framework/autocomplete/Stylus.rb +15 -0
- data/lib/framework/autocomplete/SyncEngine.rb +77 -0
- data/lib/framework/autocomplete/System.rb +79 -0
- data/lib/framework/autocomplete/SystemTime.rb +17 -0
- data/lib/framework/autocomplete/TCPServer.rb +65 -0
- data/lib/framework/autocomplete/TCPSocket.rb +59 -0
- data/lib/framework/autocomplete/Telemetry.rb +23 -0
- data/lib/framework/autocomplete/Thread.rb +85 -0
- data/lib/framework/autocomplete/Time.rb +167 -0
- data/lib/framework/autocomplete/Timer.rb +19 -0
- data/lib/framework/autocomplete/TopCommandArea.rb +19 -0
- data/lib/framework/autocomplete/UDPSocket.rb +65 -0
- data/lib/framework/autocomplete/VideoCapture.rb +29 -0
- data/lib/framework/autocomplete/Volume.rb +13 -0
- data/lib/framework/autocomplete/Wake.rb +15 -0
- data/lib/framework/autocomplete/WebView.rb +31 -0
- data/lib/framework/autocomplete/Wlan.rb +87 -0
- data/lib/framework/autocomplete/Zoom.rb +15 -0
- data/lib/framework/autocomplete/ZoomInPageButton.rb +25 -0
- data/lib/framework/autocomplete/ZoomOutPageButton.rb +25 -0
- data/lib/framework/autocomplete/ZoomTextButton.rb +25 -0
- data/lib/framework/rho/render.rb +15 -4
- data/lib/framework/rho/rho.rb +17 -8
- data/lib/framework/rho/rhoapplication.rb +25 -3
- data/lib/framework/rho/rhocontact.rb +13 -0
- data/lib/framework/rho/rhoevent.rb +15 -0
- data/lib/framework/rho/rhonativeviewmanager.rb +3 -3
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom.rb +5 -0
- data/lib/framework/rhomotoapi.rb +2 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +4 -3
- data/platform/android/Rhodes/AndroidManifest.xml.erb +7 -7
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +22 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +1 -9
- data/platform/android/Rhodes/jni/src/callbacks.cpp +2 -0
- data/platform/android/Rhodes/jni/src/camera.cpp +5 -0
- data/platform/android/Rhodes/jni/src/event.cpp +10 -0
- data/platform/android/Rhodes/jni/src/geolocation.cpp +10 -0
- data/platform/android/Rhodes/jni/src/logger.cpp +3 -1
- data/platform/android/Rhodes/jni/src/phonebook.cpp +11 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +1 -1
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +41 -25
- data/platform/android/Rhodes/jni/src/signature.cpp +7 -6
- data/platform/android/Rhodes/jni/src/webview.cpp +29 -0
- data/platform/android/Rhodes/project.properties +1 -1
- data/platform/android/Rhodes/res/drawable/icon.png +0 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ConnectionChangeReceiver.java +28 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushContract.java +102 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +20 -56
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +9 -124
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +114 -126
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +3 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +31 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +3 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProvider.java +19 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProviderFroyo.java +5 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProviderICS.java +22 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +32 -22
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +5 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoListener.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +11 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/{webview → extmanager}/IRhoWebView.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +605 -492
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +9 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +43 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +82 -64
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +28 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +4 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality12.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality13.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality14.java +12 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +10 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +3 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/RhoSocketImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +43 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebChromeClient.java +5 -0
- data/platform/android/build/RhodesSRC_build.files +10 -4
- data/platform/android/build/android.rake +46 -193
- data/platform/android/build/android_tools.rb +181 -13
- data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +3 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +4 -2
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -0
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +6 -0
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +13 -8
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +103 -1
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +18 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +9 -2
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +16 -11
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +25 -3
- data/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +122 -32
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +44 -14
- data/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java +3 -2
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +340 -88
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +62 -15
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/AttrReader.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyFixnum.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyHash.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +19 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyBasic.java +9 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyBinding.java +4 -4
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyModule.java +13 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyObject.java +16 -1
- data/platform/bb/build/bb.rake +3 -1
- data/platform/bb/build/rhodes_build.files +0 -1
- data/platform/bb/rhodes/platform/4.7/com/rho/rubyext/SignatureCapture.java +13 -18
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +13 -3
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +1 -1
- data/platform/bb/rhodes/platform/common/com/rho/rubyext/SignatureCapture.java +13 -18
- data/platform/bb/rhodes/resources/icon.png +0 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +10 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +13 -3
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +5 -0
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +1 -1
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +6 -1
- data/platform/bb/rhodes/src/com/rho/file/Jsr75RAFileImpl.java +6 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +38 -9
- data/platform/bb/rhodes/src/com/rho/rubyext/SignatureCapture.java +13 -18
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +16 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +0 -20
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +1 -10
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +40 -35
- data/platform/iphone/Classes/AppManager/AppManager.h +1 -1
- data/platform/iphone/Classes/AppManager/AppManager.m +46 -29
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +9 -0
- data/platform/iphone/Classes/Event/Event.h +6 -1
- data/platform/iphone/Classes/Event/Event.m +67 -1
- data/platform/iphone/Classes/GeoLocation/LocationController.h +2 -1
- data/platform/iphone/Classes/GeoLocation/LocationController.m +17 -1
- data/platform/iphone/Classes/NetworkStatusMonitor.h +17 -0
- data/platform/iphone/Classes/NetworkStatusMonitor.mm +58 -0
- data/platform/iphone/Classes/Phonebook/phonebook.h +6 -0
- data/platform/iphone/Classes/Phonebook/phonebook.m +62 -6
- data/platform/iphone/Classes/Reachability.h +31 -0
- data/platform/iphone/Classes/Reachability.m +223 -0
- data/platform/iphone/Classes/RhoMainView.h +1 -0
- data/platform/iphone/Classes/RhoViewController.m +16 -0
- data/platform/iphone/Classes/Rhodes.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +89 -10
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +4 -7
- data/platform/iphone/Classes/SimpleMainView.m +16 -0
- data/platform/iphone/Classes/SplashViewController.m +11 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +6 -0
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +5 -0
- data/platform/iphone/Classes/TabbedMainView.m +4 -0
- data/platform/iphone/Classes/WebView.m +14 -0
- data/platform/iphone/Info.plist +1 -6
- data/platform/iphone/iTunesArtwork.jpg +0 -0
- data/platform/iphone/icon.png +0 -0
- data/platform/iphone/icon114.png +0 -0
- data/platform/iphone/icon57.png +0 -0
- data/platform/iphone/icon72.png +0 -0
- data/platform/iphone/rbuild/iphone.rake +8 -11
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +20 -4
- data/platform/osx/Rhodes Launcher/rhorunner.app/icon.png +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/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/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/rho.icns +0 -0
- data/platform/shared/common/ExtManager.h +8 -0
- data/platform/shared/common/RhoDefs.h +3 -2
- data/platform/shared/common/RhoFile.cpp +14 -1
- data/platform/shared/common/RhoMutexLock.h +4 -0
- data/platform/shared/common/RhoPort.h +5 -1
- data/platform/shared/common/RhoStd.h +12 -0
- data/platform/shared/common/RhoThread.cpp +1 -2
- data/platform/shared/common/RhoTime.h +4 -0
- data/platform/shared/common/RhodesApp.cpp +189 -65
- data/platform/shared/common/RhodesApp.h +60 -7
- data/platform/shared/common/RhodesAppBase.cpp +2 -8
- data/platform/shared/common/RhodesAppBase.h +1 -0
- data/platform/shared/common/ThreadQueue.cpp +2 -2
- data/platform/shared/common/app_build_configs.c +3 -1
- data/platform/shared/common/map/MapEngine.cpp +39 -3
- data/platform/shared/common/push/IRhoPushClient.h +3 -3
- data/platform/shared/common/push/RhoPushManager.cpp +31 -53
- data/platform/shared/common/push/RhoPushManager.h +12 -26
- data/platform/shared/curl/lib/curl_config.h +1 -1
- data/platform/shared/json/RJSONTokener.c +3 -1
- data/platform/shared/json/config.h +4 -4
- data/platform/shared/json/json_tokener.c +1 -1
- data/platform/shared/logging/RhoLog.cpp +5 -5
- data/platform/shared/logging/RhoLogConf.cpp +4 -6
- data/platform/shared/logging/RhoLogConf.h +2 -2
- data/platform/shared/logging/RhoLogSink.cpp +2 -0
- data/platform/shared/net/HttpServer.cpp +54 -7
- data/platform/shared/net/HttpServer.h +2 -0
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +22 -0
- data/platform/shared/qt/rhodes/QtMainWindow.h +1 -0
- data/platform/shared/qt/rhodes/impl/CalendarImpl.cpp +4 -0
- data/platform/shared/qt/rhodes/impl/CameraImpl.cpp +4 -0
- data/platform/shared/qt/rhodes/impl/GeoLocationImpl.cpp +6 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +7 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +2 -0
- data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +4 -0
- data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +5 -0
- data/platform/shared/qt/rhodes/impl/WebViewImpl.cpp +12 -0
- data/platform/shared/qt/rhodes/main.cpp +0 -7
- data/platform/shared/qt/rhodes/resources/rho.icns +0 -0
- data/platform/shared/qt/rhodes/resources/rho.ico +0 -0
- data/platform/shared/qt/rhodes/resources/rho.png +0 -0
- data/platform/shared/ruby/encoding.c +4 -0
- data/platform/shared/ruby/ext/calendar/calendar.i +3 -0
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +19 -0
- data/platform/shared/ruby/ext/camera/camera.i +2 -0
- data/platform/shared/ruby/ext/camera/camera_wrap.c +43 -2
- data/platform/shared/ruby/ext/geolocation/geolocation.i +4 -0
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +24 -4
- data/platform/shared/ruby/ext/phonebook/phonebook.i +4 -0
- data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +44 -0
- data/platform/shared/ruby/ext/rho/extensions.c +0 -2
- data/platform/shared/ruby/ext/rho/rhoruby.c +2 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +8 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +1 -1
- data/platform/shared/ruby/ext/syncengine/syncengine.i +6 -2
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +19 -6
- data/platform/shared/ruby/ext/system/system.i +22 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +158 -86
- data/platform/shared/ruby/ext/webview/webview.i +13 -8
- data/platform/shared/ruby/ext/webview/webview_wrap.c +88 -2
- data/platform/shared/ruby/include/ruby/win32.h +3 -1
- data/platform/shared/ruby/iphone/ruby/config.h +3 -3
- data/platform/shared/ruby/missing/hypot.c +4 -0
- data/platform/shared/ruby/random.c +6 -2
- data/platform/shared/ruby/thread_win32.c +8 -3
- data/platform/shared/ruby/win32/ruby/config.h +0 -3
- data/platform/shared/ruby/win32/win32.c +4 -0
- data/platform/shared/ruby/wp8/assert.c +12 -0
- data/platform/shared/ruby/wp8/assert.h +18 -0
- data/platform/shared/ruby/wp8/errno.c +11 -0
- data/platform/shared/ruby/wp8/errno.h +59 -0
- data/platform/shared/ruby/wp8/missing_wp8.h +74 -0
- data/platform/shared/ruby/wp8/signal.h +71 -0
- data/platform/shared/ruby/wp8/signal_wp8.c +26 -0
- data/platform/shared/ruby/wp8/stdio.c +36 -0
- data/platform/shared/ruby/wp8/stdlib.c +61 -0
- data/platform/shared/ruby/wp8/string_wp8.c +89 -0
- data/platform/shared/ruby/wp8/sys/stat.c +183 -0
- data/platform/shared/ruby/wp8/sys/stat.h +70 -0
- data/platform/shared/ruby/wp8/sys/timeb.c +31 -0
- data/platform/shared/ruby/wp8/sys/timeb.h +27 -0
- data/platform/shared/ruby/wp8/sys/types.h +62 -0
- data/platform/shared/ruby/wp8/sys/utime.c +44 -0
- data/platform/shared/ruby/wp8/sys/utime.h +27 -0
- data/platform/shared/ruby/wp8/time_wp8.c +256 -0
- data/platform/shared/ruby/wp8/varargs.h +34 -0
- data/platform/shared/ruby/wp8/win32/win32.c +5783 -0
- data/platform/shared/ruby/wp8/winsock_wp8.c +26 -0
- data/platform/shared/ruby/wp8/winsock_wp8.h +23 -0
- data/platform/shared/ruby/wp8/wp8.c +516 -0
- data/platform/shared/ruby/wp8/wp8.h +274 -0
- data/platform/shared/ruby/wp8/wp8main.c +18 -0
- data/platform/shared/rubyext/GeoLocation.cpp +1 -1
- data/platform/shared/rubyext/System.cpp +18 -4
- data/platform/shared/rubyext/ZipFiles.cpp +1 -1
- data/platform/shared/sync/ClientRegister.cpp +113 -23
- data/platform/shared/sync/ClientRegister.h +27 -16
- data/platform/shared/sync/ILoginListener.h +44 -0
- data/platform/shared/sync/SyncEngine.cpp +50 -24
- data/platform/shared/sync/SyncEngine.h +11 -5
- data/platform/shared/sync/SyncSource.cpp +87 -61
- data/platform/shared/sync/SyncSource.h +6 -3
- data/platform/shared/sync/SyncThread.cpp +8 -15
- data/platform/shared/sync/SyncThread.h +13 -7
- data/platform/shared/unzip/unzip.cpp +1 -1
- data/platform/shared/unzip/zip.h +8 -1
- data/platform/shared/xruby/src/com/xruby/runtime/builtin/AttrReader.java +13 -0
- data/platform/shared/xruby/src/com/xruby/runtime/builtin/RubyFixnum.java +3 -1
- data/platform/shared/xruby/src/com/xruby/runtime/lang/MethodBlockBase.java +9 -0
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyBasic.java +9 -0
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyBinding.java +17 -0
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyMethod.java +22 -2
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyModule.java +25 -0
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyObject.java +21 -0
- data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyValue.java +8 -0
- data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +6 -0
- data/platform/win32/RhoSimulator/Microsoft.VC90.CRT.manifest +12 -5
- data/platform/win32/RhoSimulator/Microsoft.VC90.OpenMP.manifest +12 -5
- 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/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/vcomp90.dll +0 -0
- data/platform/wm/build/wm.rake +67 -22
- data/platform/wm/rhodes.sln +485 -493
- data/platform/wm/rhodes/IEBrowserEngine.cpp +2 -6
- data/platform/wm/rhodes/MainWindow.cpp +86 -35
- data/platform/wm/rhodes/MainWindow.h +33 -0
- data/platform/wm/rhodes/Rhodes.cpp +288 -215
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +22 -17
- data/platform/wm/rhodes/bluetooth/Bluetooth.h +3 -3
- data/platform/wm/rhodes/camera/Camera.cpp +4 -0
- data/platform/wm/rhodes/camera/Camera.h +1 -0
- data/platform/wm/rhodes/phonebook/phonebook.cpp +9 -0
- data/platform/wm/rhodes/phonebook/phonebook.h +2 -0
- data/platform/wm/rhodes/resources/icon.ico +0 -0
- data/platform/wm/rhodes/rho/common/ExtManager.cpp +5 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +1 -11
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +5 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +21 -2
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +12 -0
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +9 -0
- data/platform/wm/rhodes/rhodes.vcproj +60 -60
- data/platform/wm/rhodes/simulator/MainWindowQt.cpp +91 -6
- data/platform/wm/rhodes/simulator/MainWindowQt.h +6 -0
- data/platform/wm/rhoelements.sln +624 -623
- data/platform/wm/tcmalloc/tcmalloc.vcproj +1230 -1070
- data/platform/wp7/RhoRubyLib/rubyext/RhoCamera.cs +6 -3
- data/platform/wp7/rhodes/Properties/WMAppManifest.xml +5 -0
- data/platform/wp7/rhodes/icon.png +0 -0
- data/platform/wp8/RhoAppRunner/Program.cs +99 -0
- data/platform/wp8/RhoAppRunner/Properties/AssemblyInfo.cs +36 -0
- data/platform/wp8/RhoAppRunner/RhoAppRunner.csproj +69 -0
- data/platform/wp8/build/wp.rake +486 -0
- data/platform/wp8/rhodes.sln +154 -0
- data/platform/wp8/rhodes/App.xaml +20 -0
- data/platform/wp8/rhodes/App.xaml.cs +189 -0
- data/platform/wp8/rhodes/Assets/ApplicationIcon.png +0 -0
- data/platform/wp8/rhodes/Assets/Tiles/FlipCycleTileMedium.png +0 -0
- data/platform/wp8/rhodes/Assets/Tiles/FlipCycleTileSmall.png +0 -0
- data/platform/wp8/rhodes/LocalizedStrings.cs +37 -0
- data/platform/wp8/rhodes/MainPage.xaml +21 -0
- data/platform/wp8/rhodes/MainPage.xaml.cs +339 -0
- data/platform/wp8/rhodes/Properties/AppManifest.xml +6 -0
- data/platform/wp8/rhodes/Properties/AssemblyInfo.cs +37 -0
- data/platform/wp8/rhodes/Properties/WMAppManifest.xml +47 -0
- data/platform/wp8/rhodes/Resources/AppResources.Designer.cs +127 -0
- data/platform/wp8/rhodes/Resources/AppResources.resx +135 -0
- data/platform/wp8/rhodes/common/IInputStream.cs +47 -0
- data/platform/wp8/rhodes/common/RhoFile.cs +374 -0
- data/platform/wp8/rhodes/common/RhoFilePath.cs +115 -0
- data/platform/wp8/rhodes/common/RhoResourceMap.cs +92 -0
- data/platform/wp8/rhodes/common/RhoStd.cs +237 -0
- data/platform/wp8/rhodes/icon.png +0 -0
- data/platform/wp8/rhodes/rhodes.csproj +198 -0
- data/platform/wp8/rholib/rholib.vcxproj +240 -0
- data/platform/wp8/rholib/rholib.vcxproj.filters +289 -0
- data/platform/wp8/rhoruntime/FakeDefs.cpp +134 -0
- data/platform/wp8/rhoruntime/common/ExtManager.cpp +449 -0
- data/platform/wp8/rhoruntime/common/RhoClassFactory.cpp +58 -0
- data/platform/wp8/rhoruntime/common/RhoClassFactory.h +60 -0
- data/platform/wp8/rhoruntime/common/RhoCryptImpl.cpp +274 -0
- data/platform/wp8/rhoruntime/common/RhoCryptImpl.h +78 -0
- data/platform/wp8/rhoruntime/common/RhoThreadImpl.cpp +109 -0
- data/platform/wp8/rhoruntime/common/RhoThreadImpl.h +56 -0
- data/platform/wp8/rhoruntime/pch_rhoruntime.cpp +27 -0
- data/platform/wp8/rhoruntime/pch_rhoruntime.h +30 -0
- data/platform/wp8/rhoruntime/rhoruntime.cpp +93 -0
- data/platform/wp8/rhoruntime/rhoruntime.h +114 -0
- data/platform/wp8/rhoruntime/rhoruntime.vcxproj +175 -0
- data/platform/wp8/rhoruntime/rhoruntime.vcxproj.filters +44 -0
- data/platform/wp8/rubylib/file.c +5459 -0
- data/platform/wp8/rubylib/rubylib.vcxproj +286 -0
- data/platform/wp8/rubylib/rubylib.vcxproj.filters +307 -0
- data/platform/wp8/sqlite3/crypto.c +933 -0
- data/platform/wp8/sqlite3/sqlite3.c +136332 -0
- data/platform/wp8/sqlite3/sqlite3.vcxproj +149 -0
- data/platform/wp8/sqlite3/sqlite3.vcxproj.filters +16 -0
- data/platform/wp8/syncengine/syncengine.vcxproj +199 -0
- data/platform/wp8/syncengine/syncengine.vcxproj.filters +155 -0
- data/rakefile.rb +61 -9
- data/res/build-tools/RhoAppRunnerWP8.exe +0 -0
- data/res/build-tools/license_rc.dll +0 -0
- data/res/build-tools/win32/license_rc.dll +0 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/rhogen.rb +36 -0
- data/res/generators/templates/application/app/loading-568h@2x.png +0 -0
- data/res/generators/templates/application/app/loading-Landscape.png +0 -0
- data/res/generators/templates/application/app/loading-LandscapeLeft.png +0 -0
- data/res/generators/templates/application/app/loading-LandscapeRight.png +0 -0
- data/res/generators/templates/application/app/loading-Portrait.png +0 -0
- data/res/generators/templates/application/app/loading-PortraitUpsideDown.png +0 -0
- data/res/generators/templates/application/app/loading.png +0 -0
- data/res/generators/templates/application/app/loading@2x.png +0 -0
- data/res/generators/templates/application/icon/icon.ico +0 -0
- data/res/generators/templates/application/icon/icon.png +0 -0
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/public/css/android.css +1 -1
- data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
- data/res/generators/templates/application/rhoconfig.txt +3 -1
- data/res/generators/templates/model/model.rb +1 -1
- data/res/icons/rho.icns +0 -0
- data/res/icons/rho.ico +0 -0
- data/res/icons/rho.png +0 -0
- data/res/icons/rhodes.icns +0 -0
- data/res/icons/rhodes.ico +0 -0
- data/res/icons/rhodes.png +0 -0
- data/res/icons/rhosim.icns +0 -0
- data/res/icons/rhosim.ico +0 -0
- data/res/icons/rhosim.png +0 -0
- data/res/libs/motorolalicence/android/MotorolaLicence.h +2 -1
- data/res/libs/motorolalicence/android/libMotorolaLicence.a +0 -0
- data/res/libs/motorolalicence/iphone/MotorolaLicence.h +2 -1
- data/res/libs/motorolalicence/iphone/libMotorolaLicence.a +0 -0
- data/spec/autocomplete_generator/Rakefile +37 -0
- data/spec/autocomplete_generator/app/Generator/controller.rb +40 -0
- data/spec/autocomplete_generator/app/Generator/generator.rb +236 -0
- data/spec/autocomplete_generator/app/Generator/index.erb +21 -0
- data/spec/autocomplete_generator/app/Settings/controller.rb +117 -0
- data/spec/autocomplete_generator/app/Settings/err_sync.erb +11 -0
- data/spec/autocomplete_generator/app/Settings/home.bb.erb +18 -0
- data/spec/autocomplete_generator/app/Settings/home.erb +19 -0
- data/spec/autocomplete_generator/app/Settings/index.bb.erb +31 -0
- data/spec/autocomplete_generator/app/Settings/index.erb +31 -0
- data/spec/autocomplete_generator/app/Settings/login.bb.erb +29 -0
- data/spec/autocomplete_generator/app/Settings/login.erb +25 -0
- data/spec/autocomplete_generator/app/Settings/reset.bb.erb +16 -0
- data/spec/autocomplete_generator/app/Settings/reset.erb +14 -0
- data/spec/autocomplete_generator/app/Settings/wait.bb.erb +10 -0
- data/spec/autocomplete_generator/app/Settings/wait.erb +10 -0
- data/spec/autocomplete_generator/app/application.rb +16 -0
- data/spec/autocomplete_generator/app/helpers/application_helper.rb +129 -0
- data/spec/autocomplete_generator/app/helpers/browser_helper.rb +22 -0
- data/spec/autocomplete_generator/app/index.bb.erb +21 -0
- data/spec/autocomplete_generator/app/index.erb +24 -0
- data/spec/autocomplete_generator/app/layout.erb +94 -0
- data/spec/autocomplete_generator/app/loading.html +11 -0
- data/spec/autocomplete_generator/build.yml +41 -0
- data/spec/autocomplete_generator/icon/icon.ico +0 -0
- data/spec/autocomplete_generator/icon/icon.png +0 -0
- data/spec/autocomplete_generator/icon/icon.svg +5334 -0
- data/spec/autocomplete_generator/icon/icon114.png +0 -0
- data/spec/autocomplete_generator/icon/icon57.png +0 -0
- data/spec/autocomplete_generator/icon/icon72.png +0 -0
- data/spec/autocomplete_generator/readme.txt +1 -0
- data/spec/autocomplete_generator/rhoconfig.txt +88 -0
- data/spec/autocomplete_generator/rhosimulator/Databases/Databases.db +0 -0
- data/spec/autocomplete_generator/rhosimulator/WebpageIcons.db +0 -0
- data/spec/autocomplete_generator/rhosimulator/db/syncdbuser.sqlite +0 -0
- data/spec/autocomplete_generator/rhosimulator/db/syncdbuser.sqlite.version +1 -0
- data/spec/autocomplete_generator/rhosimulator/rholog.txt_pos +1 -0
- data/spec/autocomplete_generator/rhosimulator/rhosimconfig.txt +8 -0
- data/spec/framework_spec/app/spec/rhomobile/NetHttp_spec.rb +22 -0
- data/spec/framework_spec/app/spec_runner.rb +12 -0
- data/spec/framework_spec/icon/icon.ico +0 -0
- data/spec/framework_spec/icon/icon.png +0 -0
- data/spec/perfomance_spec/icon/icon.ico +0 -0
- data/spec/perfomance_spec/icon/icon.png +0 -0
- data/spec/phone_spec/app/BlobBulkTest/blob_bulk_test.png +0 -0
- data/spec/phone_spec/app/BlobBulkTest_s/blob_bulk_test_s.png +0 -0
- data/spec/phone_spec/app/PartialTest/_index_partial.erb +5 -0
- data/spec/phone_spec/app/PartialTest/_index_partial_nested.erb +2 -0
- data/spec/phone_spec/app/PartialTest/index.erb +6 -0
- data/spec/phone_spec/app/spec/blob_bulksync_spec.rb +5 -3
- data/spec/phone_spec/app/spec/bulksync_spec.rb +33 -41
- data/spec/phone_spec/app/spec/database_spec.rb +5 -0
- data/spec/phone_spec/app/spec/json_spec.rb +50 -50
- data/spec/phone_spec/app/spec/rho_controller_spec.rb +29 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +184 -47
- data/spec/phone_spec/app/spec_runner.rb +3 -2
- data/spec/phone_spec/icon/icon.ico +0 -0
- data/spec/phone_spec/icon/icon.png +0 -0
- data/spec/phone_spec/rhoconfig.txt +2 -0
- data/version +1 -1
- metadata +339 -47
- data/platform/android/Rhodes/PushReceiver.erb +0 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +0 -126
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +0 -83
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/Config.java +0 -246
- data/platform/bb/rhodes/src/com/rho/rubyext/PNGEncoder.java +0 -613
- data/res/icons/rho.psd +0 -0
- data/res/icons/rhodes.psd +0 -0
- data/res/icons/rhosim.psd +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
/* DO NOT EDIT THIS FILE - it is machine generated */
|
2
|
+
#include <jni.h>
|
3
|
+
/* Header for class com_rhomobile_rhodes_gcm_GCMRhoListener */
|
4
|
+
|
5
|
+
#ifndef _Included_com_rhomobile_rhodes_gcm_GCMRhoListener
|
6
|
+
#define _Included_com_rhomobile_rhodes_gcm_GCMRhoListener
|
7
|
+
#ifdef __cplusplus
|
8
|
+
extern "C" {
|
9
|
+
#endif
|
10
|
+
/*
|
11
|
+
* Class: com_rhomobile_rhodes_gcm_GCMRhoListener
|
12
|
+
* Method: nativeAddGCMPushClient
|
13
|
+
* Signature: ()V
|
14
|
+
*/
|
15
|
+
JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_gcm_GCMRhoListener_nativeAddGCMPushClient
|
16
|
+
(JNIEnv *, jclass);
|
17
|
+
|
18
|
+
#ifdef __cplusplus
|
19
|
+
}
|
20
|
+
#endif
|
21
|
+
#endif
|
@@ -0,0 +1,173 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2012 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
#include "rhodes/JNIRhodes.h"
|
28
|
+
#include "common/RhoConf.h"
|
29
|
+
#include "common/RhodesApp.h"
|
30
|
+
#include "sync/ClientRegister.h"
|
31
|
+
#include "sync/ILoginListener.h"
|
32
|
+
|
33
|
+
#include "logging/RhoLog.h"
|
34
|
+
|
35
|
+
#include "gcmpushclient.h"
|
36
|
+
#include "com_rhomobile_rhodes_gcm_GCMRhoListener.h"
|
37
|
+
|
38
|
+
#undef DEFAULT_LOGCATEGORY
|
39
|
+
#define DEFAULT_LOGCATEGORY "GcmPushJNI"
|
40
|
+
|
41
|
+
//----------------------------------------------------------------------------------------------------------------------
|
42
|
+
extern "C" void Init_GCMPushClient()
|
43
|
+
{
|
44
|
+
// create GCM push client
|
45
|
+
RHODESAPP().addPushClient(new rho::gcm::GcmPushClient());
|
46
|
+
}
|
47
|
+
|
48
|
+
//----------------------------------------------------------------------------------------------------------------------
|
49
|
+
RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_gcm_GCMRhoListener_nativeAddGCMPushClient (JNIEnv *, jclass)
|
50
|
+
{
|
51
|
+
|
52
|
+
// create GCM push client
|
53
|
+
RHODESAPP().addPushClient(new rho::gcm::GcmPushClient());
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
namespace rho { namespace gcm {
|
58
|
+
|
59
|
+
//----------------------------------------------------------------------------------------------------------------------
|
60
|
+
class GcmPushClient::SyncLoginListener : public sync::ILoginListener
|
61
|
+
{
|
62
|
+
static const char* const s_GCM_FACADE_CLASS;
|
63
|
+
|
64
|
+
static void GcmPushRegister();
|
65
|
+
static void GcmPushUnregister();
|
66
|
+
public:
|
67
|
+
virtual ~SyncLoginListener() {}
|
68
|
+
virtual void onLogin(const String& user, const String& pass, const String& session) const;
|
69
|
+
virtual void onLogout(const String& session) const;
|
70
|
+
};
|
71
|
+
//----------------------------------------------------------------------------------------------------------------------
|
72
|
+
|
73
|
+
const char* const GcmPushClient::SyncLoginListener::s_GCM_FACADE_CLASS = "com.rhomobile.rhodes.gcm.GCMFacade";
|
74
|
+
|
75
|
+
//----------------------------------------------------------------------------------------------------------------------
|
76
|
+
void GcmPushClient::SyncLoginListener::GcmPushRegister()
|
77
|
+
{
|
78
|
+
LOG(TRACE) + "GcmPushRegister()";
|
79
|
+
|
80
|
+
JNIEnv *env = jnienv();
|
81
|
+
|
82
|
+
static jclass cls = rho_find_class(env, s_GCM_FACADE_CLASS);
|
83
|
+
if (!cls) {
|
84
|
+
LOG(ERROR) + "Cannot find class: " + s_GCM_FACADE_CLASS;
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
|
88
|
+
static jmethodID mid = env->GetStaticMethodID(cls, "Register", "()V");
|
89
|
+
if (!mid) {
|
90
|
+
LOG(ERROR) + "Cannot get " + s_GCM_FACADE_CLASS + ".Register() method";
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
|
94
|
+
env->CallStaticVoidMethod(cls, mid);
|
95
|
+
}
|
96
|
+
|
97
|
+
//----------------------------------------------------------------------------------------------------------------------
|
98
|
+
void GcmPushClient::SyncLoginListener::GcmPushUnregister()
|
99
|
+
{
|
100
|
+
LOG(TRACE) + "GcmPushUnregister()";
|
101
|
+
|
102
|
+
JNIEnv *env = jnienv();
|
103
|
+
|
104
|
+
static jclass cls = rho_find_class(env, s_GCM_FACADE_CLASS);
|
105
|
+
if (!cls) {
|
106
|
+
LOG(ERROR) + "Cannot find class: " + s_GCM_FACADE_CLASS;
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
|
110
|
+
static jmethodID mid = env->GetStaticMethodID(cls, "Unregister", "()V");
|
111
|
+
if (!mid) {
|
112
|
+
LOG(ERROR) + "Cannot get " + s_GCM_FACADE_CLASS + ".Unregister() method";
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
|
116
|
+
env->CallStaticVoidMethod(cls, mid);
|
117
|
+
}
|
118
|
+
//----------------------------------------------------------------------------------------------------------------------
|
119
|
+
void GcmPushClient::SyncLoginListener::onLogin(const String& user, const String& pass, const String& session) const
|
120
|
+
{
|
121
|
+
sync::CClientRegister::Get()->setDevicehPin("");
|
122
|
+
GcmPushRegister();
|
123
|
+
}
|
124
|
+
//----------------------------------------------------------------------------------------------------------------------
|
125
|
+
void GcmPushClient::SyncLoginListener::onLogout(const String& session) const
|
126
|
+
{
|
127
|
+
sync::CClientRegister::Get()->setDevicehPin("");
|
128
|
+
GcmPushUnregister();
|
129
|
+
}
|
130
|
+
//----------------------------------------------------------------------------------------------------------------------
|
131
|
+
const String GcmPushClient::s_Type = "gcm";
|
132
|
+
|
133
|
+
GcmPushClient::GcmPushClient()
|
134
|
+
{
|
135
|
+
sync::CClientRegister::AddLoginListener(new SyncLoginListener());
|
136
|
+
}
|
137
|
+
|
138
|
+
//----------------------------------------------------------------------------------------------------------------------
|
139
|
+
void GcmPushClient::init()
|
140
|
+
{
|
141
|
+
if(!sync::CClientRegister::getInstance())
|
142
|
+
{
|
143
|
+
sync::CClientRegister::Create();
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
//----------------------------------------------------------------------------------------------------------------------
|
148
|
+
void GcmPushClient::setNotificationUrl(const String& callbackUrl, const String& callbackParam)
|
149
|
+
{
|
150
|
+
m_strCallbackUrl = callbackUrl;
|
151
|
+
m_strCallbackParam = callbackParam;
|
152
|
+
}
|
153
|
+
|
154
|
+
//----------------------------------------------------------------------------------------------------------------------
|
155
|
+
bool GcmPushClient::callNotification(const String& json, const String& data)
|
156
|
+
{
|
157
|
+
String finalData = m_strCallbackParam;
|
158
|
+
if(data.length() > 0)
|
159
|
+
{
|
160
|
+
if(finalData.length() > 0)
|
161
|
+
finalData += '&';
|
162
|
+
finalData += data;
|
163
|
+
}
|
164
|
+
if(m_strCallbackUrl.length() > 0)
|
165
|
+
{
|
166
|
+
return RHODESAPP().callPushCallbackWithJsonBody(m_strCallbackUrl, json, finalData);
|
167
|
+
}
|
168
|
+
|
169
|
+
return false;
|
170
|
+
}
|
171
|
+
|
172
|
+
}}
|
173
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2012 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
#ifndef GCMPUSHCLIENT_H_
|
28
|
+
#define GCMPUSHCLIENT_H_
|
29
|
+
|
30
|
+
#include "common/push/IRhoPushClient.h"
|
31
|
+
|
32
|
+
#include "logging/RhoLog.h"
|
33
|
+
#include "common/RhoStd.h"
|
34
|
+
|
35
|
+
|
36
|
+
namespace rho { namespace gcm {
|
37
|
+
|
38
|
+
using namespace rho::common;
|
39
|
+
|
40
|
+
class GcmPushClient: public IRhoPushClient
|
41
|
+
{
|
42
|
+
class SyncLoginListener;
|
43
|
+
private:
|
44
|
+
static const String s_Type;
|
45
|
+
String m_strCallbackUrl;
|
46
|
+
String m_strCallbackParam;
|
47
|
+
public:
|
48
|
+
GcmPushClient();
|
49
|
+
virtual ~GcmPushClient() {}
|
50
|
+
|
51
|
+
virtual const String& getType() const { return s_Type; }
|
52
|
+
|
53
|
+
virtual void init();
|
54
|
+
virtual void setNotificationUrl(const String& callBackUrl, const String& urlParams);
|
55
|
+
virtual bool callNotification(const String& json, const String& data);
|
56
|
+
|
57
|
+
};
|
58
|
+
|
59
|
+
|
60
|
+
}}
|
61
|
+
|
62
|
+
#endif /* GCMPUSHCLIENT_H_ */
|
data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMBroadcastReceiver.java
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2012 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.gcm;
|
28
|
+
|
29
|
+
import android.content.Context;
|
30
|
+
|
31
|
+
public final class GCMBroadcastReceiver extends
|
32
|
+
com.google.android.gcm.GCMBroadcastReceiver {
|
33
|
+
|
34
|
+
@Override
|
35
|
+
public String getGCMIntentServiceClassName(Context context) {
|
36
|
+
return GCMIntentService.class.getCanonicalName();
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2012 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.gcm;
|
28
|
+
|
29
|
+
import com.google.android.gcm.GCMRegistrar;
|
30
|
+
import com.rhomobile.rhodes.Push;
|
31
|
+
import com.rhomobile.rhodes.Logger;
|
32
|
+
import com.rhomobile.rhodes.util.ContextFactory;
|
33
|
+
|
34
|
+
public final class GCMFacade {
|
35
|
+
private static final String TAG = GCMFacade.class.getSimpleName();
|
36
|
+
|
37
|
+
static final String GCM_PUSH_CLIENT = "gcm";
|
38
|
+
|
39
|
+
public static void Register() {
|
40
|
+
Logger.T(TAG, "Send GCM push register req");
|
41
|
+
if (GCMRegistrar.isRegistered(ContextFactory.getContext())) {
|
42
|
+
Logger.T(TAG, "Already has GCM push registeration");
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
Logger.T(TAG, "Send GCM push register req");
|
46
|
+
GCMRegistrar.register(ContextFactory.getContext(), Push.SENDER/*RhodesService.getBuildConfig("gcm_push_sender")*/);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
public static void Unregister() {
|
51
|
+
Logger.T(TAG, "GCM push unregister req");
|
52
|
+
GCMRegistrar.unregister(ContextFactory.getContext());
|
53
|
+
}
|
54
|
+
|
55
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2012 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.gcm;
|
28
|
+
|
29
|
+
import android.content.Context;
|
30
|
+
import android.content.Intent;
|
31
|
+
|
32
|
+
import com.google.android.gcm.GCMBaseIntentService;
|
33
|
+
import com.rhomobile.rhodes.Logger;
|
34
|
+
import com.rhomobile.rhodes.PushContract;
|
35
|
+
|
36
|
+
public final class GCMIntentService extends GCMBaseIntentService {
|
37
|
+
|
38
|
+
@Override
|
39
|
+
protected void onRegistered(Context context, String pin) {
|
40
|
+
Logger.T(TAG, "GCM push registation: " + pin);
|
41
|
+
PushContract.handleRegistration(context, pin, GCMFacade.GCM_PUSH_CLIENT);
|
42
|
+
}
|
43
|
+
|
44
|
+
@Override
|
45
|
+
protected void onUnregistered(Context context, String pin) {
|
46
|
+
Logger.T(TAG, "GCM push unregistation: " + pin);
|
47
|
+
}
|
48
|
+
|
49
|
+
@Override
|
50
|
+
protected void onMessage(Context context, Intent intent) {
|
51
|
+
Logger.T(TAG, "GCM push message: " + intent);
|
52
|
+
PushContract.handleMessage(context, intent.getExtras(), GCMFacade.GCM_PUSH_CLIENT);
|
53
|
+
}
|
54
|
+
|
55
|
+
@Override
|
56
|
+
protected void onError(Context context, String error) {
|
57
|
+
Logger.T(TAG, "GCM push error: " + error);
|
58
|
+
PushContract.handleError(context, error, GCMFacade.GCM_PUSH_CLIENT);
|
59
|
+
}
|
60
|
+
}
|
@@ -4,28 +4,37 @@
|
|
4
4
|
# Copyright (c) 1999-2007 Yukihiro Matsumoto
|
5
5
|
# Copyright (c) 1999-2007 Minero Aoki
|
6
6
|
# Copyright (c) 2001 GOTOU Yuuzou
|
7
|
-
#
|
7
|
+
#
|
8
8
|
# Written and maintained by Minero Aoki <aamine@loveruby.net>.
|
9
9
|
# HTTPS support added by GOTOU Yuuzou <gotoyuzo@notwork.org>.
|
10
10
|
#
|
11
11
|
# This file is derived from "http-access.rb".
|
12
12
|
#
|
13
13
|
# Documented by Minero Aoki; converted to RDoc by William Webber.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# This program is free software. You can re-distribute and/or
|
16
16
|
# modify this program under the same terms of ruby itself ---
|
17
17
|
# Ruby Distribution License or GNU General Public License.
|
18
18
|
#
|
19
|
-
# See Net::HTTP for an overview and examples.
|
20
|
-
#
|
19
|
+
# See Net::HTTP for an overview and examples.
|
20
|
+
#
|
21
21
|
# NOTE: You can find Japanese version of this document here:
|
22
22
|
# http://www.ruby-lang.org/ja/man/html/net_http.html
|
23
|
-
#
|
23
|
+
#
|
24
24
|
#--
|
25
25
|
# $Id: http.rb 30571 2011-01-16 12:35:11Z yugui $
|
26
26
|
#++
|
27
27
|
|
28
28
|
require 'net/protocol'
|
29
|
+
if System::get_property('platform') != 'Blackberry'
|
30
|
+
autoload :OpenSSL, 'openssl'
|
31
|
+
else
|
32
|
+
module OpenSSL
|
33
|
+
module SSL
|
34
|
+
VERIFY_NONE = 0
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
29
38
|
require 'uri'
|
30
39
|
|
31
40
|
module Net #:nodoc:
|
@@ -36,29 +45,29 @@ module Net #:nodoc:
|
|
36
45
|
# :startdoc:
|
37
46
|
|
38
47
|
# == What Is This Library?
|
39
|
-
#
|
48
|
+
#
|
40
49
|
# This library provides your program functions to access WWW
|
41
50
|
# documents via HTTP, Hyper Text Transfer Protocol version 1.1.
|
42
51
|
# For details of HTTP, refer to [RFC2616]
|
43
52
|
# (http://www.ietf.org/rfc/rfc2616.txt).
|
44
|
-
#
|
53
|
+
#
|
45
54
|
# == Examples
|
46
|
-
#
|
55
|
+
#
|
47
56
|
# === Getting Document From WWW Server
|
48
|
-
#
|
57
|
+
#
|
49
58
|
# Example #1: Simple GET+print
|
50
|
-
#
|
59
|
+
#
|
51
60
|
# require 'net/http'
|
52
61
|
# Net::HTTP.get_print 'www.example.com', '/index.html'
|
53
|
-
#
|
62
|
+
#
|
54
63
|
# Example #2: Simple GET+print by URL
|
55
|
-
#
|
64
|
+
#
|
56
65
|
# require 'net/http'
|
57
66
|
# require 'uri'
|
58
67
|
# Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
|
59
|
-
#
|
68
|
+
#
|
60
69
|
# Example #3: More generic GET+print
|
61
|
-
#
|
70
|
+
#
|
62
71
|
# require 'net/http'
|
63
72
|
# require 'uri'
|
64
73
|
#
|
@@ -69,7 +78,7 @@ module Net #:nodoc:
|
|
69
78
|
# puts res.body
|
70
79
|
#
|
71
80
|
# Example #4: More generic GET+print
|
72
|
-
#
|
81
|
+
#
|
73
82
|
# require 'net/http'
|
74
83
|
#
|
75
84
|
# url = URI.parse('http://www.example.com/index.html')
|
@@ -78,9 +87,9 @@ module Net #:nodoc:
|
|
78
87
|
# http.request(req)
|
79
88
|
# }
|
80
89
|
# puts res.body
|
81
|
-
#
|
90
|
+
#
|
82
91
|
# === Posting Form Data
|
83
|
-
#
|
92
|
+
#
|
84
93
|
# require 'net/http'
|
85
94
|
# require 'uri'
|
86
95
|
#
|
@@ -112,15 +121,15 @@ module Net #:nodoc:
|
|
112
121
|
# res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
|
113
122
|
# {'q' => ['ruby', 'perl'], 'max' => '50'})
|
114
123
|
# puts res.body
|
115
|
-
#
|
124
|
+
#
|
116
125
|
# === Accessing via Proxy
|
117
|
-
#
|
126
|
+
#
|
118
127
|
# Net::HTTP.Proxy creates http proxy class. It has same
|
119
128
|
# methods of Net::HTTP but its instances always connect to
|
120
129
|
# proxy, instead of given host.
|
121
|
-
#
|
130
|
+
#
|
122
131
|
# require 'net/http'
|
123
|
-
#
|
132
|
+
#
|
124
133
|
# proxy_addr = 'your.proxy.host'
|
125
134
|
# proxy_port = 8080
|
126
135
|
# :
|
@@ -128,20 +137,20 @@ module Net #:nodoc:
|
|
128
137
|
# # always connect to your.proxy.addr:8080
|
129
138
|
# :
|
130
139
|
# }
|
131
|
-
#
|
140
|
+
#
|
132
141
|
# Since Net::HTTP.Proxy returns Net::HTTP itself when proxy_addr is nil,
|
133
142
|
# there's no need to change code if there's proxy or not.
|
134
|
-
#
|
143
|
+
#
|
135
144
|
# There are two additional parameters in Net::HTTP.Proxy which allow to
|
136
145
|
# specify proxy user name and password:
|
137
|
-
#
|
146
|
+
#
|
138
147
|
# Net::HTTP::Proxy(proxy_addr, proxy_port, proxy_user = nil, proxy_pass = nil)
|
139
|
-
#
|
148
|
+
#
|
140
149
|
# You may use them to work with authorization-enabled proxies:
|
141
|
-
#
|
150
|
+
#
|
142
151
|
# require 'net/http'
|
143
152
|
# require 'uri'
|
144
|
-
#
|
153
|
+
#
|
145
154
|
# proxy_host = 'your.proxy.host'
|
146
155
|
# proxy_port = 8080
|
147
156
|
# uri = URI.parse(ENV['http_proxy'])
|
@@ -154,16 +163,16 @@ module Net #:nodoc:
|
|
154
163
|
#
|
155
164
|
# Note that net/http never rely on HTTP_PROXY environment variable.
|
156
165
|
# If you want to use proxy, set it explicitly.
|
157
|
-
#
|
166
|
+
#
|
158
167
|
# === Following Redirection
|
159
|
-
#
|
168
|
+
#
|
160
169
|
# require 'net/http'
|
161
170
|
# require 'uri'
|
162
|
-
#
|
171
|
+
#
|
163
172
|
# def fetch(uri_str, limit = 10)
|
164
|
-
# # You should choose better exception.
|
173
|
+
# # You should choose better exception.
|
165
174
|
# raise ArgumentError, 'HTTP redirect too deep' if limit == 0
|
166
|
-
#
|
175
|
+
#
|
167
176
|
# response = Net::HTTP.get_response(URI.parse(uri_str))
|
168
177
|
# case response
|
169
178
|
# when Net::HTTPSuccess then response
|
@@ -172,25 +181,25 @@ module Net #:nodoc:
|
|
172
181
|
# response.error!
|
173
182
|
# end
|
174
183
|
# end
|
175
|
-
#
|
184
|
+
#
|
176
185
|
# print fetch('http://www.ruby-lang.org')
|
177
|
-
#
|
186
|
+
#
|
178
187
|
# Net::HTTPSuccess and Net::HTTPRedirection is a HTTPResponse class.
|
179
188
|
# All HTTPResponse objects belong to its own response class which
|
180
189
|
# indicate HTTP result status. For details of response classes,
|
181
190
|
# see section "HTTP Response Classes".
|
182
|
-
#
|
191
|
+
#
|
183
192
|
# === Basic Authentication
|
184
|
-
#
|
193
|
+
#
|
185
194
|
# require 'net/http'
|
186
|
-
#
|
195
|
+
#
|
187
196
|
# Net::HTTP.start('www.example.com') {|http|
|
188
197
|
# req = Net::HTTP::Get.new('/secret-page.html')
|
189
198
|
# req.basic_auth 'account', 'password'
|
190
199
|
# response = http.request(req)
|
191
200
|
# print response.body
|
192
201
|
# }
|
193
|
-
#
|
202
|
+
#
|
194
203
|
# === HTTP Request Classes
|
195
204
|
#
|
196
205
|
# Here is HTTP request class hierarchy.
|
@@ -263,22 +272,22 @@ module Net #:nodoc:
|
|
263
272
|
# HTTPServiceUnavailable # 503
|
264
273
|
# HTTPGatewayTimeOut # 504
|
265
274
|
# HTTPVersionNotSupported # 505
|
266
|
-
#
|
275
|
+
#
|
267
276
|
# == Switching Net::HTTP versions
|
268
|
-
#
|
277
|
+
#
|
269
278
|
# You can use net/http.rb 1.1 features (bundled with Ruby 1.6)
|
270
279
|
# by calling HTTP.version_1_1. Calling Net::HTTP.version_1_2
|
271
280
|
# allows you to use 1.2 features again.
|
272
|
-
#
|
281
|
+
#
|
273
282
|
# # example
|
274
283
|
# Net::HTTP.start {|http1| ...(http1 has 1.2 features)... }
|
275
|
-
#
|
284
|
+
#
|
276
285
|
# Net::HTTP.version_1_1
|
277
286
|
# Net::HTTP.start {|http2| ...(http2 has 1.1 features)... }
|
278
|
-
#
|
287
|
+
#
|
279
288
|
# Net::HTTP.version_1_2
|
280
289
|
# Net::HTTP.start {|http3| ...(http3 has 1.2 features)... }
|
281
|
-
#
|
290
|
+
#
|
282
291
|
# This function is NOT thread-safe.
|
283
292
|
#
|
284
293
|
class HTTP < Protocol
|
@@ -290,11 +299,11 @@ module Net #:nodoc:
|
|
290
299
|
begin
|
291
300
|
if defined? RHO_ME
|
292
301
|
HAVE_ZLIB=false
|
293
|
-
else
|
302
|
+
else
|
294
303
|
require 'zlib'
|
295
304
|
require 'stringio' #for our purposes (unpacking gzip) lump these together
|
296
305
|
HAVE_ZLIB=true
|
297
|
-
end
|
306
|
+
end
|
298
307
|
rescue LoadError
|
299
308
|
HAVE_ZLIB=false
|
300
309
|
end
|
@@ -342,7 +351,7 @@ module Net #:nodoc:
|
|
342
351
|
#
|
343
352
|
# Get body from target and output it to +$stdout+. The
|
344
353
|
# target can either be specified as (+uri+), or as
|
345
|
-
# (+host+, +path+, +port+ = 80); so:
|
354
|
+
# (+host+, +path+, +port+ = 80); so:
|
346
355
|
#
|
347
356
|
# Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
|
348
357
|
#
|
@@ -362,7 +371,7 @@ module Net #:nodoc:
|
|
362
371
|
# Send a GET request to the target and return the response
|
363
372
|
# as a string. The target can either be specified as
|
364
373
|
# (+uri+), or as (+host+, +path+, +port+ = 80); so:
|
365
|
-
#
|
374
|
+
#
|
366
375
|
# print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
|
367
376
|
#
|
368
377
|
# or:
|
@@ -376,7 +385,7 @@ module Net #:nodoc:
|
|
376
385
|
# Send a GET request to the target and return the response
|
377
386
|
# as a Net::HTTPResponse object. The target can either be specified as
|
378
387
|
# (+uri+), or as (+host+, +path+, +port+ = 80); so:
|
379
|
-
#
|
388
|
+
#
|
380
389
|
# res = Net::HTTP.get_response(URI.parse('http://www.example.com/index.html'))
|
381
390
|
# print res.body
|
382
391
|
#
|
@@ -481,14 +490,14 @@ module Net #:nodoc:
|
|
481
490
|
port = https_default_port if !port && opt && opt[:use_ssl]
|
482
491
|
http = new(address, port, p_addr, p_port, p_user, p_pass)
|
483
492
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
493
|
+
if opt
|
494
|
+
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt) if opt[:use_ssl]
|
495
|
+
http.methods.grep(/\A(\w+)=\z/) do |meth|
|
496
|
+
key = $1.to_sym
|
497
|
+
opt.key?(key) or next
|
498
|
+
http.__send__(meth, opt[key])
|
499
|
+
end
|
500
|
+
end
|
492
501
|
|
493
502
|
http.start(&block)
|
494
503
|
end
|
@@ -584,11 +593,37 @@ module Net #:nodoc:
|
|
584
593
|
|
585
594
|
# returns true if use SSL/TLS with HTTP.
|
586
595
|
def use_ssl?
|
587
|
-
|
596
|
+
@use_ssl
|
597
|
+
end
|
598
|
+
|
599
|
+
# Turn on/off SSL.
|
600
|
+
# This flag must be set before starting session.
|
601
|
+
# If you change use_ssl value after session started,
|
602
|
+
# a Net::HTTP object raises IOError.
|
603
|
+
def use_ssl=(flag)
|
604
|
+
flag = (flag ? true : false)
|
605
|
+
if started? and @use_ssl != flag
|
606
|
+
raise IOError, "use_ssl value changed, but session already started"
|
607
|
+
end
|
608
|
+
@use_ssl = flag
|
609
|
+
end
|
610
|
+
|
611
|
+
SSL_ATTRIBUTES = %w(
|
612
|
+
ssl_version key cert ca_file ca_path cert_store ciphers
|
613
|
+
verify_mode verify_callback verify_depth ssl_timeout
|
614
|
+
)
|
615
|
+
attr_accessor(*SSL_ATTRIBUTES)
|
616
|
+
|
617
|
+
# return the X.509 certificates the server presented.
|
618
|
+
def peer_cert
|
619
|
+
if not use_ssl? or not @socket
|
620
|
+
return nil
|
621
|
+
end
|
622
|
+
@socket.io.peer_cert
|
588
623
|
end
|
589
624
|
|
590
625
|
# Opens TCP connection and HTTP session.
|
591
|
-
#
|
626
|
+
#
|
592
627
|
# When this method is called with block, gives a HTTP object
|
593
628
|
# to the block and closes the TCP connection / HTTP session
|
594
629
|
# after the block executed.
|
@@ -628,9 +663,9 @@ module Net #:nodoc:
|
|
628
663
|
iv_list = instance_variables
|
629
664
|
SSL_ATTRIBUTES.each do |name|
|
630
665
|
ivname = "@#{name}".intern
|
631
|
-
if iv_list.include?(ivname)
|
632
|
-
|
633
|
-
ssl_parameters[name] = value
|
666
|
+
if iv_list.include?(ivname) and
|
667
|
+
value = instance_variable_get(ivname)
|
668
|
+
ssl_parameters[name] = value
|
634
669
|
end
|
635
670
|
end
|
636
671
|
if platform != 'Blackberry'
|
@@ -659,12 +694,12 @@ module Net #:nodoc:
|
|
659
694
|
@socket.writeline ''
|
660
695
|
HTTPResponse.read_new(@socket).value
|
661
696
|
end
|
662
|
-
|
697
|
+
if platform != 'Blackberry'
|
663
698
|
timeout(@open_timeout) { s.connect }
|
664
699
|
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
|
665
700
|
s.post_connection_check(@address)
|
666
701
|
end
|
667
|
-
|
702
|
+
end
|
668
703
|
rescue => exception
|
669
704
|
D "Conn close because of connect error #{exception}"
|
670
705
|
@socket.close if @socket and not @socket.closed?
|
@@ -673,7 +708,6 @@ module Net #:nodoc:
|
|
673
708
|
end
|
674
709
|
on_connect
|
675
710
|
end
|
676
|
-
|
677
711
|
private :connect
|
678
712
|
|
679
713
|
def on_connect
|
@@ -711,9 +745,9 @@ module Net #:nodoc:
|
|
711
745
|
# Arguments are address/port of proxy host and username/password
|
712
746
|
# if authorization on proxy server is required.
|
713
747
|
# You can replace the HTTP class with created proxy class.
|
714
|
-
#
|
748
|
+
#
|
715
749
|
# If ADDRESS is nil, this method returns self (Net::HTTP).
|
716
|
-
#
|
750
|
+
#
|
717
751
|
# # Example
|
718
752
|
# proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080)
|
719
753
|
# :
|
@@ -721,7 +755,7 @@ module Net #:nodoc:
|
|
721
755
|
# # connecting proxy.foo.org:8080
|
722
756
|
# :
|
723
757
|
# }
|
724
|
-
#
|
758
|
+
#
|
725
759
|
def HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil)
|
726
760
|
return self unless p_addr
|
727
761
|
delta = ProxyDelta
|
@@ -821,14 +855,14 @@ module Net #:nodoc:
|
|
821
855
|
# and it defaults to an empty hash.
|
822
856
|
# If +initheader+ doesn't have the key 'accept-encoding', then
|
823
857
|
# a value of "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" is used,
|
824
|
-
# so that gzip compression is used in preference to deflate
|
825
|
-
# compression, which is used in preference to no compression.
|
858
|
+
# so that gzip compression is used in preference to deflate
|
859
|
+
# compression, which is used in preference to no compression.
|
826
860
|
# Ruby doesn't have libraries to support the compress (Lempel-Ziv)
|
827
861
|
# compression, so that is not supported. The intent of this is
|
828
862
|
# to reduce bandwidth by default. If this routine sets up
|
829
863
|
# compression, then it does the decompression also, removing
|
830
864
|
# the header as well to prevent confusion. Otherwise
|
831
|
-
# it leaves the body as it found it.
|
865
|
+
# it leaves the body as it found it.
|
832
866
|
#
|
833
867
|
# In version 1.1 (ruby 1.6), this method returns a pair of objects,
|
834
868
|
# a Net::HTTPResponse object and the entity body string.
|
@@ -843,7 +877,7 @@ module Net #:nodoc:
|
|
843
877
|
# +dest+ argument is obsolete.
|
844
878
|
# It still works but you must not use it.
|
845
879
|
#
|
846
|
-
# In version 1.1, this method might raise an exception for
|
880
|
+
# In version 1.1, this method might raise an exception for
|
847
881
|
# 3xx (redirect). In this case you can get a HTTPResponse object
|
848
882
|
# by "anException.response".
|
849
883
|
#
|
@@ -854,7 +888,7 @@ module Net #:nodoc:
|
|
854
888
|
#
|
855
889
|
# # version 1.2 (bundled with Ruby 1.8 or later)
|
856
890
|
# response = http.get('/index.html')
|
857
|
-
#
|
891
|
+
#
|
858
892
|
# # using block
|
859
893
|
# File.open('result.txt', 'w') {|f|
|
860
894
|
# http.get('/~foo/') do |str|
|
@@ -878,14 +912,14 @@ module Net #:nodoc:
|
|
878
912
|
the_body = r.read_body dest, &block
|
879
913
|
case r["content-encoding"]
|
880
914
|
when "gzip"
|
881
|
-
r.body= Zlib::GzipReader.new(StringIO.new(the_body), encoding
|
915
|
+
r.body= Zlib::GzipReader.new(StringIO.new(the_body), encoding: "ASCII-8BIT").read
|
882
916
|
r.delete("content-encoding")
|
883
917
|
when "deflate"
|
884
918
|
r.body= Zlib::Inflate.inflate(the_body);
|
885
919
|
r.delete("content-encoding")
|
886
920
|
when "identity"
|
887
921
|
; # nothing needed
|
888
|
-
else
|
922
|
+
else
|
889
923
|
; # Don't do anything dramatic, unless we need to later
|
890
924
|
end
|
891
925
|
else
|
@@ -903,21 +937,21 @@ module Net #:nodoc:
|
|
903
937
|
|
904
938
|
# Gets only the header from +path+ on the connected-to host.
|
905
939
|
# +header+ is a Hash like { 'Accept' => '*/*', ... }.
|
906
|
-
#
|
940
|
+
#
|
907
941
|
# This method returns a Net::HTTPResponse object.
|
908
|
-
#
|
909
|
-
# In version 1.1, this method might raise an exception for
|
942
|
+
#
|
943
|
+
# In version 1.1, this method might raise an exception for
|
910
944
|
# 3xx (redirect). On the case you can get a HTTPResponse object
|
911
945
|
# by "anException.response".
|
912
946
|
# In version 1.2, this method never raises an exception.
|
913
|
-
#
|
947
|
+
#
|
914
948
|
# response = nil
|
915
949
|
# Net::HTTP.start('some.www.server', 80) {|http|
|
916
950
|
# response = http.head('/index.html')
|
917
951
|
# }
|
918
952
|
# p response['content-type']
|
919
953
|
#
|
920
|
-
def head(path, initheader = nil)
|
954
|
+
def head(path, initheader = nil)
|
921
955
|
res = request(Head.new(path, initheader))
|
922
956
|
res.value unless @newimpl
|
923
957
|
res
|
@@ -925,11 +959,11 @@ module Net #:nodoc:
|
|
925
959
|
|
926
960
|
# Posts +data+ (must be a String) to +path+. +header+ must be a Hash
|
927
961
|
# like { 'Accept' => '*/*', ... }.
|
928
|
-
#
|
962
|
+
#
|
929
963
|
# In version 1.1 (ruby 1.6), this method returns a pair of objects, a
|
930
964
|
# Net::HTTPResponse object and an entity body string.
|
931
965
|
# In version 1.2 (ruby 1.8), this method returns a Net::HTTPResponse object.
|
932
|
-
#
|
966
|
+
#
|
933
967
|
# If called with a block, yields each fragment of the
|
934
968
|
# entity body in turn as a string as it are read from
|
935
969
|
# the socket. Note that in this case, the returned response
|
@@ -937,18 +971,18 @@ module Net #:nodoc:
|
|
937
971
|
#
|
938
972
|
# +dest+ argument is obsolete.
|
939
973
|
# It still works but you must not use it.
|
940
|
-
#
|
941
|
-
# In version 1.1, this method might raise an exception for
|
974
|
+
#
|
975
|
+
# In version 1.1, this method might raise an exception for
|
942
976
|
# 3xx (redirect). In this case you can get an HTTPResponse object
|
943
977
|
# by "anException.response".
|
944
978
|
# In version 1.2, this method never raises exception.
|
945
|
-
#
|
979
|
+
#
|
946
980
|
# # version 1.1
|
947
981
|
# response, body = http.post('/cgi-bin/search.rb', 'query=foo')
|
948
|
-
#
|
982
|
+
#
|
949
983
|
# # version 1.2
|
950
984
|
# response = http.post('/cgi-bin/search.rb', 'query=foo')
|
951
|
-
#
|
985
|
+
#
|
952
986
|
# # using block
|
953
987
|
# File.open('result.txt', 'w') {|f|
|
954
988
|
# http.post('/cgi-bin/search.rb', 'query=foo') do |str|
|
@@ -1041,21 +1075,21 @@ module Net #:nodoc:
|
|
1041
1075
|
|
1042
1076
|
# Sends a GET request to the +path+ and gets a response,
|
1043
1077
|
# as an HTTPResponse object.
|
1044
|
-
#
|
1078
|
+
#
|
1045
1079
|
# When called with a block, yields an HTTPResponse object.
|
1046
1080
|
# The body of this response will not have been read yet;
|
1047
1081
|
# the caller can process it using HTTPResponse#read_body,
|
1048
1082
|
# if desired.
|
1049
1083
|
#
|
1050
1084
|
# Returns the response.
|
1051
|
-
#
|
1085
|
+
#
|
1052
1086
|
# This method never raises Net::* exceptions.
|
1053
|
-
#
|
1087
|
+
#
|
1054
1088
|
# response = http.request_get('/index.html')
|
1055
1089
|
# # The entity body is already read here.
|
1056
1090
|
# p response['content-type']
|
1057
1091
|
# puts response.body
|
1058
|
-
#
|
1092
|
+
#
|
1059
1093
|
# # using block
|
1060
1094
|
# http.request_get('/index.html') {|response|
|
1061
1095
|
# p response['content-type']
|
@@ -1072,9 +1106,9 @@ module Net #:nodoc:
|
|
1072
1106
|
# as an HTTPResponse object.
|
1073
1107
|
#
|
1074
1108
|
# Returns the response.
|
1075
|
-
#
|
1109
|
+
#
|
1076
1110
|
# This method never raises Net::* exceptions.
|
1077
|
-
#
|
1111
|
+
#
|
1078
1112
|
# response = http.request_head('/index.html')
|
1079
1113
|
# p response['content-type']
|
1080
1114
|
#
|
@@ -1084,21 +1118,21 @@ module Net #:nodoc:
|
|
1084
1118
|
|
1085
1119
|
# Sends a POST request to the +path+ and gets a response,
|
1086
1120
|
# as an HTTPResponse object.
|
1087
|
-
#
|
1121
|
+
#
|
1088
1122
|
# When called with a block, yields an HTTPResponse object.
|
1089
1123
|
# The body of this response will not have been read yet;
|
1090
1124
|
# the caller can process it using HTTPResponse#read_body,
|
1091
1125
|
# if desired.
|
1092
1126
|
#
|
1093
1127
|
# Returns the response.
|
1094
|
-
#
|
1128
|
+
#
|
1095
1129
|
# This method never raises Net::* exceptions.
|
1096
|
-
#
|
1130
|
+
#
|
1097
1131
|
# # example
|
1098
1132
|
# response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
|
1099
1133
|
# p response.status
|
1100
1134
|
# puts response.body # body is already read
|
1101
|
-
#
|
1135
|
+
#
|
1102
1136
|
# # using block
|
1103
1137
|
# http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
|
1104
1138
|
# p response.status
|
@@ -1126,7 +1160,7 @@ module Net #:nodoc:
|
|
1126
1160
|
# This method also sends DATA string if DATA is given.
|
1127
1161
|
#
|
1128
1162
|
# Returns a HTTPResponse object.
|
1129
|
-
#
|
1163
|
+
#
|
1130
1164
|
# This method never raises Net::* exceptions.
|
1131
1165
|
#
|
1132
1166
|
# response = http.send_request('GET', '/index.html')
|
@@ -1140,14 +1174,14 @@ module Net #:nodoc:
|
|
1140
1174
|
# Sends an HTTPRequest object REQUEST to the HTTP server.
|
1141
1175
|
# This method also sends DATA string if REQUEST is a post/put request.
|
1142
1176
|
# Giving DATA for get/head request causes ArgumentError.
|
1143
|
-
#
|
1177
|
+
#
|
1144
1178
|
# When called with a block, yields an HTTPResponse object.
|
1145
1179
|
# The body of this response will not have been read yet;
|
1146
1180
|
# the caller can process it using HTTPResponse#read_body,
|
1147
1181
|
# if desired.
|
1148
1182
|
#
|
1149
1183
|
# Returns a HTTPResponse object.
|
1150
|
-
#
|
1184
|
+
#
|
1151
1185
|
# This method never raises Net::* exceptions.
|
1152
1186
|
#
|
1153
1187
|
def request(req, body = nil, &block) # :yield: +response+
|
@@ -1381,7 +1415,7 @@ module Net #:nodoc:
|
|
1381
1415
|
alias each_key each_name
|
1382
1416
|
|
1383
1417
|
# Iterates for each capitalized header names.
|
1384
|
-
def each_capitalized_name
|
1418
|
+
def each_capitalized_name #:yield: +key+
|
1385
1419
|
block_given? or return enum_for(__method__)
|
1386
1420
|
@header.each_key do |k|
|
1387
1421
|
yield capitalize(k)
|
@@ -1489,7 +1523,7 @@ module Net #:nodoc:
|
|
1489
1523
|
raise HTTPHeaderSyntaxError, 'wrong Content-Length format'
|
1490
1524
|
len.to_i
|
1491
1525
|
end
|
1492
|
-
|
1526
|
+
|
1493
1527
|
def content_length=(len)
|
1494
1528
|
unless len
|
1495
1529
|
@header.delete 'content-length'
|
@@ -1499,7 +1533,7 @@ module Net #:nodoc:
|
|
1499
1533
|
end
|
1500
1534
|
|
1501
1535
|
# Returns "true" if the "transfer-encoding" header is present and
|
1502
|
-
# set to "chunked". This is an HTTP/1.1 feature, allowing the
|
1536
|
+
# set to "chunked". This is an HTTP/1.1 feature, allowing the
|
1503
1537
|
# the content to be sent in "chunks" without at the outset
|
1504
1538
|
# stating the entire content length.
|
1505
1539
|
def chunked?
|
@@ -1540,7 +1574,7 @@ module Net #:nodoc:
|
|
1540
1574
|
return nil unless @header['content-type']
|
1541
1575
|
self['Content-Type'].split(';').first.to_s.split('/')[0].to_s.strip
|
1542
1576
|
end
|
1543
|
-
|
1577
|
+
|
1544
1578
|
# Returns a content type string such as "html".
|
1545
1579
|
# This method returns nil if Content-Type: header field does not exist
|
1546
1580
|
# or sub-type is not given (e.g. "Content-Type: text").
|
@@ -1583,7 +1617,7 @@ module Net #:nodoc:
|
|
1583
1617
|
# http.form_data = {"q" => "ruby", "lang" => "en"}
|
1584
1618
|
# http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
|
1585
1619
|
# http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
|
1586
|
-
#
|
1620
|
+
#
|
1587
1621
|
def set_form_data(params, sep = '&')
|
1588
1622
|
self.body = params.map {|k, v| encode_kvpair(k, v) }.flatten.join(sep)
|
1589
1623
|
self.content_type = 'application/x-www-form-urlencoded'
|
@@ -1759,14 +1793,14 @@ module Net #:nodoc:
|
|
1759
1793
|
buf << "\r\n"
|
1760
1794
|
sock.write buf
|
1761
1795
|
end
|
1762
|
-
|
1796
|
+
|
1763
1797
|
end
|
1764
1798
|
|
1765
1799
|
|
1766
|
-
#
|
1800
|
+
#
|
1767
1801
|
# HTTP request class. This class wraps request header and entity path.
|
1768
1802
|
# You *must* use its subclass, Net::HTTP::Get, Post, Head.
|
1769
|
-
#
|
1803
|
+
#
|
1770
1804
|
class HTTPRequest < HTTPGenericRequest
|
1771
1805
|
|
1772
1806
|
# Creates HTTP request object.
|
@@ -1906,17 +1940,17 @@ module Net #:nodoc:
|
|
1906
1940
|
# HTTP response class. This class wraps response header and entity.
|
1907
1941
|
# Mixes in the HTTPHeader module, which provides access to response
|
1908
1942
|
# header values both via hash-like methods and individual readers.
|
1909
|
-
# Note that each possible HTTP response code defines its own
|
1943
|
+
# Note that each possible HTTP response code defines its own
|
1910
1944
|
# HTTPResponse subclass. These are listed below.
|
1911
1945
|
# All classes are
|
1912
1946
|
# defined under the Net module. Indentation indicates inheritance.
|
1913
|
-
#
|
1947
|
+
#
|
1914
1948
|
# xxx HTTPResponse
|
1915
|
-
#
|
1949
|
+
#
|
1916
1950
|
# 1xx HTTPInformation
|
1917
|
-
# 100 HTTPContinue
|
1951
|
+
# 100 HTTPContinue
|
1918
1952
|
# 101 HTTPSwitchProtocol
|
1919
|
-
#
|
1953
|
+
#
|
1920
1954
|
# 2xx HTTPSuccess
|
1921
1955
|
# 200 HTTPOK
|
1922
1956
|
# 201 HTTPCreated
|
@@ -1925,7 +1959,7 @@ module Net #:nodoc:
|
|
1925
1959
|
# 204 HTTPNoContent
|
1926
1960
|
# 205 HTTPResetContent
|
1927
1961
|
# 206 HTTPPartialContent
|
1928
|
-
#
|
1962
|
+
#
|
1929
1963
|
# 3xx HTTPRedirection
|
1930
1964
|
# 300 HTTPMultipleChoice
|
1931
1965
|
# 301 HTTPMovedPermanently
|
@@ -1934,7 +1968,7 @@ module Net #:nodoc:
|
|
1934
1968
|
# 304 HTTPNotModified
|
1935
1969
|
# 305 HTTPUseProxy
|
1936
1970
|
# 307 HTTPTemporaryRedirect
|
1937
|
-
#
|
1971
|
+
#
|
1938
1972
|
# 4xx HTTPClientError
|
1939
1973
|
# 400 HTTPBadRequest
|
1940
1974
|
# 401 HTTPUnauthorized
|
@@ -1954,7 +1988,7 @@ module Net #:nodoc:
|
|
1954
1988
|
# 415 HTTPUnsupportedMediaType
|
1955
1989
|
# 416 HTTPRequestedRangeNotSatisfiable
|
1956
1990
|
# 417 HTTPExpectationFailed
|
1957
|
-
#
|
1991
|
+
#
|
1958
1992
|
# 5xx HTTPServerError
|
1959
1993
|
# 500 HTTPInternalServerError
|
1960
1994
|
# 501 HTTPNotImplemented
|
@@ -1962,7 +1996,7 @@ module Net #:nodoc:
|
|
1962
1996
|
# 503 HTTPServiceUnavailable
|
1963
1997
|
# 504 HTTPGatewayTimeOut
|
1964
1998
|
# 505 HTTPVersionNotSupported
|
1965
|
-
#
|
1999
|
+
#
|
1966
2000
|
# xxx HTTPUnknownResponse
|
1967
2001
|
#
|
1968
2002
|
class HTTPResponse
|
@@ -2235,7 +2269,7 @@ module Net #:nodoc:
|
|
2235
2269
|
|
2236
2270
|
# next is to fix bug in RDoc, where the private inside class << self
|
2237
2271
|
# spills out.
|
2238
|
-
public
|
2272
|
+
public
|
2239
2273
|
|
2240
2274
|
include HTTPHeader
|
2241
2275
|
|
@@ -2268,7 +2302,7 @@ module Net #:nodoc:
|
|
2268
2302
|
# To allow Net::HTTP 1.1 style assignment
|
2269
2303
|
# e.g.
|
2270
2304
|
# response, body = Net::HTTP.get(....)
|
2271
|
-
#
|
2305
|
+
#
|
2272
2306
|
def to_ary
|
2273
2307
|
warn "net/http.rb: warning: Net::HTTP v1.1 style assignment found at #{caller(1)[0]}; use `response = http.get(...)' instead." if $VERBOSE
|
2274
2308
|
res = self.dup
|