spanner-translator 0.3.0 → 0.3.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
  SHA256:
3
- metadata.gz: 54175adb11828290cc2c5f7993973130dd9b870b66fcf90748af2de11a3a3ea1
4
- data.tar.gz: 5e2a822a94c976fa76f20e86122cbd95961a5616e008e2cfba53510d38e2594c
3
+ metadata.gz: 455e11c334ebe5c0a3e917dbd84599176e4d16d5c905a0bfbd48e6b36b5975b6
4
+ data.tar.gz: 246699204b50ed9bf04b4a79639e66dcbd4219ee8fffb013823ddaeda38017e9
5
5
  SHA512:
6
- metadata.gz: c8169d285df624c76f63ad577d588b19b85606cd393abdd5f0ebbad229de8c5409e4c2ed0d3fa461df8d18db9b75dc97dabf6169ddea0bc61c43376c1b751551
7
- data.tar.gz: 6013cd95da080222aca143982461624971c1c3a22ab71c3deddc791bc85a22f1b00b947fa402aa66a3c66ffa1de139b5f79fec7568431fe2aa654d46e96d5012
6
+ metadata.gz: 19c691ff6b6d087bfdc489ff90ee655dbfc6fce1a44a5640b7681d11750dbef24f03a207a37554f2ad38c62050adffea47c153eec5c41b88d3c34f545247ca8b
7
+ data.tar.gz: eedfb4aa235247374887463df3c116152278de8e3855d9f7d8fed870342b1a320c570b61a902bb8e367b2db7befcf0174aed7fdf08b80fa5a15cbc4cfdde0d3e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spanner-translator (0.3.0)
4
+ spanner-translator (0.3.1)
5
5
  rubocop-ast (~> 1.30.0)
6
6
 
7
7
  GEM
@@ -10,17 +10,17 @@ module Spanner
10
10
  class << self
11
11
  # process code translation, raising errors if a CheckRule fails.
12
12
  def process_code!(code,
13
- check_classes = Rules::Check.constants,
14
- rule_classes = Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
13
+ check_classes: Rules::Check.constants,
14
+ rule_classes: Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
15
15
  check_classes.each do |rule_class|
16
16
  process_check_rule(Spanner::Translator::Rules::Check.const_get(rule_class), code)
17
17
  end
18
18
 
19
- process_code(code, rule_classes, options:)
19
+ process_code(code, rule_classes:, options:)
20
20
  end
21
21
 
22
22
  # process code translation for only the schema related rules
23
- def process_code(code, rule_classes = Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
23
+ def process_code(code, rule_classes: Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
24
24
  rule_classes.each do |rule_class|
25
25
  code = process_rule(Spanner::Translator::Rules::Translation.const_get(rule_class), code, options:)
26
26
  end
@@ -10,7 +10,9 @@ module Spanner
10
10
  return unless node.create_table?
11
11
 
12
12
  # keep table name argument, replace the rest with sensible spanner options
13
- primary_keys = Spanner::Translator.configuration.default_primary_keys.inspect
13
+ primary_keys = translation_options
14
+ .fetch(:primary_keys, Spanner::Translator.configuration.default_primary_keys)
15
+ .inspect
14
16
  @rewriter.replace(node.arguments[1].source_range, "primary_key: #{primary_keys}, force: :cascade")
15
17
  end
16
18
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Spanner
4
4
  module Translator
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spanner-translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bachman