cascading-configuration-setting 2.0.3 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -202,7 +202,7 @@ Causes configuration variable to be stored in external context so that it is not
|
|
202
202
|
|
203
203
|
(The MIT License)
|
204
204
|
|
205
|
-
Copyright (c)
|
205
|
+
Copyright (c) Asher
|
206
206
|
|
207
207
|
Permission is hereby granted, free of charge, to any person obtaining
|
208
208
|
a copy of this software and associated documentation files (the
|
data/README.rdoc
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
|
2
2
|
if $__cascading_configuration__spec__development
|
3
3
|
require_relative '../../variable/lib/cascading-configuration-variable.rb'
|
4
|
+
require_relative '../../methods/lib/cascading-configuration-methods.rb'
|
4
5
|
else
|
5
6
|
require 'cascading-configuration-variable'
|
7
|
+
require 'cascading-configuration-methods'
|
6
8
|
end
|
7
9
|
|
8
10
|
module ::CascadingConfiguration
|
9
11
|
module Setting
|
10
|
-
module Interface
|
11
|
-
end
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
require_relative 'cascading-configuration-setting/CascadingConfiguration/Setting/Interface.rb'
|
16
15
|
require_relative 'cascading-configuration-setting/CascadingConfiguration/Setting.rb'
|
@@ -1,10 +1,31 @@
|
|
1
1
|
|
2
2
|
module ::CascadingConfiguration::Setting
|
3
3
|
|
4
|
-
# Configuration modules for storage of settings variables
|
5
4
|
include ::CascadingConfiguration::Variable
|
5
|
+
include ::CascadingConfiguration::Inheritance
|
6
|
+
|
7
|
+
def attr_configuration( *configuration_names ) ;; end
|
8
|
+
def attr_module_configuration( *configuration_names ) ;; end
|
9
|
+
def attr_class_configuration( *configuration_names ) ;; end
|
10
|
+
def attr_local_configuration( *configuration_names ) ;; end
|
11
|
+
def attr_object_configuration( *configuration_names ) ;; end
|
12
|
+
def attr_instance_configuration( *configuration_names ) ;; end
|
13
|
+
|
14
|
+
ccv = ::CascadingConfiguration::Variable
|
15
|
+
ccm = ::CascadingConfiguration::Methods
|
16
|
+
|
17
|
+
setter_proc = ::Proc.new do |instance, configuration_name, value|
|
18
|
+
|
19
|
+
return ccv.set_configuration_variable( instance, configuration_name, value )
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
getter_proc = ::Proc.new do |instance, configuration_name|
|
24
|
+
|
25
|
+
return ccv.get_configuration_searching_upward( instance, configuration_name )
|
26
|
+
|
27
|
+
end
|
6
28
|
|
7
|
-
|
8
|
-
include ::CascadingConfiguration::Setting::Interface
|
29
|
+
ccm.declare_cascading_configuration( self, nil,setter_proc, getter_proc )
|
9
30
|
|
10
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cascading-configuration-setting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cascading-configuration-variable
|
16
|
-
requirement: &
|
16
|
+
requirement: &70280265531800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,14 +21,13 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70280265531800
|
25
25
|
description: Provides :attr_configuration.
|
26
26
|
email: asher@ridiculouspower.com
|
27
27
|
executables: []
|
28
28
|
extensions: []
|
29
29
|
extra_rdoc_files: []
|
30
30
|
files:
|
31
|
-
- lib/cascading-configuration-setting/CascadingConfiguration/Setting/Interface.rb
|
32
31
|
- lib/cascading-configuration-setting/CascadingConfiguration/Setting.rb
|
33
32
|
- lib/cascading-configuration-setting.rb
|
34
33
|
- spec/CascadingConfiguration/Setting_spec.rb
|
@@ -54,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
53
|
version: '0'
|
55
54
|
requirements: []
|
56
55
|
rubyforge_project: cascading-configuration-setting
|
57
|
-
rubygems_version: 1.8.
|
56
|
+
rubygems_version: 1.8.11
|
58
57
|
signing_key:
|
59
58
|
specification_version: 3
|
60
59
|
summary: Support package for cascading-configuration.
|
@@ -1,114 +0,0 @@
|
|
1
|
-
|
2
|
-
module ::CascadingConfiguration::Setting::Interface
|
3
|
-
|
4
|
-
######################
|
5
|
-
# self.setter_proc #
|
6
|
-
######################
|
7
|
-
|
8
|
-
def self.setter_proc( configuration_name )
|
9
|
-
|
10
|
-
return Proc.new do |value|
|
11
|
-
|
12
|
-
return ::CascadingConfiguration::Variable.set_configuration_variable( self,
|
13
|
-
configuration_name,
|
14
|
-
value )
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
######################
|
21
|
-
# self.getter_proc #
|
22
|
-
######################
|
23
|
-
|
24
|
-
def self.getter_proc( configuration_name )
|
25
|
-
|
26
|
-
return Proc.new do
|
27
|
-
|
28
|
-
return ::CascadingConfiguration::Variable.
|
29
|
-
get_configuration_searching_upward( self, configuration_name )
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
########################
|
36
|
-
# attr_configuration #
|
37
|
-
########################
|
38
|
-
|
39
|
-
# defines configuration in class or module
|
40
|
-
# configuration cascades downward to instance including all classes or modules in-between
|
41
|
-
def attr_configuration( *configuration_names )
|
42
|
-
|
43
|
-
return ::CascadingConfiguration::Variable.
|
44
|
-
define_cascading_configuration( self,
|
45
|
-
::CascadingConfiguration::Setting::Interface,
|
46
|
-
*configuration_names )
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
###############################
|
51
|
-
# attr_module_configuration #
|
52
|
-
###############################
|
53
|
-
|
54
|
-
# defines configuration in class or module
|
55
|
-
# configuration cascades downward to last class or module
|
56
|
-
def attr_module_configuration( *configuration_names )
|
57
|
-
|
58
|
-
return ::CascadingConfiguration::Variable.
|
59
|
-
define_module_configuration( self,
|
60
|
-
::CascadingConfiguration::Setting::Interface,
|
61
|
-
*configuration_names )
|
62
|
-
|
63
|
-
end
|
64
|
-
alias_method :attr_class_configuration, :attr_module_configuration
|
65
|
-
|
66
|
-
##############################
|
67
|
-
# attr_local_configuration #
|
68
|
-
##############################
|
69
|
-
|
70
|
-
# local to class or module that declares it
|
71
|
-
# also local to instances of class or module
|
72
|
-
# * any instances of class
|
73
|
-
# * first class to include module (inherited)
|
74
|
-
def attr_local_configuration( *configuration_names )
|
75
|
-
|
76
|
-
return ::CascadingConfiguration::Variable.
|
77
|
-
define_local_configuration( self,
|
78
|
-
::CascadingConfiguration::Setting::Interface,
|
79
|
-
*configuration_names )
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
###############################
|
84
|
-
# attr_object_configuration #
|
85
|
-
###############################
|
86
|
-
|
87
|
-
# local to class or module or instance that declares it
|
88
|
-
# * only in the instance that declares it
|
89
|
-
def attr_object_configuration( *configuration_names )
|
90
|
-
|
91
|
-
return ::CascadingConfiguration::Variable.
|
92
|
-
define_object_configuration( self,
|
93
|
-
::CascadingConfiguration::Setting::Interface,
|
94
|
-
*configuration_names )
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
#################################
|
99
|
-
# attr_instance_configuration #
|
100
|
-
#################################
|
101
|
-
|
102
|
-
# local to class or module or instance that declares it
|
103
|
-
# * in instances of the class or module that declares it
|
104
|
-
# * in instance if declared on non-class/non-module object instance
|
105
|
-
def attr_instance_configuration( *configuration_names )
|
106
|
-
|
107
|
-
return ::CascadingConfiguration::Variable.
|
108
|
-
define_instance_configuration( self,
|
109
|
-
::CascadingConfiguration::Setting::Interface,
|
110
|
-
*configuration_names )
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
end
|