pipelining 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pipelining.rb +16 -18
- data/lib/pipelining/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd77f35320a1498483b3fd62c36c88abb8535a4
|
4
|
+
data.tar.gz: 91b2c2c7eefb099aac03aeabeff90fddd62231fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd199da05f22d22a118df44305b3939cc9e8dc531e4441d2a5b47c083b00eea283f1a6c09a1b4c98dd77b6422b58729812d0f5f766e3ff15e7b9ad07385be6e
|
7
|
+
data.tar.gz: 7551f9beee348fa950bcf807e999bb7f4f65695b04a537578e1e80dda291573c66184e497ff7541bd5b054dae050a2937e9562c433ae10ef91f3dd107a41c105
|
data/lib/pipelining.rb
CHANGED
@@ -1,23 +1,21 @@
|
|
1
1
|
require "pipelining/version"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
attr_reader :state
|
3
|
+
def pipe object, &block
|
4
|
+
Class.new(BasicObject) do
|
5
|
+
attr_reader :state
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
def self.run object, &block
|
8
|
+
runner = new object
|
9
|
+
runner.instance_eval(&block)
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def initialize starting_object
|
13
|
+
@state = starting_object
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
#end
|
16
|
+
def method_missing(m, *args, &block)
|
17
|
+
@state = state.send(m, *args, &block)
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end.run(object, &block).state
|
21
|
+
end
|
data/lib/pipelining/version.rb
CHANGED