simple_pipeline 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f5cbe78df308227f273429f35076b7cd0cbbe76d
4
+ data.tar.gz: 8bba7a8aa97709ab873daa5387bbc79d4947c852
5
+ SHA512:
6
+ metadata.gz: 2e4084681ee5817434341d714df17d16320f13d197ae90ba744ee1c807838264110c4f8b6f769ec836d84004c121d0c5f35ecf7902527ddb93bcb78e0073852e
7
+ data.tar.gz: 197fc96cc90add02ce7dd2395ada21ca2ed6acfdaf98f1ae98d8552fedbea7d04512b92a79a37800b87cfeedb5ffdf209e205b4ddb0cdf71eb3b8bf93161da6b
@@ -0,0 +1,35 @@
1
+ module SimplePipeline
2
+
3
+ class Pipe
4
+
5
+ DEFAULT_OPTIONS = {}
6
+
7
+ def initialize (options = {})
8
+ @options = DEFAULT_OPTIONS.merge(options)
9
+ @sections = []
10
+ end
11
+
12
+ def add (section)
13
+ begin
14
+ raise ArgumentError, "invalid section - incorrect number of arguments for process() method (should be 1)" unless section.class.instance_method(:process).arity == 1
15
+ rescue NameError
16
+ raise ArgumentError, "invalid section - process() method not found"
17
+ end
18
+
19
+ @sections << section
20
+ end
21
+
22
+ def size
23
+ return @sections.size
24
+ end
25
+
26
+ def process (payload)
27
+ @sections.each do |section|
28
+ section.process(payload)
29
+ end
30
+ end
31
+
32
+ alias :length :size
33
+ end
34
+
35
+ end
@@ -0,0 +1,3 @@
1
+ module SimplePipeline
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ require "simple_pipeline/pipe"
2
+ require "simple_pipeline/version"
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simple_pipeline
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Wong
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - jonathan@armchairtheorist.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/simple_pipeline.rb
21
+ - lib/simple_pipeline/pipe.rb
22
+ - lib/simple_pipeline/version.rb
23
+ homepage: http://github.com/armchairtheorist/simple_pipeline
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.4.2
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Simple implementation of a configurable processing pipeline framework for
47
+ sequential execution of reusable code components.
48
+ test_files: []