flowing 0.1.0 → 0.1.1

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: d1ef73a20da4aab3be3a47598a04ece56613a35f
4
- data.tar.gz: db0be48a135e92a880a10626f188bf0ca1af6f97
3
+ metadata.gz: 62ae207491569c18bebc4bbaa86d17d86a0cde64
4
+ data.tar.gz: 2bf1fd3865a94743106e88bb0cf272ef8b296571
5
5
  SHA512:
6
- metadata.gz: 25e103073a02cd68d518ec5f37969b18840ca6a16db7e4a94e35cc08e513a588b75017825887d9f44ba39202242b2f8d97e6b47b55c6497c9e139ffd09e6b2a5
7
- data.tar.gz: 01b4a1af13d1d9721ff2251a7a720d2325963b1b9becaae2c2d0278026bd96a5f5dfdeaf7bc73c880f0e960b0c157f8f8fd6e2f76897ec7dafe7e225984cfa8a
6
+ metadata.gz: 9cbe04c35b5f62cbc57609a7e1d31b317876691665dda0d8aa01316b1eb541bef121128ce3f16575bf64c1358958239f638709562872bf216d49b0d2941da1b8
7
+ data.tar.gz: f7fa33f73588f8e551ded45f044924905711afce185648fceb45a8aa0cc8724734142d9d1ef299ebf81d83143e606c81595d98412eecc718fb8dbaf57e7257d5
@@ -5,14 +5,15 @@ module Flowing
5
5
  class NoActionError < StandardError; end
6
6
  attr_reader :context
7
7
 
8
- def self.run(context)
9
- flow = new(context)
8
+ def self.run(context, options = {})
9
+ flow = new(context, options)
10
10
  yield(flow)
11
11
  end
12
12
 
13
13
  def method_missing(method, *args, &block)
14
+
14
15
  action_class = begin
15
- "Flowing::Actions::#{method.to_s.camelize}".constantize
16
+ "#{@namespace}::#{method.to_s.camelize}".constantize
16
17
  rescue
17
18
  raise NoActionError, "Unregistered action '#{method}'"
18
19
  end
@@ -20,8 +21,9 @@ module Flowing
20
21
  action.call(*args)
21
22
  end
22
23
 
23
- def initialize(context)
24
+ def initialize(context, options = {})
24
25
  @context = context
26
+ @namespace = options[:namespace] || "Flowing::Actions"
25
27
  end
26
28
  end
27
29
  end
@@ -1,3 +1,3 @@
1
1
  module Flowing
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Lee