remi 0.2.22 → 0.2.23

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: 6beaa48e9e3760dd0670541bd880e10367b51334
4
- data.tar.gz: 7cdc114c661452d3be31e3e5670117739b1f1ab7
3
+ metadata.gz: c2a0f05a4c89db273e240cd2bfea455bfe757608
4
+ data.tar.gz: 4d25d0f4cea2a394342814c0a4de401fea42e797
5
5
  SHA512:
6
- metadata.gz: b6386ab9a5b07c5086b462169b5e517a09009b38fdd7c1aabcca2be85be817e5ffa21f0a7dc2a727f40d667af2f034bc1037d04999561859cbefe12129663fff
7
- data.tar.gz: 67b62fc317e4c2fd8b013b309d04a3ccaf644ac3b286447f98673fde84f9a301461207f4a72cb07417d4206bb7491507d801814bc07d976ceb900949ab672c25
6
+ metadata.gz: 875477752da888b12159e436e0f17b19df54722db4e1550712a6a8e01007a907bbb1c0096f9d8e490bde9378d9b5fa67d1c17607e622481e1e3b64dc50357a74
7
+ data.tar.gz: 414093bef26b68d45a9e3614d4014fe9ca2412b9e785dd9bc799ccf19f271e6a8abe71c6a55f488df17b8fcb93dbdc93f1ec3baac8d3c06058992e44ea054b9d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remi (0.2.22)
4
+ remi (0.2.23)
5
5
  activesupport (~> 4.2)
6
6
  bond (~> 0.5)
7
7
  cucumber (~> 2.1)
@@ -310,6 +310,7 @@ Then /^the target field '(.+)' is populated from the source field '(.+)' after t
310
310
  end
311
311
  end
312
312
 
313
+
313
314
  ### Transforms
314
315
 
315
316
  Then /^the target field '([^']+)' is a concatenation of the source fields '(.+)', delimited by "([^"]*)"$/ do |target_field, source_field_list, delimiter|
@@ -490,13 +491,50 @@ Then /^the source field '([^']+)' is truncated to (\d+) characters and loaded in
490
491
  source_name, source_field_name = @brt.sources.parse_full_field(source_field)
491
492
  target_names, target_field_name = @brt.targets.parse_full_field(target_field, multi: true)
492
493
 
493
- truncated_source = @brt.sources[source_name].fields[source_field_name].value.slice(0, character_limit.to_i)
494
+ value = (@brt.sources[source_name].fields[source_field_name].value) * character_limit.to_i
495
+ @brt.sources[source_name].fields[source_field_name].value = value
496
+
497
+ truncated_source = value.slice(0, character_limit.to_i)
494
498
  @brt.run_transforms
495
499
  Array(target_names).each do |target_name|
496
500
  expect(@brt.targets[target_name].fields[target_field_name].value).to eq truncated_source
497
501
  end
498
502
  end
499
503
 
504
+ Then /^the source field '([^']+)' is name-cased and loaded into the target field '([^']+)'$/ do |source_field, target_field|
505
+ step "the target field '#{target_field}'"
506
+ step "the source field '#{source_field}'"
507
+
508
+ source_name, source_field_name = @brt.sources.parse_full_field(source_field)
509
+ target_names, target_field_name = @brt.targets.parse_full_field(target_field, multi: true)
510
+
511
+ @brt.sources[source_name].fields[source_field_name].value = 'SCROOGE MCDUCK'
512
+ @brt.run_transforms
513
+ Array(target_names).each do |target_name|
514
+ expect(@brt.targets[target_name].fields[target_field_name].value).to eq 'Scrooge McDuck'
515
+ end
516
+ end
517
+
518
+ Then /^the source field is name-cased and loaded into the target field '([^']+)'$/ do |target_field|
519
+ @brt.sources.fields.each do |source_field|
520
+ step "the source field '#{source_field}' is name-cased and loaded into the target field '#{target_field}'"
521
+ end
522
+ end
523
+
524
+ Then /^the source field '([^']+)' is name-cased and loaded into the target field$/ do |source_field|
525
+ @brt.targets.fields.each do |target_field|
526
+ step "the source field '#{source_field}' is name-cased and loaded into the target field '#{target_field}'"
527
+ end
528
+ end
529
+
530
+ Then /^the source field is name-cased and loaded into the target field$/ do
531
+ @brt.targets.fields.each do |target_field|
532
+ @brt.sources.fields.each do |source_field|
533
+ step "the source field '#{source_field}' is name-cased and loaded into the target field '#{target_field}'"
534
+ end
535
+ end
536
+ end
537
+
500
538
  ### Field presence
501
539
 
502
540
  Then /^only the following fields should be present on the target:$/ do |table|
@@ -9,7 +9,7 @@ module Remi
9
9
  standard: CSV::HeaderConverters[:symbol],
10
10
  salesforce: lambda { |f|
11
11
  f.encode(CSV::ConverterEncoding).strip.gsub(/\s+/, "_").
12
- gsub(/\W+/, "").to_sym
12
+ gsub(/[^0-9a-zA-Z_.]+/, "").to_sym
13
13
  }
14
14
  }
15
15
  end
data/lib/remi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Remi
2
- VERSION = '0.2.22'
2
+ VERSION = '0.2.23'
3
3
  end
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.22
4
+ version: 0.2.23
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-23 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daru