toku 0.1.0.4 → 0.1.0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e70bb4204cbf11445010bd7584a09bd5d69c0e65
4
- data.tar.gz: 1d0eb4ffd0abcc58232f01351f95e69750be5ab8
3
+ metadata.gz: 1333d67e1c83413fa3f553e9497e19ab9ccdacd4
4
+ data.tar.gz: 7f1b6a614639e5885ce2e682045824d101be60d3
5
5
  SHA512:
6
- metadata.gz: aed4d6ab6277d3753b1b80614af9530d12099102d58470d964b7f8cd11c2a49f2df421c2e36d22f86c88be88c4b91582632cfdd13d8ff843facec574a890d37c
7
- data.tar.gz: 5a8c278778ad445dcff1bc3edb6485cb8335e7327a004481def6ec7034dbe9ac2c77fbff842cf032ff4e2ab9ea2bc6bbee8d0facbd6cb6c3b09ab795def71fa3
6
+ metadata.gz: dafea67269e244cd83d02f403578b6d52ab6c46cb915adcc542bb31757dde94be1ae8b9a1341aa54469674fd3f06d8620b82171bbad1deeade4fd97bf81cfb45
7
+ data.tar.gz: 02e452d1cc15793ed3b000fa7b550860e781d8501e6b6e36d8c5f8c97c031fe37a8fc47540d348635b9e21e3e0b4d8c2a409015e39057e32ecd584df9e281166
@@ -7,7 +7,7 @@ module Toku
7
7
  attr_accessor :column_filters
8
8
  attr_accessor :row_filters
9
9
 
10
- # A few default filters mappings
10
+ # A few default column filters mappings
11
11
  COLUMN_FILTER_MAP = {
12
12
  none: Toku::ColumnFilter::Passthrough,
13
13
  faker_last_name: Toku::ColumnFilter::FakerLastName,
@@ -15,6 +15,7 @@ module Toku
15
15
  faker_email: Toku::ColumnFilter::FakerEmail
16
16
  }
17
17
 
18
+ # A few default row filters mappings
18
19
  ROW_FILTER_MAP = {
19
20
  drop: Toku::RowFilter::Drop
20
21
  }
@@ -28,6 +29,7 @@ module Toku
28
29
 
29
30
  # @param [String] uri_db_source URI of the DB to be anonimized
30
31
  # @param [String] uri_db_destination URI of the destination DB
32
+ # @return [void]
31
33
  def run(uri_db_source, uri_db_destination)
32
34
 
33
35
  source_db = Sequel.connect(uri_db_source)
@@ -80,12 +82,19 @@ module Toku
80
82
  end.join(",") + "\n"
81
83
  end
82
84
 
85
+ # Is the source database schema a subset of the destination database schema?
86
+ # @param source_db [String] URI of source database
87
+ # @param destination_db [String] URI of destination database
88
+ # @return [Boolean]
83
89
  def source_schema_included?(source_db, destination_db)
84
90
  source_db.tables.all? do |table|
85
91
  source_db.schema(table) == destination_db.schema(table)
86
92
  end
87
93
  end
88
94
 
95
+ # Are there row filters specified for this table?
96
+ # @param table [Symbol]
97
+ # @return [Boolean]
89
98
  def row_filters?(table)
90
99
  !@config[table.to_s]['rows'].nil? && @config[table.to_s]['rows'].any?
91
100
  end
@@ -1,6 +1,7 @@
1
1
  module Toku
2
2
  class ColumnFilter
3
- # @param options [Hash{Symbol => Object}] arguments passed to the filter
3
+ # @param value [Object] initial value for the column
4
+ # @param options [Hash{String => Object}] arguments passed to the filter
4
5
  def initialize(value, options)
5
6
  @value = value
6
7
  end
@@ -1,8 +1,11 @@
1
1
  module Toku
2
2
  class RowFilter
3
+ # @param options [Hash{String => Object}] arguments passed to the filter
3
4
  def initialize(options)
4
5
  end
5
6
 
7
+ # @param [LazyEnumerator] stream
8
+ # @return [LazyEnumerator] stream
6
9
  def call(_)
7
10
  _
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module Toku
2
- VERSION = "0.1.0.4"
2
+ VERSION = "0.1.0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.4
4
+ version: 0.1.0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PSKL