pathway 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f08df7daa90f1675a099551783c3bba0cb8371f8
4
- data.tar.gz: 313773af0d379310bd55d5bbfc536ce51a91b70a
3
+ metadata.gz: 8d6a15fc0bae89799a3319794db455b88ffb2cb9
4
+ data.tar.gz: 3cb9fa1d1419710cfe1a8d8a5bb4f9d2f1fc40c6
5
5
  SHA512:
6
- metadata.gz: 0c9c704a68d3f24756cf8b43a6049663bcecaf8055b9c6794c227fad096770a346a3d7d6b00b1da53013d8879fe3693ab469b95298ca167c5d550f46f56c7b4f
7
- data.tar.gz: fbf219d58c759cadb6753317b828497e7cba6b133edda435b95c33a0d72fdfca9e3c3c61c52b4ddaa25dc3ab65d194181c1a70998602ed8414eb927c7fa6ed47
6
+ metadata.gz: 473514f3a66e5d4458a63496e0e0e3a8ce89f948a336c12e1c0d4ab7a2e84bc209689b53357b827446b72654edc722ba1f25e6b22ad1bef8fe343554587eef8c
7
+ data.tar.gz: ddd9e04b4fa38d4bfc7a22418273b16fa944aca8a196e512eaf5ad1bde2958f8ed496db295a6539dd669da60e66e4d7c4afde5d365e4c3121a68ce95bab37cc9
data/lib/pathway.rb CHANGED
@@ -13,13 +13,18 @@ module Pathway
13
13
 
14
14
  self.extend plugin::ClassMethods if plugin.const_defined? :ClassMethods
15
15
  self.include plugin::InstanceMethods if plugin.const_defined? :InstanceMethods
16
- # TODO: Separate DSL per operation hierarchy
17
- DSL.include plugin::DSLMethods if plugin.const_defined? :DSLMethods
16
+ self::DSL.include plugin::DSLMethods if plugin.const_defined? :DSLMethods
17
+
18
18
  plugin.apply(self) if plugin.respond_to?(:apply)
19
19
  end
20
- end
21
20
 
22
- class DSL
21
+ def self.inherited(subclass)
22
+ subclass.const_set :DSL, Class.new(self::DSL)
23
+ super
24
+ end
25
+
26
+ class DSL
27
+ end
23
28
  end
24
29
 
25
30
  class Error < StandardError
@@ -77,9 +82,9 @@ module Pathway
77
82
  attr_accessor :result_key
78
83
 
79
84
  def process(&bl)
85
+ dsl = self::DSL
80
86
  define_method(:call) do |input|
81
- DSL.new(self, input).run(&bl)
82
- .then { |state| state[result_key] }
87
+ dsl.new(self, input).run(&bl).then(&:result)
83
88
  end
84
89
  end
85
90
 
@@ -1,3 +1,3 @@
1
1
  module Pathway
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pathway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Herrero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inflecto