pyper_rb 1.3.0 → 1.4.0

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: bbe0e9d75ef82ad036192095dc82f409999427a6
4
- data.tar.gz: a819f5c7d2278890f9ce052fd2e8b7857f761a36
3
+ metadata.gz: 8fe9e1243476e268f01593c2383021ebfd664ade
4
+ data.tar.gz: 1de2c649d12d60c55c64bdf451e55c18af9f6409
5
5
  SHA512:
6
- metadata.gz: 82df8f313cf6585c615e4411e13f260233d83e0d1303ff450d325e4ac98ee5941d5170dca7e659a2d64559205e086aaf22afc0fd8cac5180dc2d90c8249d4f55
7
- data.tar.gz: 577d3a953d375cb8e50f028d00627e6fdf66ce5d64e57f7d505df43574ecdf2916f5fc44b0ccf10d7da5e5054599a944610886a0fd339f27d7f5f726a481c963
6
+ metadata.gz: 3d4c4ce102f4f6bbae0a58b2a4e67bdb98e6b82c90d51b9d778ed133592af5541831c680a5eb09cb0e69af503ed55760ae39e4b0321cdb098635bb50179acbe8
7
+ data.tar.gz: da3ed05d7c501a879c4a8e243494fcee9853b6b8e7d4f0eed76080a7bbbaf66b095e6cc3cdf8329029fe5453932c75c33074831d673af1a8a199ea93718c0b33
data/Gemfile CHANGED
@@ -21,4 +21,4 @@ group :test do
21
21
  end
22
22
 
23
23
  gem 'storage_strategy', :git => 'git@github.com:backupify/storage_strategy.git'
24
- gem 'cassava', :git => 'git@github.com:backupify/cassava.git'
24
+ gem 'cassava_rb'
@@ -4,5 +4,6 @@ module Pyper::Pipes; end
4
4
  require_relative 'pipes/field_rename'
5
5
  require_relative 'pipes/default_values'
6
6
  require_relative 'pipes/no_op'
7
+ require_relative 'pipes/tap'
7
8
  require_relative 'pipes/remove_fields'
8
9
  require_relative 'pipes/force_enumerator'
@@ -0,0 +1,11 @@
1
+ module Pyper::Pipes
2
+ class Tap
3
+ def initialize(&block)
4
+ @block = block
5
+ end
6
+
7
+ def call(arg, _status)
8
+ arg.tap(&@block)
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Pyper
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require 'test_helper'
2
+
3
+ module Pyper
4
+ module Pipes
5
+ class TapTest < Minitest::Should::TestCase
6
+ should "call the given block and return the original argument" do
7
+ called = false
8
+ res = Pyper::Pipeline.create do
9
+ add -> (n, _) { n + 2 }
10
+ add Pyper::Pipes::Tap.new { called = true }
11
+ add -> (n, _) { n + 4 }
12
+ end.push(1).value
13
+
14
+ assert_equal 7, res
15
+ assert called
16
+ end
17
+
18
+ should "yield the argument to the given block" do
19
+ yielded = nil
20
+ res = Pyper::Pipeline.create do
21
+ add -> (n, _) { n + 2 }
22
+ add Pyper::Pipes::Tap.new { |a| yielded = a }
23
+ add -> (n, _) { n + 4 }
24
+ end.push(1)
25
+
26
+ assert_equal 3, yielded
27
+ end
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyper_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arron Norwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,6 +78,7 @@ files:
78
78
  - lib/pyper/pipes/no_op.rb
79
79
  - lib/pyper/pipes/pry.rb
80
80
  - lib/pyper/pipes/remove_fields.rb
81
+ - lib/pyper/pipes/tap.rb
81
82
  - lib/pyper/version.rb
82
83
  - pyper_rb.gemspec
83
84
  - test/fixtures/cass_schema_config.yml
@@ -100,6 +101,7 @@ files:
100
101
  - test/unit/pyper/pipes/model/virtus_deserializer_test.rb
101
102
  - test/unit/pyper/pipes/no_op_test.rb
102
103
  - test/unit/pyper/pipes/remove_fields_test.rb
104
+ - test/unit/pyper/pipes/tap_test.rb
103
105
  homepage: ''
104
106
  licenses:
105
107
  - MIT
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  version: '0'
121
123
  requirements: []
122
124
  rubyforge_project:
123
- rubygems_version: 2.2.2
125
+ rubygems_version: 2.4.8
124
126
  signing_key:
125
127
  specification_version: 4
126
128
  summary: Create pipelines for storing data.
@@ -145,4 +147,4 @@ test_files:
145
147
  - test/unit/pyper/pipes/model/virtus_deserializer_test.rb
146
148
  - test/unit/pyper/pipes/no_op_test.rb
147
149
  - test/unit/pyper/pipes/remove_fields_test.rb
148
- has_rdoc:
150
+ - test/unit/pyper/pipes/tap_test.rb