remi 0.2.12 → 0.2.13

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: 2ee4f5ef99f18b36083cf0fa0a31e3c5e9dbab17
4
- data.tar.gz: f78cdac5e10cc84cde78e7b54ef1955a591eb115
3
+ metadata.gz: dd17d3ba11bb21e77a71d959beb49e28dec5d8aa
4
+ data.tar.gz: 8850daac31d5c0929f53edd85a9509d039f521fa
5
5
  SHA512:
6
- metadata.gz: 35b23fcdf2de08e344a12b8326159bb6ddb92dd322f732c0f5e3f5693ef0ffdf1731b1293b652581a2353aeb6b2daa732b93684813b8096cdeb0d4eddc9abbbf
7
- data.tar.gz: f1953467dbc6f9b91cd804014bfb9b427308b974508272891d399f09c3142408f9426ba2af5283c05751b8270a347a6a25570e19d337f575611dcf322cf855ed
6
+ metadata.gz: 43cc5c4f041cb53d57249a40180b4601c17b7e2ccab7e83d86e37af2a90e490a9b6fee56fe1e7bb00219574772c1b0e498a4afe83182f8dfcb692fe4596fb7ae
7
+ data.tar.gz: 0c671a7031b992c809ca4f91cb420f036fcdcc57ce4b95e9bee8d1272cdb4ed54b413cb2fc4c61b15af33162e624b60d48f4a3c89dac29ad19f7fd0a0fb4795f
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remi (0.2.12)
4
+ remi (0.2.13)
5
5
  activesupport (~> 4.2)
6
6
  bond (~> 0.5)
7
7
  cucumber (~> 2.1)
8
8
  daru (~> 0.1)
9
9
  docile (~> 1.1)
10
+ faker (~> 1.6)
10
11
  net-sftp (~> 2.1)
11
12
  pg (~> 0.18)
12
13
  regex_sieve (~> 0.1)
@@ -43,6 +44,8 @@ GEM
43
44
  spreadsheet (~> 1.0.3)
44
45
  diff-lcs (1.2.5)
45
46
  docile (1.1.5)
47
+ faker (1.6.1)
48
+ i18n (~> 0.5)
46
49
  faraday (0.9.2)
47
50
  multipart-post (>= 1.2, < 3)
48
51
  faraday_middleware (0.10.0)
@@ -9,6 +9,17 @@ require_relative 'env_app.rb'
9
9
 
10
10
  Remi::Settings.log_level = Logger::ERROR
11
11
 
12
+ Before do
13
+ # Restart the random number generator prior to each scenario to
14
+ # ensure we have reproducibility of random output
15
+ Kernel.srand(35983958269835333)
16
+ end
17
+
18
+ After do
19
+ Kernel.srand
20
+ end
21
+
22
+
12
23
  Before '~@fails' do
13
24
  def expect_cucumber(&block)
14
25
  block.call
@@ -31,8 +31,8 @@ Feature: Test the NVL (Next Value Lookup) transformer.
31
31
  Then the target field 'Result Field' is the first non-blank value from source fields 'Field1', 'Field2', 'Field3'
32
32
 
33
33
  @fails
34
- Scenario: Testing that the NVL with the short form version fails appropriately
34
+ Scenario: Testing an NVL with the short form version in the wrong order
35
35
  Given the source 'Source Data'
36
36
  And the target 'Target Data'
37
37
 
38
- Then the target field 'Field2 Copy' is the first non-blank value from source fields 'Field1', 'Field2', 'Field3'
38
+ Then the target field 'Result Field' is the first non-blank value from source fields 'Field2', 'Field1', 'Field3'
@@ -16,8 +16,6 @@ class NvlJob
16
16
  Remi::SourceToTargetMap.apply(source_data.df, target_data.df) do
17
17
  map source(:field1, :field2, :field3) .target(:result_field)
18
18
  .transform(Remi::Transform[:nvl].(params[:default]))
19
-
20
- map source(:field2) .target(:field2_copy)
21
19
  end
22
20
  end
23
21
  end
data/lib/remi.rb CHANGED
@@ -11,6 +11,7 @@ require 'docile'
11
11
  require 'net/sftp'
12
12
  require 'pg'
13
13
  require 'regex_sieve'
14
+ require 'faker'
14
15
 
15
16
  # ActiveSupport extensions
16
17
  require 'active_support'
@@ -3,14 +3,7 @@ module Remi
3
3
  module DataStub
4
4
  def stub_row_array
5
5
  @fields.values.map do |attrib|
6
- case attrib[:type]
7
- when :date
8
- stub_values[:date].strftime(attrib[:format])
9
- when nil
10
- stub_values[:string]
11
- else
12
- stub_values[attrib[:type]]
13
- end
6
+ stub_values[attrib[:type]].call
14
7
  end
15
8
  end
16
9
 
@@ -25,11 +18,12 @@ module Remi
25
18
 
26
19
  def stub_values
27
20
  @stub_values ||= {
28
- string: "Some String",
29
- number: 133,
30
- float: 3.14159,
31
- integer: 38,
32
- date: Date.parse('2015-10-21')
21
+ nil => ->() { Faker::Hipster.word },
22
+ string: ->() { Faker::Hipster.word },
23
+ number: ->() { Faker::Number.decimal(4,4) },
24
+ float: ->() { Faker::Number.decimal(2,2) },
25
+ integer: ->() { Faker::Number.number(4) },
26
+ date: ->() { Date.parse('2015-10-21') }
33
27
  }
34
28
  end
35
29
  end
data/lib/remi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Remi
2
- VERSION = '0.2.12'
2
+ VERSION = '0.2.13'
3
3
  end
data/remi.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_runtime_dependency "regexp-examples", ["~> 1.1"]
27
27
 
28
28
  s.add_runtime_dependency "activesupport", ["~> 4.2"]
29
+ s.add_runtime_dependency "faker", ["~> 1.6"]
29
30
 
30
31
  # Move these into separate package
31
32
  s.add_runtime_dependency 'restforce', ['~> 2.1']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sterling Paramore
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '4.2'
153
+ - !ruby/object:Gem::Dependency
154
+ name: faker
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.6'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.6'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: restforce
155
169
  requirement: !ruby/object:Gem::Requirement