sleeping_king_studios-tools 0.7.0.beta.1 → 0.7.0.rc.0

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: f8c88e36d70d414c2f1bf914e3dc2087aefb2387
4
- data.tar.gz: 19ea37dd554eb8726fc3feb6c384ef4b17d93f07
3
+ metadata.gz: 62b15199f9c5de17132b5e6cd3e47f426385f0da
4
+ data.tar.gz: a9eb228c33889f8bc4280a33deab36722bc287c2
5
5
  SHA512:
6
- metadata.gz: 98497dccebd89845bdd7d8e973cd9917fcb6161f952923bdb7d27c49dbbfaaf3f4f7b4189b79386b39343272b5d1db6b8ac3b361feb4c29154916cd0a83d1148
7
- data.tar.gz: b227f43a6daf0922a315d5b4dc059708acce85331c65639dbf34e68247344e445e074631c5fe52deb532c062c50da3e411addb92fc36b4e1efd1a26ba908b1d3
6
+ metadata.gz: 33ac337400c83d57d375e53b767daf48f679648def7aa418f38cbec1d919ef6429a7523120ec003961c358279a10362959f815081bc6e414e1c117e4718b86b5
7
+ data.tar.gz: a0040c5da758d70204c4ddab2012f90e6a7dc568c2d2bd797a267beb6b82079fe24822d403f16c5b6bd2ccff91ecda14821ab634d155362a7c0ce6bd5c44dd77
@@ -9,7 +9,14 @@ module SleepingKingStudios::Tools::Toolbox
9
9
 
10
10
  # Defines a nested namespace for the configuration object.
11
11
  def namespace namespace_name, &block
12
- define_namespace namespace_name, &block
12
+ namespace =
13
+ (@namespaces ||= {}).fetch(namespace_name) do
14
+ @namespaces[namespace_name] = define_namespace namespace_name
15
+ end # fetch
16
+
17
+ namespace.instance_exec namespace, &block if block_given?
18
+
19
+ namespace
13
20
  end # method namespace
14
21
 
15
22
  # Defines an option for the configuration object.
@@ -40,25 +47,28 @@ module SleepingKingStudios::Tools::Toolbox
40
47
  end # method option_name=
41
48
  end # method define_mutator
42
49
 
43
- def define_namespace namespace_name, &block
50
+ def define_namespace namespace_name
44
51
  namespace =
45
52
  Class.new(SleepingKingStudios::Tools::Toolbox::Configuration)
46
- namespace.instance_exec namespace, &block if block_given?
47
53
 
48
- define_method namespace_name do
54
+ define_method namespace_name do |&block|
49
55
  if instance_variable_defined?(:"@#{namespace_name}")
50
- return instance_variable_get(:"@#{namespace_name}")
51
- end # if
56
+ config = instance_variable_get(:"@#{namespace_name}")
57
+ else
58
+ data = __get_value__(namespace_name, :default => Object.new)
59
+ config = namespace.new(data)
52
60
 
53
- data = __get_value__(namespace_name, :default => Object.new)
54
- config = namespace.new(data)
61
+ config.__root_namespace__ = __root_namespace__ || self
55
62
 
56
- config.__root_namespace__ = __root_namespace__ || self
63
+ instance_variable_set(:"@#{namespace_name}", config)
64
+ end # if
57
65
 
58
- instance_variable_set(:"@#{namespace_name}", config)
66
+ block.call(config) if block
59
67
 
60
68
  config
61
69
  end # method namespace_name
70
+
71
+ namespace
62
72
  end # method define_namespace
63
73
  end # module
64
74
  extend ClassMethods
@@ -15,8 +15,8 @@ module SleepingKingStudios
15
15
  MAJOR = 0
16
16
  MINOR = 7
17
17
  PATCH = 0
18
- PRERELEASE = :beta
19
- BUILD = 1
18
+ PRERELEASE = :rc
19
+ BUILD = 0
20
20
  end # module
21
21
 
22
22
  VERSION = Version.to_gem_version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleeping_king_studios-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta.1
4
+ version: 0.7.0.rc.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob "Merlin" Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake