rubyrep 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dce60ecb06296f28c795f0e6f622f44cfb254f36
4
- data.tar.gz: d93b227992e944a55bd0dc465c58e63189fca282
3
+ metadata.gz: 213e858c035fb240427f3483d5e3254f7e6ea7a0
4
+ data.tar.gz: a63ca55ad8809f1fb3de2820a2f14f2c895f3db7
5
5
  SHA512:
6
- metadata.gz: 0c1617bceecfff4c4337f054db6e34d93a6fc403f10fa4164cd4e66bd6ebf2a1fbf057514dad0c7437dd14b589d0afe9cea745568e8b8e150ed2a86bee642786
7
- data.tar.gz: 359351384c8600b69c16dddb46434bf43f2b3f2a82f1c6c6d554b38fd4fea3fce9a0d36cd50961b245d24d5ca2a6ed19f70615819e7ad244b96d88437fb50692
6
+ metadata.gz: e96f69319d4c3960388eaca5e138ab698b3eb91b0b1eaa43f36ccb018e6fe1956bd0d13a7e7a813fb64eab0e5d8b924c90b77514b100b896a5b26f129db116d9
7
+ data.tar.gz: 81a028f93318f91bf348d8c64bfafb4ab968be7b3441aad46f2fa9f66f8e024d5d92174f43bc640ca1338a98ab5e9f0ce11143e3eee1231871c10633cf25dbcd
@@ -2,10 +2,13 @@
2
2
  # Defines connection parameters to the mysql databases.
3
3
 
4
4
  RR::Initializer::run do |config|
5
+
6
+ mysql_user = RUBY_PLATFORM == 'java' && 'root' || `whoami`.strip
7
+
5
8
  config.left = {
6
9
  :adapter => 'mysql2',
7
10
  :database => 'rr_left',
8
- :username => 'root',
11
+ :username => mysql_user,
9
12
  :password => '',
10
13
  :host => 'localhost',
11
14
  :port => 3306,
@@ -15,7 +18,7 @@ RR::Initializer::run do |config|
15
18
  config.right = {
16
19
  :adapter => 'mysql2',
17
20
  :database => 'rr_right',
18
- :username => 'root',
21
+ :username => mysql_user,
19
22
  :password => '',
20
23
  :host => 'localhost',
21
24
  :port => 3306,
@@ -109,14 +109,7 @@ module RR
109
109
  # @param [ActiveRecord::ConnectionAdapters::PostgreSQLColumn] column the target column
110
110
  # @return [String] the quoted string
111
111
  def column_aware_quote(value, column)
112
- if column.try(:sql_type) == 'bytea'
113
- quoted_value = "'#{escape_bytea value}'"
114
- # tests showed that there is a wrong leading double backslash under JRuby
115
- quoted_value.sub!(/\\\\/, '\\')
116
- quoted_value
117
- else
118
- quote value
119
- end
112
+ quote column.type_cast_for_database value
120
113
  end
121
114
 
122
115
  # Casts a value returned from the database back into the according ruby type.
@@ -1,3 +1,3 @@
1
1
  module RR #:nodoc:
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -325,6 +325,13 @@ def create_sample_schema(database, config)
325
325
  FOREIGN KEY (first_fk, second_fk)
326
326
  REFERENCES referenced_table(first_id, second_id)
327
327
  end_sql
328
+
329
+ create_table :postgres_types do |t|
330
+ t.text :text_array, array: true
331
+ t.float :float_array, array: true
332
+ t.json :json
333
+ t.jsonb :jsonb
334
+ end
328
335
  end
329
336
  end
330
337
  end
@@ -337,6 +344,7 @@ def drop_sample_schema(config)
337
344
  ActiveRecord::Base.establish_connection config
338
345
 
339
346
  ActiveRecord::Schema.define do
347
+ drop_table :postgres_types rescue nil
340
348
  drop_table :rr_referencing rescue nil
341
349
  drop_table :rr_duplicate rescue nil
342
350
  drop_table :table_with_strange_key rescue nil
@@ -353,7 +361,7 @@ def drop_sample_schema(config)
353
361
  drop_table :referencing_table rescue nil
354
362
  drop_table :referenced_table rescue nil
355
363
  drop_table :referenced_table2 rescue nil
356
- drop_table :table_with_manual_key
364
+ drop_table :table_with_manual_key rescue nil
357
365
  drop_table :rr_pending_changes rescue nil
358
366
  drop_table :rr_logged_events rescue nil
359
367
  drop_table :rr_running_flags rescue nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyrep
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arndt Lehmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler