remi 0.2.23 → 0.2.24
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 +4 -4
- data/Gemfile.lock +1 -1
- data/features/step_definitions/remi_step.rb +51 -7
- data/lib/remi/transform.rb +1 -1
- data/lib/remi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb5656a8d423c9977d429c8860675634306e7f3
|
4
|
+
data.tar.gz: 8cee6d8de9480b1bb87fa51fd3599f98ceaae81d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a2f58abebea15a06579dfec3dd5ca17d2edb4aa150082096b0d8d62b3399a3c6c01abdac0734280643a80d97ca8ccd6feea652970c402e5da5222f03298b796
|
7
|
+
data.tar.gz: fa61072a96440a8798ff7b58203d35ff26d4a3de87690b059838b81f724c5b4c7324de43d89fae266d5a48c284ad8aad1bca7185051da68b071ec664061deb45
|
data/Gemfile.lock
CHANGED
@@ -284,22 +284,35 @@ Then /^the target field '(.+)' is the date (.+)$/ do |target_field, date_referen
|
|
284
284
|
step "the target field '#{target_field}' is set to the value \"*#{date_reference}*\""
|
285
285
|
end
|
286
286
|
|
287
|
-
Then /^the target '(.+)' should match the example '([[:alnum:]
|
287
|
+
Then /^the target '(.+)' should match the example '([[:alnum:]\-\s]+)'$/ do |target_name, example_name|
|
288
288
|
@brt.run_transforms
|
289
289
|
|
290
290
|
target_hash = @brt.targets[target_name].column_hash
|
291
291
|
example_hash = @brt.examples[example_name].column_hash
|
292
292
|
common_keys = target_hash.keys & example_hash.keys
|
293
293
|
|
294
|
-
|
295
|
-
|
294
|
+
target_to_compare = target_hash.select { |k,v| common_keys.include? k }
|
295
|
+
target_to_compare.each do |k, v|
|
296
|
+
target_to_compare[k] = v.map { |e| e.to_s }
|
297
|
+
end
|
298
|
+
|
299
|
+
example_to_compare = example_hash.select { |k,v| common_keys.include? k }
|
300
|
+
|
301
|
+
expect(target_to_compare).to eq example_to_compare
|
296
302
|
end
|
297
303
|
|
298
|
-
Then /^the target should match the example '([[:alnum:]
|
304
|
+
Then /^the target should match the example '([[:alnum:]\-\s]+)'$/ do |example_name|
|
299
305
|
target_name = @brt.targets.keys.first
|
300
306
|
step "the target '#{target_name}' should match the example '#{example_name}'"
|
301
307
|
end
|
302
308
|
|
309
|
+
Then /^the target should match the example:/ do |example_table|
|
310
|
+
example_name = SecureRandom.uuid
|
311
|
+
@brt.add_example example_name, example_table
|
312
|
+
step "the target should match the example '#{example_name}'"
|
313
|
+
end
|
314
|
+
|
315
|
+
|
303
316
|
Then /^the target field '(.+)' is populated from the source field '(.+)' after translating it according to:$/ do |target_field, source_field, translation_table|
|
304
317
|
step "the target field '#{target_field}'"
|
305
318
|
|
@@ -391,12 +404,43 @@ Then /^the target field is a concatenation of '(.+)' and "([^"]*)", delimited by
|
|
391
404
|
end
|
392
405
|
end
|
393
406
|
|
394
|
-
Then /^the source field is prefixed with "([^"]*)" and loaded into the target field$/ do |prefix|
|
395
|
-
|
407
|
+
Then /^the source field '([^']+)' is prefixed with "([^"]*)" and loaded into the target field '([^']+)'$/ do |source_field, prefix, target_field|
|
408
|
+
step "the target field '#{target_field}'"
|
409
|
+
step "the source field '#{source_field}'"
|
410
|
+
|
411
|
+
source_name, source_field_name = @brt.sources.parse_full_field(source_field)
|
412
|
+
target_names, target_field_name = @brt.targets.parse_full_field(target_field, multi: true)
|
413
|
+
|
414
|
+
prefixed_source = "#{prefix}#{@brt.sources[source_name].fields[source_field_name].value}"
|
415
|
+
|
396
416
|
@brt.run_transforms
|
397
|
-
|
417
|
+
Array(target_names).each do |target_name|
|
418
|
+
expect(@brt.targets[target_name].fields[target_field_name].value).to eq prefixed_source
|
419
|
+
end
|
420
|
+
|
398
421
|
end
|
399
422
|
|
423
|
+
Then /^the source field is prefixed with "([^"]*)" and loaded into the target field '([^']+)'$/ do |prefix, target_field|
|
424
|
+
@brt.sources.fields.each do |source_field|
|
425
|
+
step "the source field '#{source_field.full_name}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field}'"
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
Then /^the source field '([^']+)' is prefixed with "([^"]*)" and loaded into the target field$/ do |source_field, prefix|
|
430
|
+
@brt.targets.fields.each do |target_field|
|
431
|
+
step "the source field '#{source_field}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field.full_name}'"
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
Then /^the source field is prefixed with "([^"]*)" and loaded into the target field$/ do |prefix|
|
436
|
+
@brt.sources.fields.each do |source_field|
|
437
|
+
@brt.targets.fields.each do |target_field|
|
438
|
+
step "the source field '#{source_field.full_name}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field.full_name}'"
|
439
|
+
end
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
|
400
444
|
Then /^the target field '([^']+)' is populated from the source field '([^']+)' using the format "([^"]*)"$/ do |target_field, source_field, target_format|
|
401
445
|
step "the source field '#{source_field}'"
|
402
446
|
step "the target field '#{target_field}'"
|
data/lib/remi/transform.rb
CHANGED
@@ -145,7 +145,7 @@ module Remi
|
|
145
145
|
|
146
146
|
def validate_email(substitute='')
|
147
147
|
memoize_as_lambda(__method__, substitute) do |(msubstitute), larg|
|
148
|
-
larg.match(
|
148
|
+
larg.match(/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,}$/i) ? larg : msubstitute
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
data/lib/remi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sterling Paramore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daru
|