rhodes 2.3.0.beta.1 → 2.3.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -74,7 +74,7 @@ def make_application_build_config_header_file
74
74
 
75
75
  f.puts 'static const char* values[] = { ""'
76
76
  $application_build_configs.keys.each do |key|
77
- f.puts ',"'+$application_build_configs[key]+'"'
77
+ f.puts ',"'+$application_build_configs[key].to_s+'"'
78
78
  count = count + 1
79
79
  end
80
80
  f.puts '};'
data/doc/device-caps.txt CHANGED
@@ -866,6 +866,7 @@ NOTE: in order to use it on Android, you need to install Google Add-on API and r
866
866
 
867
867
  :::ruby
868
868
  map_params = {
869
+ :provider => 'Google',
869
870
  :settings => {:map_type => "hybrid",:region => [@params['latitude'], @params['longitude'], 0.2, 0.2],
870
871
  :zoom_enabled => true,:scroll_enabled => true,:shows_user_location => false,
871
872
  :api_key => 'Google Maps API Key'},
@@ -877,6 +878,16 @@ NOTE: in order to use it on Android, you need to install Google Add-on API and r
877
878
  }
878
879
  MapView.create map_params
879
880
 
881
+
882
+ Provider:
883
+
884
+ There are two providers supported now - 'Google' and 'ESRI'. 'Google supported on iPhone, Android and BB. 'ESRI' supported on iPhone, Android, BB and WM.
885
+
886
+ For use ESRI maps in your projects on iPhone:
887
+
888
+ * Install [http://resources.arcgis.com/content/arcgis-iphone/api ESRI iOS SDK] - use default folders during installations !
889
+ * Add "esri" to your applications extensions list in build.yml file.
890
+
880
891
  Map settings:
881
892
 
882
893
  * map_type - widget may display maps of three types: standard, satellite, and hybrid
@@ -11,26 +11,65 @@ class Time
11
11
  str
12
12
  end
13
13
 
14
- def strftime(fmt='%F')
14
+ def __getPM()
15
+ strPM = 'AM'
16
+ nHour = hour();
17
+ if nHour >= 12
18
+ strPM = 'PM'
19
+ nHour = nHour-12 if nHour > 12
20
+ end
21
+
22
+ return strPM, nHour
23
+ end
15
24
 
25
+ def strftime(fmt='%F')
16
26
  if fmt == "%m/%d/%Y, %I:%M%p"
17
27
  strRes = ""
18
- strPM = 'AM'
19
- nHour = hour();
20
- if nHour >= 12
21
- strPM = 'PM'
22
- nHour = nHour-12 if nHour > 12
23
- end
24
-
28
+ strPM, nHour = __getPM()
29
+
25
30
  strRes += __makeTwoDigit(mon()) + '/' + __makeTwoDigit(mday()) + '/' + year().to_s + ', ' + __makeTwoDigit(nHour) + ':' + __makeTwoDigit(min()) + strPM;
26
31
  return strRes
27
32
  elsif fmt == "%Y%m%dT%H%M%S.000 GMT"
28
33
  strRes = year().to_s() + __makeTwoDigit(mon()) + __makeTwoDigit(mday()) + "T" + __makeTwoDigit(hour()) + __makeTwoDigit(min()) + __makeTwoDigit(sec()) +
29
34
  ".000 GMT"
30
35
 
31
- return strRes
36
+ return strRes
37
+ elsif fmt == '%a %b %d %Y'
38
+ strRes = LocalizationSimplified::DateHelper::AbbrDaynames[wday()] + ' ' + LocalizationSimplified::DateHelper::AbbrMonthnames[mon()] + ' ' + __makeTwoDigit(mday()) + ' ' + year().to_s()
39
+ return strRes
40
+ elsif fmt == '%d %Y'
41
+ strRes = "Test"
42
+ return strRes
43
+ elsif fmt == '%Y%m%d'
44
+ strRes = year().to_s() + __makeTwoDigit(mon()) + __makeTwoDigit(mday())
45
+ return strRes
46
+ elsif fmt == '%a'
47
+ strRes = LocalizationSimplified::DateHelper::AbbrDaynames[wday()]
48
+ return strRes
49
+ elsif fmt == '%b'
50
+ strRes = LocalizationSimplified::DateHelper::AbbrMonthnames[mon()]
51
+ return strRes
52
+ elsif fmt == '%d'
53
+ strRes = __makeTwoDigit(mday())
54
+ return strRes
55
+ elsif fmt == '%Y'
56
+ strRes = year().to_s()
57
+ return strRes
58
+ elsif fmt == '%M'
59
+ strRes = __makeTwoDigit(min())
60
+ return strRes
61
+ elsif fmt == '%H'
62
+ strRes = __makeTwoDigit(hour())
63
+ return strRes
64
+ elsif fmt == '%p'
65
+ strPM, nHour = __getPM()
66
+ strRes = strPM
67
+ return strRes
68
+
32
69
  end
33
-
70
+
71
+ #puts "strftime: " + fmt
72
+
34
73
  DateTime.new(self).strftime(fmt)
35
74
  end
36
75
 
@@ -46,7 +85,9 @@ class Date
46
85
  Date.new( Time.strptime(str,fmt) )
47
86
  end
48
87
 
49
- def to_s() format('%.4d-%02d-%02d', year(), mon(), mday()) end # 4p
88
+ def to_s()
89
+ format('%.4d-%02d-%02d', year(), mon(), mday())
90
+ end # 4p
50
91
 
51
92
  def self.civil(y=-4712, m=1, d=1, sg=2299161)
52
93
  Date.new( Time.new(y,m,d) )
@@ -188,7 +188,7 @@ RHO_GLOBAL void rho_sys_run_app(const char *appname, VALUE params)
188
188
  jmethodID mid = getJNIClassStaticMethod(env, cls, "runApplication", "(Ljava/lang/String;Ljava/lang/Object;)V");
189
189
  if (!mid) return;
190
190
  jobject jParams = rho_cast<jobject>(env, params);
191
- env->CallStaticVoidMethod(cls, mid, env->NewStringUTF(appname), jParams);
191
+ env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(appname).get(), jParams);
192
192
  }
193
193
 
194
194
  RHO_GLOBAL void rho_sys_open_url(const char *url)
@@ -198,7 +198,7 @@ RHO_GLOBAL void rho_sys_open_url(const char *url)
198
198
  if (!cls) return;
199
199
  jmethodID mid = getJNIClassStaticMethod(env, cls, "openExternalUrl", "(Ljava/lang/String;)V");
200
200
  if (!mid) return;
201
- env->CallStaticVoidMethod(cls, mid, env->NewStringUTF(url));
201
+ env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(url).get());
202
202
  }
203
203
 
204
204
  RHO_GLOBAL int rho_sys_is_app_installed(const char *appname)
@@ -208,7 +208,7 @@ RHO_GLOBAL int rho_sys_is_app_installed(const char *appname)
208
208
  if (!cls) return 0;
209
209
  jmethodID mid = getJNIClassStaticMethod(env, cls, "isAppInstalled", "(Ljava/lang/String;)Z");
210
210
  if (!mid) return 0;
211
- return (int)env->CallStaticBooleanMethod(cls, mid, env->NewStringUTF(appname));
211
+ return (int)env->CallStaticBooleanMethod(cls, mid, rho_cast<jhstring>(appname).get());
212
212
  }
213
213
 
214
214
  RHO_GLOBAL void rho_sys_app_install(const char *url)
@@ -218,7 +218,7 @@ RHO_GLOBAL void rho_sys_app_install(const char *url)
218
218
  if (!cls) return;
219
219
  jmethodID mid = getJNIClassStaticMethod(env, cls, "installApplication", "(Ljava/lang/String;)V");
220
220
  if (!mid) return;
221
- env->CallStaticVoidMethod(cls, mid, env->NewStringUTF(url));
221
+ env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(url).get());
222
222
  }
223
223
 
224
224
  RHO_GLOBAL void rho_sys_app_uninstall(const char *appname)
@@ -228,5 +228,5 @@ RHO_GLOBAL void rho_sys_app_uninstall(const char *appname)
228
228
  if (!cls) return;
229
229
  jmethodID mid = getJNIClassStaticMethod(env, cls, "uninstallApplication", "(Ljava/lang/String;)V");
230
230
  if (!mid) return;
231
- env->CallStaticVoidMethod(cls, mid, env->NewStringUTF(appname));
231
+ env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(appname).get());
232
232
  }
@@ -165,7 +165,7 @@ jobject event_cast<jobject, VALUE>(VALUE rEvent)
165
165
  RHO_TRACE("eventFromRuby (3)");
166
166
  jmethodID mid = getJNIClassMethod(env, clsEvent, "<init>", "(Ljava/lang/String;)V");
167
167
  if (!mid) return NULL;
168
- jobject jEvent = env->NewObject(clsEvent, mid, env->NewStringUTF(RSTRING_PTR(rId)));
168
+ jobject jEvent = env->NewObject(clsEvent, mid, rho_cast<jhstring>(RSTRING_PTR(rId)).get());
169
169
  if (!jEvent) return NULL;
170
170
 
171
171
  RHO_TRACE("eventFromRuby (4)");
@@ -173,7 +173,7 @@ jobject event_cast<jobject, VALUE>(VALUE rEvent)
173
173
  if (!NIL_P(rTitle))
174
174
  {
175
175
  Check_Type(rTitle, T_STRING);
176
- env->SetObjectField(jEvent, fidTitle, env->NewStringUTF(RSTRING_PTR(rTitle)));
176
+ env->SetObjectField(jEvent, fidTitle, rho_cast<jhstring>(RSTRING_PTR(rTitle)).get());
177
177
  }
178
178
 
179
179
  RHO_TRACE("eventFromRuby (5)");
@@ -196,7 +196,7 @@ jobject event_cast<jobject, VALUE>(VALUE rEvent)
196
196
  if (!NIL_P(rLocation))
197
197
  {
198
198
  Check_Type(rLocation, T_STRING);
199
- env->SetObjectField(jEvent, fidLocation, env->NewStringUTF(RSTRING_PTR(rLocation)));
199
+ env->SetObjectField(jEvent, fidLocation, rho_cast<jhstring>(RSTRING_PTR(rLocation)).get());
200
200
  }
201
201
 
202
202
  RHO_TRACE("eventFromRuby (9)");
@@ -204,7 +204,7 @@ jobject event_cast<jobject, VALUE>(VALUE rEvent)
204
204
  if (!NIL_P(rNotes))
205
205
  {
206
206
  Check_Type(rNotes, T_STRING);
207
- env->SetObjectField(jEvent, fidNotes, env->NewStringUTF(RSTRING_PTR(rNotes)));
207
+ env->SetObjectField(jEvent, fidNotes, rho_cast<jhstring>(RSTRING_PTR(rNotes)).get());
208
208
  }
209
209
 
210
210
  RHO_TRACE("eventFromRuby (10)");
@@ -212,7 +212,7 @@ jobject event_cast<jobject, VALUE>(VALUE rEvent)
212
212
  if (!NIL_P(rPrivacy))
213
213
  {
214
214
  Check_Type(rPrivacy, T_STRING);
215
- env->SetObjectField(jEvent, fidPrivacy, env->NewStringUTF(RSTRING_PTR(rPrivacy)));
215
+ env->SetObjectField(jEvent, fidPrivacy, rho_cast<jhstring>(RSTRING_PTR(rPrivacy)).get());
216
216
  }
217
217
 
218
218
  RHO_TRACE("eventFromRuby: return");
@@ -266,7 +266,7 @@ namespace "config" do
266
266
  $shareddir = File.join($androidpath, "..", "shared")
267
267
  $srcdir = File.join($bindir, "RhoBundle")
268
268
  $targetdir = File.join($bindir, "target")
269
- $excludelib = ['**/builtinME.rb','**/ServeME.rb','**/TestServe.rb']
269
+ $excludelib = ['**/builtinME.rb','**/ServeME.rb','**/dateME.rb','**/rationalME.rb']
270
270
  $tmpdir = File.join($bindir, "tmp")
271
271
  $resourcedir = File.join($tmpdir, "resource")
272
272
  $libs = File.join($androidpath, "Rhodes", "libs")
@@ -190,13 +190,13 @@ namespace "config" do
190
190
 
191
191
  $bbver = $app_config["bbver"].to_s
192
192
  unless $app_config[$current_platform] && $app_config[$current_platform]["ignore_bb6_suffix"] && $app_config[$current_platform]['ignore_bb6_suffix'].to_s == '1'
193
- $bb6 = true if $bbver[0].to_i >= 6
193
+ $bb6 = true if $bbver.split('.')[0].to_i >= 6
194
194
 
195
195
  puts "use bb6 suffix" if $bb6
196
196
  end
197
197
 
198
198
  use_sqlite = $app_config[$current_platform] && $app_config[$current_platform]['use_sqlite'] && $app_config[$current_platform]['use_sqlite'].to_s == '1'
199
- $use_sqlite = $bbver[0].to_i >= 5 && use_sqlite ? true : false
199
+ $use_sqlite = $bbver.split('.')[0].to_i >= 5 && use_sqlite ? true : false
200
200
  puts "$use_sqlite : #{$use_sqlite}"
201
201
 
202
202
  $builddir = $config["build"]["bbpath"] + "/build"
@@ -1034,7 +1034,7 @@ namespace "run" do
1034
1034
 
1035
1035
  task :stopmdsandsim_ex => ["config:bb"] do
1036
1036
 
1037
- stopsim if $bbver[0].to_i < 5
1037
+ stopsim if $bbver.split('.')[0].to_i < 5
1038
1038
 
1039
1039
  stopmds
1040
1040
  end
@@ -1059,7 +1059,7 @@ namespace "run" do
1059
1059
 
1060
1060
  startmds
1061
1061
 
1062
- if $bbver[0].to_i < 5
1062
+ if $bbver.split('.')[0].to_i < 5
1063
1063
  cp_r File.join($targetdir,"/."), jde + "/simulator"
1064
1064
  startsim
1065
1065
  elsif !load_to_sim(false)
@@ -252,7 +252,7 @@ namespace "config" do
252
252
  $bindir = Jake.get_absolute(iphonepath) + "/bin"
253
253
  $srcdir = $bindir + "/RhoBundle"
254
254
  $targetdir = iphonepath + "/target"
255
- $excludelib = ['**/builtinME.rb','**/ServeME.rb','**/TestServe.rb']
255
+ $excludelib = ['**/builtinME.rb','**/ServeME.rb','**/dateME.rb','**/rationalME.rb']
256
256
  $tmpdir = $bindir +"/tmp"
257
257
 
258
258
  $devroot = '/Developer' if $devroot.nil?
@@ -126,7 +126,8 @@ static bool isknowntype(String const &uri)
126
126
  {".png", 4},
127
127
  {".bmp", 4},
128
128
  {".jpg", 4},
129
- {".jpeg", 5}
129
+ {".jpeg", 5},
130
+ {".gif", 4}
130
131
  };
131
132
 
132
133
  // Convert uri to lower case
@@ -295,7 +295,7 @@ extern void rho_sync_addobjectnotify_bysrcname(const char* szSrcName, const char
295
295
  void* rho_dispatch(struct conn *c, const char* path) {
296
296
  RouteRef route;
297
297
 
298
- if ( _shttpd_match_extension(c->uri,"css,js,html,htm,png,bmp,jpg") )
298
+ if ( _shttpd_match_extension(c->uri,"css,js,html,htm,png,bmp,jpg,jpeg,gif") )
299
299
  return NULL;
300
300
 
301
301
  /*#ifdef __SYMBIAN32__
@@ -514,7 +514,7 @@ boolean CSyncEngine::resetClientIDByNet(const String& strClientID)//throws Excep
514
514
  //if ( CClientRegister::getInstance() != null )
515
515
  // strBody += CClientRegister::getInstance()->getRegisterBody();
516
516
 
517
- NetResponse( resp, getNet().pullData(getProtocol().getClientResetUrl(strClientID), this) );
517
+ NetResponse( resp, m_NetRequestClientID->pullData(getProtocol().getClientResetUrl(strClientID), this) );
518
518
 
519
519
 
520
520
  /* processServerSources("{\"server_sources\":[{\"name\":\"Product\",\"partition\":\"application\",\"source_id\":\"2\",\"sync_priority\":\"0\","
@@ -552,7 +552,7 @@ String CSyncEngine::requestClientIDByNet()
552
552
  //if ( CClientRegister::getInstance() != null )
553
553
  // strBody += CClientRegister::getInstance()->getRegisterBody();
554
554
 
555
- NetResponse(resp,getNet().pullData(getProtocol().getClientCreateUrl(), this));
555
+ NetResponse(resp,m_NetRequestClientID->pullData(getProtocol().getClientCreateUrl(), this));
556
556
  if ( resp.isOK() && resp.getCharData() != null )
557
557
  {
558
558
  const char* szData = resp.getCharData();
@@ -812,7 +812,10 @@ void CSyncEngine::login(String name, String password, const CSyncNotification& o
812
812
  }
813
813
 
814
814
  if ( isStoppedByUser() )
815
+ {
816
+ LOG(INFO) + "Login was stopped by application.";
815
817
  return;
818
+ }
816
819
 
817
820
  {
818
821
  DBResult( res , getUserDB().executeSQL("SELECT * FROM client_info") );
@@ -44,7 +44,7 @@ public:
44
44
 
45
45
  private:
46
46
  VectorPtr<CSyncSource*> m_sources;
47
- common::CAutoPtr<net::INetRequest> m_NetRequest;
47
+ common::CAutoPtr<net::INetRequest> m_NetRequest, m_NetRequestClientID;
48
48
  common::CAutoPtr<ISyncProtocol> m_SyncProtocol;
49
49
  ESyncState m_syncState;
50
50
  String m_clientID;
@@ -65,6 +65,8 @@ public:
65
65
 
66
66
  void setFactory(common::IRhoClassFactory* factory){
67
67
  m_NetRequest = factory->createNetRequest();
68
+ //clientID may be requested by ClientRegister thread
69
+ m_NetRequestClientID = factory->createNetRequest();
68
70
  m_oSyncNotify.setFactory(factory);
69
71
  }
70
72
  static CSourceOptions& getSourceOptions(){ return m_oSourceOptions; }
@@ -548,7 +548,11 @@ int CSyncNotify::getLastSyncObjectCount(int nSrcID)
548
548
  void CSyncNotify::callLoginCallback(const CSyncNotification& oNotify, int nErrCode, String strMessage)
549
549
  {
550
550
  if ( getSync().isStoppedByUser() )
551
+ {
552
+ LOG(INFO) + "Login was stopped by application.";
553
+
551
554
  return;
555
+ }
552
556
 
553
557
  //try{
554
558
  String strBody = "error_code=" + convertToStringA(nErrCode);
@@ -228,6 +228,8 @@ void rho_sync_stop()
228
228
 
229
229
  if (CSyncThread::getSyncEngine().isSyncing() )
230
230
  {
231
+ LOG(INFO)+"STOP sync in progress.";
232
+
231
233
  CSyncThread::getSyncEngine().stopSyncByUser();
232
234
  CSyncThread::getInstance()->stopWait();
233
235
 
@@ -333,9 +335,12 @@ int rho_sync_logged_in()
333
335
 
334
336
  void rho_sync_logout()
335
337
  {
338
+ LOG(INFO) + "Logout";
339
+
336
340
  rho_sync_stop();
337
341
 
338
342
  //CDBAdapter& db = CDBAdapter::getUserDB();
343
+ LOG(INFO) + "stopSyncByUser";
339
344
  CSyncThread::getSyncEngine().stopSyncByUser();
340
345
  CSyncThread::getSyncEngine().logout();
341
346
  }
data/rakefile.rb CHANGED
@@ -74,7 +74,7 @@ def make_application_build_config_header_file
74
74
 
75
75
  f.puts 'static const char* values[] = { ""'
76
76
  $application_build_configs.keys.each do |key|
77
- f.puts ',"'+$application_build_configs[key]+'"'
77
+ f.puts ',"'+$application_build_configs[key].to_s+'"'
78
78
  count = count + 1
79
79
  end
80
80
  f.puts '};'
data/rhodes.gemspec CHANGED
@@ -3,8 +3,8 @@ require "lib/rhodes.rb"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rhodes}
6
- #s.version = Rhodes::VERSION
7
- s.version = "2.3.0.beta.1"
6
+ # s.version = Rhodes::VERSION
7
+ s.version = "2.3.0.beta.2"
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
10
10
  s.date = Time.now
@@ -22,6 +22,16 @@
22
22
  require 'date'
23
23
  require 'time'
24
24
 
25
+ describe "System" do
26
+
27
+ it "should test app_installed?" do
28
+ [1..1000].each do |i|
29
+ System::app_installed?("mythebesttestandroidapplication")
30
+ end
31
+ end
32
+
33
+ end
34
+
25
35
  describe "RhoConfig" do
26
36
 
27
37
  before(:each) do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196433
4
+ hash: 62196439
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
9
  - 0
10
10
  - beta
11
- - 1
12
- version: 2.3.0.beta.1
11
+ - 2
12
+ version: 2.3.0.beta.2
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-02-14 00:00:00 -08:00
20
+ date: 2011-02-15 00:00:00 -08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency