rhodes 2.1.0 → 2.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/README.textile +4 -5
- data/Rakefile +8 -1
- data/lib/build/jake.rb +22 -16
- data/lib/extensions/rhoxml/rexml/cdata.rb +67 -0
- data/lib/extensions/rhoxml/rexml/document.rb +2 -116
- data/lib/extensions/rhoxml/rexml/element.rb +1 -1
- data/lib/extensions/rhoxml/rexml/text.rb +117 -0
- data/lib/framework/rho/render.rb +19 -11
- data/lib/framework/rho/rho.rb +17 -10
- data/lib/framework/rho/rhobluetooth.rb +103 -0
- data/lib/framework/rho/rhocontroller.rb +2 -0
- data/lib/framework/rho/rhoevent.rb +43 -0
- data/lib/framework/rho/rhoevent_bb.rb +80 -0
- data/lib/framework/rho/rhoevent_c.rb +47 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/rhom/rhom_db_adapter.rb +2 -1
- data/lib/framework/rhom/rhom_model.rb +9 -3
- data/lib/framework/rhom/rhom_object_factory.rb +46 -22
- data/lib/framework/rhom/rhom_source.rb +12 -10
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +23 -2
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +54 -38
- data/platform/android/Rhodes/jni/include/rhodes.h +3 -0
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +4 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +16 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_bluetooth_RhoBluetoothManager.h +21 -0
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +169 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +10 -0
- data/platform/android/Rhodes/jni/src/event.cpp +429 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +51 -1
- data/platform/android/Rhodes/jni/src/rhodes.cpp +16 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -0
- data/platform/android/Rhodes/res/layout/bt_device_list.xml +42 -0
- data/platform/android/Rhodes/res/layout/bt_device_name.xml +7 -0
- data/platform/android/Rhodes/res/values/strings.xml +8 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +14 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Push.java +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +58 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +8 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +144 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +66 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothDeviceListActivity.java +201 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +139 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +401 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +136 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +457 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/UUIDHelper.java +71 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +12 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +19 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +261 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +4 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +10 -2
- data/platform/android/build/RhodesSRC_build.files +33 -22
- data/platform/android/build/android.rake +198 -27
- data/platform/android/build/librhodes_build.files +3 -1
- data/platform/android/build/libruby_build.files +4 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +2 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +7 -4
- data/platform/bb/Hsqldb/src/org/hsqldb/Like.java +3 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +3 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +1 -1
- data/platform/bb/RubyVM/RubyVM.jdp +1 -0
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +108 -1
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +7 -1
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +7 -4
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +7 -1
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +21 -23
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +19 -10
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +8 -0
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +3 -0
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +14 -17
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyFile.java +7 -5
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +2 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyRuntime.java +10 -1
- data/platform/bb/RubyVM/src/j2me/io/File.java +7 -6
- data/platform/bb/build/RubyVM_build.files +412 -412
- data/platform/bb/build/bb.rake +42 -18
- data/platform/bb/build/hsqldb_build.files +151 -151
- data/platform/bb/build/rhodes_build.files +44 -40
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +2 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +237 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhodesApplicationPlatform.java +14 -0
- data/platform/bb/rhodes/rhodes.jdp +6 -1
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +7 -1
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +14 -0
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +62 -76
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +660 -0
- data/platform/bb/rhodes/src/{rhomobile → com/rho/rubyext}/RhoPhonebook.java +95 -38
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +22 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +26 -6
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +21 -7
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothManager.java +528 -0
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothPort.java +281 -0
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothScreen.java +119 -0
- data/platform/bb/rhodes/src/rhomobile/camera/CameraFilesListener.java +2 -2
- data/platform/iphone/Classes/AppManager/AppManager.m +70 -7
- data/platform/iphone/Classes/Bluetooth/Bluetooth.h +72 -0
- data/platform/iphone/Classes/Bluetooth/Bluetooth.m +414 -0
- data/platform/iphone/Classes/Event/Event.h +12 -0
- data/platform/iphone/Classes/Event/Event.m +300 -0
- data/platform/iphone/Classes/LogOptionsController.h +2 -1
- data/platform/iphone/Classes/LogOptionsController.m +1 -1
- data/platform/iphone/Classes/LogViewController.h +2 -1
- data/platform/iphone/Classes/MapView/MapViewController.h +2 -1
- data/platform/iphone/Classes/RhoViewController.h +16 -0
- data/platform/iphone/Classes/RhoViewController.m +20 -0
- data/platform/iphone/Classes/Rhodes.h +12 -0
- data/platform/iphone/Classes/Rhodes.m +34 -6
- data/platform/iphone/Classes/Signature/SignatureViewController.h +2 -2
- data/platform/iphone/Classes/Signature/SignatureViewController.m +0 -10
- data/platform/iphone/Classes/SimpleMainView.h +2 -2
- data/platform/iphone/Classes/SimpleMainView.m +5 -14
- data/platform/iphone/Classes/SplashViewController.h +2 -2
- data/platform/iphone/Classes/TabbedMainView.h +2 -2
- data/platform/iphone/Classes/TabbedMainView.m +5 -10
- data/platform/iphone/Info.plist +5 -5
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +39 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +47 -4
- data/platform/osx/Rhodes Debugger/NoodleLineNumberView.m +3 -2
- data/platform/shared/common/AutoPointer.h +3 -0
- data/platform/shared/common/RhoConf.cpp +2 -1
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhoTime.h +3 -3
- data/platform/shared/common/RhodesApp.cpp +75 -23
- data/platform/shared/common/RhodesApp.h +4 -0
- data/platform/shared/common/RhodesAppBase.h +2 -0
- data/platform/shared/common/ThreadQueue.cpp +23 -18
- data/platform/shared/common/ThreadQueue.h +2 -0
- data/platform/shared/db/res/db/syncdb.schema +39 -39
- data/platform/shared/logging/RhoLogConf.cpp +58 -3
- data/platform/shared/logging/RhoLogConf.h +3 -1
- data/platform/shared/net/CURLNetRequest.cpp +17 -6
- data/platform/shared/net/HttpServer.cpp +125 -25
- data/platform/shared/net/HttpServer.h +4 -3
- data/platform/shared/ruby/ext/bluetooth/bluetooth.i +56 -0
- data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +2563 -0
- data/platform/shared/ruby/ext/calendar/calendar.i +28 -0
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +2251 -0
- data/platform/shared/ruby/ext/calendar/event.h +41 -0
- data/platform/shared/ruby/ext/calendar/event.i +28 -0
- data/platform/shared/ruby/ext/calendar/event_wrap.c +2151 -0
- data/platform/shared/ruby/ext/rho/rhoruby.c +103 -3
- data/platform/shared/ruby/ext/rho/rhoruby.h +16 -2
- data/platform/shared/ruby/ext/rhoconf/rhoconf.i +12 -0
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +101 -0
- data/platform/shared/ruby/ext/system/system.i +14 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +2568 -2208
- data/platform/shared/ruby/main.c +8 -0
- data/platform/shared/rubyext/GeoLocation.cpp +6 -3
- data/platform/shared/rubyext/System.cpp +14 -0
- data/platform/shared/sync/SyncEngine.cpp +9 -1
- data/platform/shared/sync/SyncNotify.cpp +16 -8
- data/platform/shared/sync/SyncNotify.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +7 -12
- data/platform/shared/sync/SyncThread.h +5 -3
- data/platform/wm/build/wm.rake +7 -1
- data/platform/wm/rhodes/Alert.cpp +1 -1
- data/platform/wm/rhodes/MainWindow.cpp +28 -0
- data/platform/wm/rhodes/MainWindow.h +9 -0
- data/platform/wm/rhodes/OutlookApp.cpp +72 -0
- data/platform/wm/rhodes/OutlookApp.h +22 -0
- data/platform/wm/rhodes/Rhodes.cpp +8 -0
- data/platform/wm/rhodes/Rhodes.rc +31 -0
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +1274 -0
- data/platform/wm/rhodes/bluetooth/Bluetooth.h +321 -0
- data/platform/wm/rhodes/phonebook/NativeAddressBook.cpp +37 -70
- data/platform/wm/rhodes/phonebook/NativeAddressBook.h +0 -4
- data/platform/wm/rhodes/resource.h +8 -1
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +4 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +6 -4
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +487 -0
- data/platform/wm/rhodes/rhodes.vcproj +28 -11
- data/platform/wm/rhodes/stdafx.h +1 -0
- data/platform/wm/rubylib/rubylib.vcproj +32 -0
- data/rakefile.rb +8 -1
- data/res/generators/templates/application/Rakefile +1 -1
- data/res/generators/templates/application/app/layout.erb +4 -1
- data/res/generators/templates/application/build.yml +0 -1
- data/res/generators/templates/application/public/css/iphone.css +2 -2
- data/res/generators/templates/application/public/jqtouch/jqtouch-iphone.css +9 -0
- data/res/generators/templates/application/public/jqtouch/jqtouch.css +1 -5
- data/res/generators/templates/application/public/jqtouch/jqtouch.js +3 -2
- data/rhodes.gemspec +1 -1
- data/spec/perfomance_spec/app/Benchmark/benchmark.rb +4 -0
- data/spec/perfomance_spec/app/Benchmark/bulk_results.erb +13 -0
- data/spec/perfomance_spec/app/Benchmark/controller.rb +178 -0
- data/spec/perfomance_spec/app/Benchmark/create_results.erb +13 -0
- data/spec/perfomance_spec/app/Benchmark/customers.erb +35 -0
- data/spec/perfomance_spec/app/Benchmark/index.erb +9 -0
- data/spec/perfomance_spec/app/Benchmark/products.erb +25 -0
- data/spec/perfomance_spec/app/Benchmark/search_results.erb +13 -0
- data/spec/perfomance_spec/app/Customer/customer.rb +6 -0
- data/spec/perfomance_spec/app/Perftest/index.erb +5 -0
- data/spec/perfomance_spec/app/Product/index.erb +25 -0
- data/spec/perfomance_spec/app/Product/product.rb +6 -0
- data/spec/perfomance_spec/app/helpers/application_helper.rb +126 -0
- data/spec/perfomance_spec/app/helpers/browser_helper.rb +18 -0
- data/spec/perfomance_spec/rhoconfig.txt +1 -1
- data/spec/phone_spec/app/Account_s/account_s.rb +5 -2
- data/spec/phone_spec/app/Case/case.rb +1 -0
- data/spec/phone_spec/app/Case_s/case_s.rb +2 -0
- data/spec/phone_spec/app/Data/perftest.json +35 -0
- data/spec/phone_spec/app/Data/testCDATA.xml +11 -0
- data/spec/phone_spec/app/Product/product.rb +1 -1
- data/spec/phone_spec/app/{Spec → spec}/asynchttp_spec.rb +66 -17
- data/spec/phone_spec/app/{Spec → spec}/barcode_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/blobsync_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/bsearch_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/bulksync_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/contacts_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/crypt_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/date_spec.rb +0 -0
- data/spec/phone_spec/app/spec/events_spec.rb +199 -0
- data/spec/phone_spec/app/{Spec → spec}/fixtures/client_info.txt +0 -0
- data/spec/phone_spec/app/{Spec → spec}/fixtures/object_values.txt +0 -0
- data/spec/phone_spec/app/{Spec → spec}/json_spec.rb +11 -2
- data/spec/phone_spec/app/{Spec → spec}/mapview_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/nativebar_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/navbar_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/pagination/fixtures/object_values.txt +0 -0
- data/spec/phone_spec/app/{Spec → spec}/rho_controller_spec.rb +5 -0
- data/spec/phone_spec/app/{Spec → spec}/rho_spec.rb +48 -0
- data/spec/phone_spec/app/{Spec → spec}/rhofile_spec.rb +9 -6
- data/spec/phone_spec/app/{Spec → spec}/rhom_object_spec.rb +188 -9
- data/spec/phone_spec/app/{Spec → spec}/syncengine_spec.rb +0 -0
- data/spec/phone_spec/app/{Spec → spec}/xml_spec.rb +15 -0
- data/spec/phone_spec/app/{Spec → spec}/xruby_spec.rb +0 -0
- data/spec/phone_spec/app/spec_runner.rb +4 -1
- data/spec/phone_spec/build.yml +2 -1
- metadata +95 -31
- data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +0 -36
- data/platform/bb/rhodes/platform/6.0/com/rho/BrowserAdapter5.java +0 -155
- data/platform/bb/rhodes/platform/6.0/com/rho/RhoMainScreen.java +0 -36
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 2.2.0
|
2
|
+
* Bluetooth for all platforms
|
3
|
+
* Calendar support for all platforms
|
4
|
+
* Push support for Android
|
5
|
+
* Enable\Disable rotation flag implemented for iPhone
|
6
|
+
* Enable\Disable screen sleep for Blackberry, iPhone and Android
|
7
|
+
|
1
8
|
## 2.1.0
|
2
9
|
* iPhone 4 support
|
3
10
|
* Barcode recognize for all platforms
|
data/README.textile
CHANGED
@@ -16,15 +16,15 @@ Install Rhodes:
|
|
16
16
|
|
17
17
|
h2. APPLICATION GENERATOR
|
18
18
|
|
19
|
-
Rhodes features an application generator called
|
19
|
+
Rhodes features an application generator called 'rhodes' that generates a controller and views for a given model. The syntax for running Rhodes is:
|
20
20
|
|
21
|
-
|
21
|
+
rhodes app appname
|
22
22
|
|
23
23
|
This will generate a config.rb and an index.html file. Currently config.rb is focused on describing what source to sync with. Modify the URL that you see in this file with whatever your RhoSync server URL and source ID are for this particular "source" or data model. It is assumed that you've already set up a RhoSync "source adapter" as described by the "RhoSync docs":http://wiki.rhomobile.com/index.php/RhoSync.
|
24
24
|
|
25
25
|
h3. Generate a Model and Associated Controller and Templates
|
26
26
|
|
27
|
-
|
27
|
+
rhodes model modelname options
|
28
28
|
|
29
29
|
This will generate a controller as the file controller.rb and several views as action-name.erb (corresponding to the actions below). Each Rhodes model/controller pair has several actions to perform basic CRUD (create, read, update and delete) on the object generated by default by the scaffold . Specifically the template views generated are:
|
30
30
|
|
@@ -42,5 +42,4 @@ The "Rhodes Developer Reference":http://wiki.rhomobile.com/index.php/Rhodes for
|
|
42
42
|
|
43
43
|
For further questions "email us":mailto:info@rhomobile.com or join the "Google Group":http://groups.google.com/group/rhomobile.
|
44
44
|
|
45
|
-
For questions on licensing contact "our sales team":mailto:sales@rhomobile.com
|
46
|
-
|
45
|
+
For questions on licensing contact "our sales team":mailto:sales@rhomobile.com
|
data/Rakefile
CHANGED
@@ -63,9 +63,16 @@ namespace "config" do
|
|
63
63
|
|
64
64
|
if RUBY_PLATFORM =~ /(win|w)32$/
|
65
65
|
$all_files_mask = "*.*"
|
66
|
+
$rubypath = "res/build-tools/RhoRuby.exe"
|
66
67
|
else
|
67
68
|
$all_files_mask = "*"
|
69
|
+
if RUBY_PLATFORM =~ /darwin/
|
70
|
+
$rubypath = "res/build-tools/RubyMac"
|
71
|
+
else
|
72
|
+
$rubypath = "res/build-tools/rubylinux"
|
73
|
+
end
|
68
74
|
end
|
75
|
+
|
69
76
|
if $app_path.nil? #if we are called from the rakefile directly, this wont be set
|
70
77
|
#load the apps path and config
|
71
78
|
|
@@ -768,7 +775,7 @@ namespace "build" do
|
|
768
775
|
# desc "Build rhosync-client package"
|
769
776
|
task :rhosync_client do
|
770
777
|
|
771
|
-
ver = File.read("rhosync-client/version") #.gsub(".", "_")
|
778
|
+
ver = File.read("rhosync-client/version").chomp #.gsub(".", "_")
|
772
779
|
zip_name = "rhosync-client-"+ver+".zip"
|
773
780
|
|
774
781
|
bin_dir = "rhosync-client-bin"
|
data/lib/build/jake.rb
CHANGED
@@ -179,7 +179,7 @@ class Jake
|
|
179
179
|
$getdump = true
|
180
180
|
end
|
181
181
|
|
182
|
-
return
|
182
|
+
return ($failed == 0)
|
183
183
|
end
|
184
184
|
|
185
185
|
def self.process_spec_results(start)
|
@@ -264,11 +264,14 @@ class Jake
|
|
264
264
|
end
|
265
265
|
|
266
266
|
def self.unjar(src,targetdir)
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
267
|
+
jpath = $config["env"]["paths"]["java"]
|
268
|
+
cmd = jpath && jpath.length()>0 ? File.join(jpath, "jar" ) : "jar"
|
269
|
+
|
270
|
+
# if RUBY_PLATFORM =~ /(win|w)32$/
|
271
|
+
# cmd = $config["env"]["paths"]["java"] + "/jar.exe"
|
272
|
+
# else
|
273
|
+
# cmd = $config["env"]["paths"]["java"] + "/jar"
|
274
|
+
# end
|
272
275
|
|
273
276
|
p = Pathname.new(src)
|
274
277
|
src = p.realpath
|
@@ -284,12 +287,16 @@ class Jake
|
|
284
287
|
puts run(cmd,args)
|
285
288
|
chdir currentdir
|
286
289
|
end
|
290
|
+
|
287
291
|
def self.jarfilelist(target)
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
292
|
+
jpath = $config["env"]["paths"]["java"]
|
293
|
+
cmd = jpath && jpath.length()>0 ? File.join(jpath, "jar" ) : "jar"
|
294
|
+
|
295
|
+
# if RUBY_PLATFORM =~ /(win|w)32$/
|
296
|
+
# cmd = $config["env"]["paths"]["java"] + "/jar.exe"
|
297
|
+
# else
|
298
|
+
# cmd = $config["env"]["paths"]["java"] + "/jar"
|
299
|
+
# end
|
293
300
|
target.gsub!(/"/,"")
|
294
301
|
|
295
302
|
args = []
|
@@ -303,11 +310,10 @@ class Jake
|
|
303
310
|
end
|
304
311
|
|
305
312
|
def self.jar(target,manifest,files,isfolder=false)
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
end
|
313
|
+
jpath = $config["env"]["paths"]["java"]
|
314
|
+
cmd = jpath && jpath.length()>0 ? File.join(jpath, "jar" ) : "jar"
|
315
|
+
#cmd += ".exe" if RUBY_PLATFORM =~ /(win|w)32$/
|
316
|
+
|
311
317
|
target.gsub!(/"/,"")
|
312
318
|
|
313
319
|
args = []
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require "rexml/text"
|
2
|
+
|
3
|
+
module REXML
|
4
|
+
class CData < Text
|
5
|
+
START = '<![CDATA['
|
6
|
+
STOP = ']]>'
|
7
|
+
ILLEGAL = /(\]\]>)/
|
8
|
+
|
9
|
+
# Constructor. CData is data between <![CDATA[ ... ]]>
|
10
|
+
#
|
11
|
+
# _Examples_
|
12
|
+
# CData.new( source )
|
13
|
+
# CData.new( "Here is some CDATA" )
|
14
|
+
# CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
|
15
|
+
def initialize( first, whitespace=true, parent=nil )
|
16
|
+
super( first, whitespace, parent, false, true ) #, ILLEGAL )
|
17
|
+
end
|
18
|
+
|
19
|
+
# Make a copy of this object
|
20
|
+
#
|
21
|
+
# _Examples_
|
22
|
+
# c = CData.new( "Some text" )
|
23
|
+
# d = c.clone
|
24
|
+
# d.to_s # -> "Some text"
|
25
|
+
def clone
|
26
|
+
CData.new self
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns the content of this CData object
|
30
|
+
#
|
31
|
+
# _Examples_
|
32
|
+
# c = CData.new( "Some text" )
|
33
|
+
# c.to_s # -> "Some text"
|
34
|
+
def to_s
|
35
|
+
@string
|
36
|
+
end
|
37
|
+
|
38
|
+
def value
|
39
|
+
@string
|
40
|
+
end
|
41
|
+
|
42
|
+
# == DEPRECATED
|
43
|
+
# See the rexml/formatters package
|
44
|
+
#
|
45
|
+
# Generates XML output of this object
|
46
|
+
#
|
47
|
+
# output::
|
48
|
+
# Where to write the string. Defaults to $stdout
|
49
|
+
# indent::
|
50
|
+
# The amount to indent this node by
|
51
|
+
# transitive::
|
52
|
+
# Ignored
|
53
|
+
# ie_hack::
|
54
|
+
# Ignored
|
55
|
+
#
|
56
|
+
# _Examples_
|
57
|
+
# c = CData.new( " Some text " )
|
58
|
+
# c.write( $stdout ) #-> <![CDATA[ Some text ]]>
|
59
|
+
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
|
60
|
+
Kernel.warn( "#{self.class.name}.write is deprecated" )
|
61
|
+
indent( output, indent )
|
62
|
+
output << START
|
63
|
+
output << @string
|
64
|
+
output << STOP
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rexml/element"
|
2
2
|
#require "rexml/xmldecl"
|
3
|
-
|
3
|
+
require 'rexml/text'
|
4
4
|
require "rexml/source"
|
5
5
|
#require "rexml/doctype"
|
6
6
|
=begin
|
@@ -422,119 +422,5 @@ module REXML
|
|
422
422
|
end
|
423
423
|
end
|
424
424
|
|
425
|
-
|
426
|
-
include Comparable
|
427
|
-
|
428
|
-
attr_accessor :raw
|
429
|
-
|
430
|
-
def initialize(arg, respect_whitespace=false, parent=nil, raw=nil,
|
431
|
-
entity_filter=nil )
|
432
|
-
|
433
|
-
@raw = false
|
434
|
-
|
435
|
-
if parent
|
436
|
-
super( parent )
|
437
|
-
@raw = parent.raw
|
438
|
-
else
|
439
|
-
@parent = nil
|
440
|
-
end
|
441
|
-
|
442
|
-
@raw = raw unless raw.nil?
|
443
|
-
@entity_filter = entity_filter
|
444
|
-
@normalized = @unnormalized = nil
|
445
|
-
|
446
|
-
if arg.kind_of? String
|
447
|
-
@string = arg.clone
|
448
|
-
@string.squeeze!(" \n\t") unless respect_whitespace
|
449
|
-
else
|
450
|
-
if arg.kind_of? Text
|
451
|
-
@string = arg.to_s
|
452
|
-
@raw = arg.raw
|
453
|
-
else
|
454
|
-
raise "Illegal argument of type #{arg.type} for Text constructor (#{arg})"
|
455
|
-
end
|
456
|
-
end
|
457
|
-
|
458
|
-
@string.gsub!( /\r\n?/, "\n" )
|
459
|
-
end
|
460
|
-
|
461
|
-
def node_type
|
462
|
-
:text
|
463
|
-
end
|
464
|
-
|
465
|
-
def empty?
|
466
|
-
@string.size==0
|
467
|
-
end
|
468
|
-
|
469
|
-
|
470
|
-
def clone
|
471
|
-
return Text.new(self)
|
472
|
-
end
|
473
|
-
|
474
|
-
|
475
|
-
# Appends text to this text node. The text is appended in the +raw+ mode
|
476
|
-
# of this text node.
|
477
|
-
def <<( to_append )
|
478
|
-
@string << to_append.gsub( /\r\n?/, "\n" )
|
479
|
-
end
|
480
|
-
|
481
|
-
|
482
|
-
# +other+ a String or a Text
|
483
|
-
# +returns+ the result of (to_s <=> arg.to_s)
|
484
|
-
def <=>( other )
|
485
|
-
to_s() <=> other.to_s
|
486
|
-
end
|
487
|
-
|
488
|
-
def doctype
|
489
|
-
if @parent
|
490
|
-
doc = @parent.document
|
491
|
-
doc.doctype if doc
|
492
|
-
end
|
493
|
-
end
|
494
|
-
|
495
|
-
def to_s
|
496
|
-
@string
|
497
|
-
end
|
498
|
-
|
499
|
-
def inspect
|
500
|
-
@string.inspect
|
501
|
-
end
|
502
|
-
|
503
|
-
def value
|
504
|
-
#TODO:
|
505
|
-
return @unnormalized if @unnormalized
|
506
|
-
@unnormalized = Text::unnormalize( @string, doctype )
|
507
|
-
|
508
|
-
@unnormalized
|
509
|
-
end
|
510
|
-
|
511
|
-
#TODO optimize it - regular expressions is slow on BB
|
512
|
-
def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
|
513
|
-
string.to_s.gsub(/\&/, "&").gsub(/\"/, "\"").gsub(/\>/, ">").gsub(/\</, "<")
|
514
|
-
end
|
515
|
-
=begin
|
516
|
-
def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
|
517
|
-
string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
|
518
|
-
ref = $&
|
519
|
-
if ref[1] == ?#
|
520
|
-
if ref[2] == ?x
|
521
|
-
[ref[3...-1].to_i(16)].pack('U*')
|
522
|
-
else
|
523
|
-
[ref[2...-1].to_i].pack('U*')
|
524
|
-
end
|
525
|
-
elsif ref == '&'
|
526
|
-
'&'
|
527
|
-
elsif filter and filter.include?( ref[1...-1] )
|
528
|
-
ref
|
529
|
-
elsif doctype
|
530
|
-
doctype.entity( ref[1...-1] ) or ref
|
531
|
-
else
|
532
|
-
entity_value = DocType::DEFAULT_ENTITIES[ ref[1...-1] ]
|
533
|
-
entity_value ? entity_value.value : ref
|
534
|
-
end
|
535
|
-
}
|
536
|
-
end
|
537
|
-
=end
|
538
|
-
end
|
539
|
-
|
425
|
+
|
540
426
|
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require "rexml/child"
|
2
|
+
|
3
|
+
module REXML
|
4
|
+
class Text < Child
|
5
|
+
include Comparable
|
6
|
+
|
7
|
+
attr_accessor :raw
|
8
|
+
|
9
|
+
def initialize(arg, respect_whitespace=false, parent=nil, raw=nil, entity_filter=nil )
|
10
|
+
|
11
|
+
@raw = false
|
12
|
+
|
13
|
+
if parent
|
14
|
+
super( parent )
|
15
|
+
@raw = parent.raw
|
16
|
+
else
|
17
|
+
@parent = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
@raw = raw unless raw.nil?
|
21
|
+
@entity_filter = entity_filter
|
22
|
+
@normalized = @unnormalized = nil
|
23
|
+
|
24
|
+
if arg.kind_of? String
|
25
|
+
@string = arg.clone
|
26
|
+
@string.squeeze!(" \n\t") unless respect_whitespace
|
27
|
+
else
|
28
|
+
if arg.kind_of? Text
|
29
|
+
@string = arg.to_s
|
30
|
+
@raw = arg.raw
|
31
|
+
else
|
32
|
+
raise "Illegal argument of type #{arg.type} for Text constructor (#{arg})"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
@string.gsub!( /\r\n?/, "\n" )
|
37
|
+
end
|
38
|
+
|
39
|
+
def node_type
|
40
|
+
:text
|
41
|
+
end
|
42
|
+
|
43
|
+
def empty?
|
44
|
+
@string.size==0
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
def clone
|
49
|
+
return Text.new(self)
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
# Appends text to this text node. The text is appended in the +raw+ mode
|
54
|
+
# of this text node.
|
55
|
+
def <<( to_append )
|
56
|
+
@string << to_append.gsub( /\r\n?/, "\n" )
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
# +other+ a String or a Text
|
61
|
+
# +returns+ the result of (to_s <=> arg.to_s)
|
62
|
+
def <=>( other )
|
63
|
+
to_s() <=> other.to_s
|
64
|
+
end
|
65
|
+
|
66
|
+
def doctype
|
67
|
+
if @parent
|
68
|
+
doc = @parent.document
|
69
|
+
doc.doctype if doc
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def to_s
|
74
|
+
@string
|
75
|
+
end
|
76
|
+
|
77
|
+
def inspect
|
78
|
+
@string.inspect
|
79
|
+
end
|
80
|
+
|
81
|
+
def value
|
82
|
+
#TODO:
|
83
|
+
return @unnormalized if @unnormalized
|
84
|
+
@unnormalized = Text::unnormalize( @string, doctype )
|
85
|
+
|
86
|
+
@unnormalized
|
87
|
+
end
|
88
|
+
|
89
|
+
#TODO optimize it - regular expressions is slow on BB
|
90
|
+
def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
|
91
|
+
string.to_s.gsub(/\&/, "&").gsub(/\"/, "\"").gsub(/\>/, ">").gsub(/\</, "<")
|
92
|
+
end
|
93
|
+
=begin
|
94
|
+
def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
|
95
|
+
string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
|
96
|
+
ref = $&
|
97
|
+
if ref[1] == ?#
|
98
|
+
if ref[2] == ?x
|
99
|
+
[ref[3...-1].to_i(16)].pack('U*')
|
100
|
+
else
|
101
|
+
[ref[2...-1].to_i].pack('U*')
|
102
|
+
end
|
103
|
+
elsif ref == '&'
|
104
|
+
'&'
|
105
|
+
elsif filter and filter.include?( ref[1...-1] )
|
106
|
+
ref
|
107
|
+
elsif doctype
|
108
|
+
doctype.entity( ref[1...-1] ) or ref
|
109
|
+
else
|
110
|
+
entity_value = DocType::DEFAULT_ENTITIES[ ref[1...-1] ]
|
111
|
+
entity_value ? entity_value.value : ref
|
112
|
+
end
|
113
|
+
}
|
114
|
+
end
|
115
|
+
=end
|
116
|
+
end
|
117
|
+
end
|