rhosync 2.1.0 → 2.1.1
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/CHANGELOG +5 -0
- data/lib/rhosync/console/app/routes/home.rb +1 -1
- data/lib/rhosync/jobs/bulk_data_job.rb +16 -0
- data/lib/rhosync/version.rb +1 -1
- data/spec/jobs/bulk_data_job_spec.rb +3 -1
- data/tasks/redis.rake +1 -1
- metadata +6 -7
- data/bench/benchapp/tmp/restart.txt +0 -0
data/CHANGELOG
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'sqlite3'
|
2
2
|
require 'zip/zip'
|
3
|
+
require 'zlib'
|
3
4
|
|
4
5
|
module Rhosync
|
5
6
|
module BulkDataJob
|
@@ -153,7 +154,10 @@ module Rhosync
|
|
153
154
|
end
|
154
155
|
populate_sources_table(db,sources_refs)
|
155
156
|
db.execute_batch(File.open(index,'r').read)
|
157
|
+
db.execute_batch( "VACUUM;");
|
158
|
+
db.close
|
156
159
|
compress("#{bulk_data.dbfile}.rzip",bulk_data.dbfile)
|
160
|
+
gzip_compress("#{bulk_data.dbfile}.gzip",bulk_data.dbfile)
|
157
161
|
end
|
158
162
|
|
159
163
|
def self.create_hsql_data_file(bulk_data,ts)
|
@@ -166,6 +170,7 @@ module Rhosync
|
|
166
170
|
'com.rhomobile.hsqldata.HsqlData',
|
167
171
|
dbfile, hsql_file
|
168
172
|
)
|
173
|
+
gzip_compress("#{hsql_file}.data.gzip","#{hsql_file}.data")
|
169
174
|
end
|
170
175
|
|
171
176
|
def self.get_file_args(bulk_data_name,ts)
|
@@ -180,5 +185,16 @@ module Rhosync
|
|
180
185
|
zipfile.add(URI.escape(File.basename(file)),file)
|
181
186
|
end
|
182
187
|
end
|
188
|
+
|
189
|
+
def self.gzip_compress(archive,file)
|
190
|
+
data = File.new(file, "rb")
|
191
|
+
File.open(archive, 'wb') do |f|
|
192
|
+
gz = Zlib::GzipWriter.new(f)
|
193
|
+
gz.write data.read
|
194
|
+
gz.close
|
195
|
+
end
|
196
|
+
data.close
|
197
|
+
end
|
198
|
+
|
183
199
|
end
|
184
200
|
end
|
data/lib/rhosync/version.rb
CHANGED
@@ -12,7 +12,7 @@ describe "BulkDataJob" do
|
|
12
12
|
delete_data_directory
|
13
13
|
end
|
14
14
|
|
15
|
-
it "should create
|
15
|
+
it "should create bulk data files from master document" do
|
16
16
|
set_state('test_db_storage' => @data)
|
17
17
|
docname = bulk_data_docname(@a.id,@u.id)
|
18
18
|
expected = { @s_fields[:name] => @data,
|
@@ -29,7 +29,9 @@ describe "BulkDataJob" do
|
|
29
29
|
verify_result(@s.docname(:md) => @data,@s.docname(:md_copy) => @data)
|
30
30
|
validate_db(data,expected).should == true
|
31
31
|
File.exists?(data.dbfile+'.rzip').should == true
|
32
|
+
File.exists?(data.dbfile+'.gzip').should == true
|
32
33
|
File.exists?(data.dbfile+'.hsqldb.data').should == true
|
34
|
+
File.exists?(data.dbfile+'.hsqldb.data.gzip').should == true
|
33
35
|
File.exists?(data.dbfile+'.hsqldb.script').should == true
|
34
36
|
File.exists?(data.dbfile+'.hsqldb.properties').should == true
|
35
37
|
path = File.join(File.dirname(data.dbfile),'tmp')
|
data/tasks/redis.rake
CHANGED
@@ -56,7 +56,7 @@ class RedisRunner
|
|
56
56
|
def self.start
|
57
57
|
if windows?
|
58
58
|
puts "Starting redis in a new window..."
|
59
|
-
sh "start #{File.join(redis_home,'redis-server')}" rescue
|
59
|
+
sh "start #{File.join(redis_home,'redis-server')} #{File.join(redis_home,'redis.conf')}" rescue
|
60
60
|
"redis-server not installed on your path, please run 'rake redis:install' first."
|
61
61
|
else
|
62
62
|
puts 'Detach with Ctrl+\ Re-attach with rake redis:attach'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhosync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 9
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 2.1.
|
9
|
+
- 1
|
10
|
+
version: 2.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rhomobile
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-04 00:00:00 -08:00
|
19
19
|
default_executable: rhosync
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -311,7 +311,6 @@ files:
|
|
311
311
|
- bench/benchapp/settings/settings.yml
|
312
312
|
- bench/benchapp/sources/mock_adapter.rb
|
313
313
|
- bench/benchapp/sources/queue_mock_adapter.rb
|
314
|
-
- bench/benchapp/tmp/restart.txt
|
315
314
|
- bench/lib/bench.rb
|
316
315
|
- bench/lib/bench/cli.rb
|
317
316
|
- bench/lib/bench/logging.rb
|
@@ -574,7 +573,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
574
573
|
requirements: []
|
575
574
|
|
576
575
|
rubyforge_project:
|
577
|
-
rubygems_version: 1.
|
576
|
+
rubygems_version: 1.4.1
|
578
577
|
signing_key:
|
579
578
|
specification_version: 3
|
580
579
|
summary: RhoSync Synchronization Framework
|
File without changes
|