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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d95961cf9c0f704e80358834b1f45de5e3cc2e93
4
- data.tar.gz: 91bd9c25c66c817eb25b43c74218512848de860a
3
+ metadata.gz: e4b7111cf4b4f6b005040f3040ce4f00fda6703e
4
+ data.tar.gz: dd2acf0424f4b3e8502c6da84d15572632844249
5
5
  SHA512:
6
- metadata.gz: b9801022cb106352a814ac6fe87a17a498b0be4fad587c995758942d3697666daff0c5c66defe842a6f912f781bdcc5d8c3b4f4c603ca2819da3ffb1288d5748
7
- data.tar.gz: eb48ea7b3c4a1afa3a09c4f9497e63deec32a98bcebbbbb177914f2f6ce3086dd8fd593a8fe3ae65cc77804552294cac40decedabe1ff458a45373fda54c12d5
6
+ metadata.gz: fcce92c9ac9b43e9bc348a7fa3fe3ea54dd1ea4572fec9b7b2a59907f03a3504a8a65eb2927b09d8252b662f8ef35fa18db999dc6ff7b7da7037a0db3d7a1992
7
+ data.tar.gz: 0640a33c51657bc9ad86aab8778cb54d8428b56748fc648b0ead8909d84e2d5b13fde40228758c01aa911b33ba21fbc60dcd9630a7bdf7aec8ab38e4c59dc220
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Pre-release Versions
4
4
 
5
+ ### 0.1.3
6
+
7
+ Properly support both keywords and optional arguments in ObjectTools#apply.
8
+
5
9
  ### 0.1.2
6
10
 
7
11
  Fix loading order issues when loading SemanticVersion in isolation.
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2013-2014 Rob Smith
3
+ Copyright (c) 2013-2016 Rob Smith
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -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
- value = base.send temporary_method_name, *args, &block
30
-
31
- metaclass.send :remove_method, temporary_method_name
32
-
33
- value
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.
@@ -12,7 +12,7 @@ module SleepingKingStudios
12
12
 
13
13
  MAJOR = 0
14
14
  MINOR = 1
15
- PATCH = 2
15
+ PATCH = 3
16
16
  end # module
17
17
 
18
18
  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.1.2
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: 2014-11-02 00:00:00.000000000 Z
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.2.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: