sleeping_king_studios-tools 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/lib/sleeping_king_studios/tools/object_tools.rb +10 -6
- data/lib/sleeping_king_studios/tools/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b7111cf4b4f6b005040f3040ce4f00fda6703e
|
4
|
+
data.tar.gz: dd2acf0424f4b3e8502c6da84d15572632844249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcce92c9ac9b43e9bc348a7fa3fe3ea54dd1ea4572fec9b7b2a59907f03a3504a8a65eb2927b09d8252b662f8ef35fa18db999dc6ff7b7da7037a0db3d7a1992
|
7
|
+
data.tar.gz: 0640a33c51657bc9ad86aab8778cb54d8428b56748fc648b0ead8909d84e2d5b13fde40228758c01aa911b33ba21fbc60dcd9630a7bdf7aec8ab38e4c59dc220
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -20,17 +20,21 @@ module SleepingKingStudios::Tools
|
|
20
20
|
#
|
21
21
|
# @return The result of calling the proc or lambda with the given
|
22
22
|
# receiver and any additional arguments or block.
|
23
|
-
def apply base, proc, *args, &block
|
23
|
+
def apply base, proc, *args, **kwargs, &block
|
24
24
|
temporary_method_name = :__sleeping_king_studios_tools_object_tools_temporary_method_for_applying_proc__
|
25
25
|
|
26
26
|
metaclass = class << base; self; end
|
27
27
|
metaclass.send :define_method, temporary_method_name, &proc
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
begin
|
30
|
+
if kwargs.empty?
|
31
|
+
base.send temporary_method_name, *args, &block
|
32
|
+
else
|
33
|
+
base.send temporary_method_name, *args, **kwargs, &block
|
34
|
+
end # if-else
|
35
|
+
ensure
|
36
|
+
metaclass.send :remove_method, temporary_method_name if temporary_method_name && defined?(temporary_method_name)
|
37
|
+
end
|
34
38
|
end # method apply
|
35
39
|
|
36
40
|
# Returns the object's eigenclass.
|
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.1.
|
4
|
+
version: 0.1.3
|
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:
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -109,9 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.5.1
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: A library of utility services and concerns.
|
116
116
|
test_files: []
|
117
|
-
has_rdoc:
|