evt-configure 0.1.2.6 → 0.1.3.0

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
  SHA256:
3
- metadata.gz: 02075004cae1598d55f4bcb7c3099e675c6898889ef2d5373bd067291a736cd2
4
- data.tar.gz: d424c0e783b099b1f2f0225a736fa83ba052f8815b39c81bca96ac9a76d8d5af
3
+ metadata.gz: d3c20941996db2d2c3c3b9c89269971e1238f9414c477f313f0893466a60352f
4
+ data.tar.gz: d491ebbd166075cf64cf9b0cc616d72cc882cd57cce1ea52e8d4ac461739f5b6
5
5
  SHA512:
6
- metadata.gz: eeae52304982dde5ee6c1cf26381005f5af98cbe0a9e7151d9c52338fea88ee68da7a1f493c47404ae961faf39f7f5747bf99258c30e869af54eee256e8bbda9
7
- data.tar.gz: 65d05fb72de8a02ba8132f9f7988b9fa083bee66e285fff931229f6559239b00a66012fd11e4fd59d64a3718ccc9c095d9f7e120c5ace9259c050a7bdccf7d2a
6
+ metadata.gz: 07a067ee3efd159f37ad5238d0fe44f96a7e26860aa02a449e87a1b0432b72845dd62d5d3e1d9e65d50948f7c31a23ded0030be92dbd3f3bba0c6896853357ca
7
+ data.tar.gz: '09a5f4c7f9a2f3985a21c5a6fd38d892891e9351298ccb1ca1ea9c35ad97f90c00afc9744ac63ee56aa001ae075c1171a57d0806f85d6499371e965af7aa937a'
data/lib/configure.rb CHANGED
@@ -2,3 +2,4 @@ require 'ostruct'
2
2
 
3
3
  require 'configure/macro'
4
4
  require 'configure/activate'
5
+ require 'configure/configure'
@@ -8,7 +8,7 @@ module Configure
8
8
 
9
9
  macro_module = Configure::Macro
10
10
 
11
- return if target_class.is_a? macro_module
11
+ return if target_class.is_a?(macro_module)
12
12
 
13
13
  target_class.extend(macro_module)
14
14
 
@@ -0,0 +1,13 @@
1
+ module Configure
2
+ def self.included(cls)
3
+ cls.class_exec do
4
+ extend Macro
5
+ end
6
+ end
7
+
8
+ def self.extended(cls)
9
+ cls.class_exec do
10
+ extend Macro
11
+ end
12
+ end
13
+ end
@@ -1,4 +1,10 @@
1
- require 'configure/controls/classes/no_arguments'
2
- require 'configure/controls/classes/positional_argument'
3
- require 'configure/controls/classes/keyword_argument'
4
1
  require 'configure/controls/factory_method'
2
+
3
+ require 'configure/controls/example'
4
+
5
+ require 'configure/controls/extended'
6
+ require 'configure/controls/included'
7
+
8
+ require 'configure/controls/no_arguments'
9
+ require 'configure/controls/positional_argument'
10
+ require 'configure/controls/keyword_argument'
@@ -0,0 +1,13 @@
1
+ module Configure
2
+ module Controls
3
+ class Example
4
+ include Configure
5
+
6
+ configure :some_attr_name
7
+
8
+ def self.build
9
+ new
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ module Configure
2
+ module Controls
3
+ module Extended
4
+ class Example
5
+ extend Configure
6
+
7
+ configure :some_attr_name
8
+
9
+ def self.build
10
+ new
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,10 @@
1
1
  module Configure
2
2
  module Controls
3
3
  module FactoryMethod
4
+ def self.name
5
+ :make
6
+ end
7
+
4
8
  def make
5
9
  instance = new
6
10
  self.factory_method_called = true
@@ -0,0 +1,7 @@
1
+ module Configure
2
+ module Controls
3
+ module Included
4
+ Example = Example
5
+ end
6
+ end
7
+ end
@@ -1,25 +1,31 @@
1
1
  module Configure
2
2
  module Controls
3
- module Classes
4
- class KeywordArgument
5
- Configure.activate(self)
3
+ module KeywordArgument
4
+ class Example
5
+ include Configure
6
6
 
7
7
  configure :some_attr_name
8
8
 
9
- singleton_class.send :alias_method, :build, :new
9
+ def self.build(arg:)
10
+ new(arg: arg)
11
+ end
10
12
 
11
13
  attr_reader :arg
12
14
 
13
15
  def initialize(arg:)
14
16
  @arg = arg
15
17
  end
18
+ end
16
19
 
17
- class Optional
18
- Configure.activate(self)
20
+ module Optional
21
+ class Example
22
+ include Configure
19
23
 
20
24
  configure :some_attr_name
21
25
 
22
- singleton_class.send :alias_method, :build, :new
26
+ def self.build(arg: nil)
27
+ new(arg: arg)
28
+ end
23
29
 
24
30
  attr_reader :arg
25
31
 
@@ -0,0 +1,7 @@
1
+ module Configure
2
+ module Controls
3
+ module NoArguments
4
+ Example = Included::Example
5
+ end
6
+ end
7
+ end
@@ -1,25 +1,31 @@
1
1
  module Configure
2
2
  module Controls
3
- module Classes
4
- class PositionalArgument
5
- Configure.activate(self)
3
+ module PositionalArgument
4
+ class Example
5
+ include Configure
6
6
 
7
7
  configure :some_attr_name
8
8
 
9
- singleton_class.send :alias_method, :build, :new
9
+ def self.build(arg)
10
+ new(arg)
11
+ end
10
12
 
11
13
  attr_reader :arg
12
14
 
13
15
  def initialize(arg)
14
16
  @arg = arg
15
17
  end
18
+ end
16
19
 
17
- class Optional
18
- Configure.activate(self)
20
+ module Optional
21
+ class Example
22
+ include Configure
19
23
 
20
24
  configure :some_attr_name
21
25
 
22
- singleton_class.send :alias_method, :build, :new
26
+ def self.build(arg=nil)
27
+ new(arg)
28
+ end
23
29
 
24
30
  attr_reader :arg
25
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.6
4
+ version: 0.1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2018-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench
@@ -32,11 +32,15 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - lib/configure.rb
34
34
  - lib/configure/activate.rb
35
+ - lib/configure/configure.rb
35
36
  - lib/configure/controls.rb
36
- - lib/configure/controls/classes/keyword_argument.rb
37
- - lib/configure/controls/classes/no_arguments.rb
38
- - lib/configure/controls/classes/positional_argument.rb
37
+ - lib/configure/controls/example.rb
38
+ - lib/configure/controls/extended.rb
39
39
  - lib/configure/controls/factory_method.rb
40
+ - lib/configure/controls/included.rb
41
+ - lib/configure/controls/keyword_argument.rb
42
+ - lib/configure/controls/no_arguments.rb
43
+ - lib/configure/controls/positional_argument.rb
40
44
  - lib/configure/macro.rb
41
45
  homepage: https://github.com/eventide-project/settings
42
46
  licenses:
@@ -1,13 +0,0 @@
1
- module Configure
2
- module Controls
3
- module Classes
4
- class NoArguments
5
- Configure.activate(self)
6
-
7
- configure :some_attr_name
8
-
9
- singleton_class.send :alias_method, :build, :new
10
- end
11
- end
12
- end
13
- end