xqsr3 0.33.0.1 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xqsr3/extensions/hash.rb +5 -0
- data/lib/xqsr3/extensions/hash/slice.rb +22 -0
- data/lib/xqsr3/extensions/test/unit/assert_raise_with_message.rb +2 -0
- data/lib/xqsr3/io/writelines.rb +10 -4
- data/lib/xqsr3/quality/parameter_checking.rb +3 -2
- data/lib/xqsr3/version.rb +2 -2
- data/test/unit/extensions/hash/tc_hash.rb +6 -0
- data/test/unit/extensions/hash/tc_slice.rb +31 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08b7e3524dc96db46918345f810db795701f4a10'
|
4
|
+
data.tar.gz: 05baa4102344c3fc236af32c03a596e592f6537d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4be49e79a61c9e44f12de294a1553f1cadc1e089bcda0b8defd567752716cface3e7b25e9a3699b584f305d94e9a5e6b848369a3fb10f6256b7c74f580ecbe0
|
7
|
+
data.tar.gz: cf295f1ea20af9bff3ebe1a2e457c4ac2dd4b440dc0a84f9310e5c3980e4994b65ddb17edf533a646cdf7ae18a23fe9ed493fc600e26d833f01cca3d732209a8
|
@@ -11,9 +11,11 @@ module X_assert_raise_with_message_ # :nodoc: all
|
|
11
11
|
|
12
12
|
if TestUnitVersion_.is_at_least? [ 3, 0, 8 ]
|
13
13
|
|
14
|
+
# @!visibility private
|
14
15
|
AssertionFailedError_ = Test::Unit::AssertionFailedError # :nodoc:
|
15
16
|
else
|
16
17
|
|
18
|
+
# @!visibility private
|
17
19
|
class AssertionFailedError_ < ArgumentError; end # :nodoc:
|
18
20
|
end
|
19
21
|
|
data/lib/xqsr3/io/writelines.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Adds a writelines() method to the IO module
|
6
6
|
#
|
7
7
|
# Created: 13th April 2007
|
8
|
-
# Updated:
|
8
|
+
# Updated: 16th April 2019
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
@@ -56,7 +56,8 @@ module Xqsr3
|
|
56
56
|
module IO
|
57
57
|
|
58
58
|
private
|
59
|
-
|
59
|
+
# @!visibility private
|
60
|
+
module WriteLine_Constants_ #:nodoc: all
|
60
61
|
|
61
62
|
NUMBER_OF_LINES_TO_EXAMINE = 20
|
62
63
|
|
@@ -64,7 +65,9 @@ module IO
|
|
64
65
|
|
65
66
|
private
|
66
67
|
|
67
|
-
|
68
|
+
# @!visibility private
|
69
|
+
def self.write_to_target_ target, contents, line_separator, column_separator # :nodoc:
|
70
|
+
|
68
71
|
$stderr.puts "#{self.class}.write_to_target_(target(#{target.class})='#{target}', contents(#{contents.class})='#{contents}', line_separator(#{line_separator.class})='#{line_separator}', column_separator=(#{column_separator.class})='#{column_separator}')" if $DEBUG
|
69
72
|
if contents.instance_of? ::Hash
|
70
73
|
|
@@ -87,7 +90,9 @@ $stderr.puts "#{self.class}.write_to_target_(target(#{target.class})='#{target}'
|
|
87
90
|
# embedded eol, in which case the empty string is returned to force no
|
88
91
|
# (additional) separator will be used. Otherwise, it returns "\n" to
|
89
92
|
# ensure that that is used.
|
90
|
-
|
93
|
+
#
|
94
|
+
# @!visibility private
|
95
|
+
def self.deduce_line_separator_ contents, eol_lookahead_limit # :nodoc:
|
91
96
|
|
92
97
|
if contents.instance_of? ::Hash
|
93
98
|
|
@@ -193,3 +198,4 @@ end # module Xqsr3
|
|
193
198
|
|
194
199
|
# ############################## end of file ############################# #
|
195
200
|
|
201
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Definition of the ParameterChecking module
|
6
6
|
#
|
7
7
|
# Created: 12th February 2015
|
8
|
-
# Updated:
|
8
|
+
# Updated: 15th April 2019
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
@@ -59,7 +59,8 @@ module Quality
|
|
59
59
|
module ParameterChecking
|
60
60
|
|
61
61
|
private
|
62
|
-
|
62
|
+
# @!visibility private
|
63
|
+
module Util_ # :nodoc: all
|
63
64
|
|
64
65
|
def self.join_with_or a
|
65
66
|
|
data/lib/xqsr3/version.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Version for Xqsr3 library
|
6
6
|
#
|
7
7
|
# Created: 3rd April 2016
|
8
|
-
# Updated:
|
8
|
+
# Updated: 4th July 2019
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
@@ -50,7 +50,7 @@
|
|
50
50
|
module Xqsr3
|
51
51
|
|
52
52
|
# Current version of the Xqsr3 library
|
53
|
-
VERSION = '0.
|
53
|
+
VERSION = '0.34.0'
|
54
54
|
|
55
55
|
private
|
56
56
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
|
4
|
+
|
5
|
+
require 'xqsr3/extensions/hash/slice'
|
6
|
+
|
7
|
+
class Test_Hash_slice < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def test_empty
|
10
|
+
|
11
|
+
assert_equal ({}), ({}.slice())
|
12
|
+
|
13
|
+
assert_equal ({}), ({}.slice(:abc, 'def'))
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_none_matching
|
17
|
+
|
18
|
+
assert_equal ({}), ({ abc: 'abc', 'def' => :def }.slice())
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_all_matching
|
22
|
+
|
23
|
+
assert_equal ({ abc: 'abc', 'def' => :def }), ({ abc: 'abc', 'def' => :def }.slice(:abc, 'def'))
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_some_matching
|
27
|
+
|
28
|
+
assert_equal ({ abc: 'abc' }), ({ abc: 'abc', 'def' => :def }.slice(:abc, 'ghi'))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xqsr3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04
|
11
|
+
date: 2019-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
eXtensions by fine Quantum for Standard Ruby and 3rd-party libraries is a
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/xqsr3/extensions/hash/deep_transform.rb
|
43
43
|
- lib/xqsr3/extensions/hash/has_match.rb
|
44
44
|
- lib/xqsr3/extensions/hash/match.rb
|
45
|
+
- lib/xqsr3/extensions/hash/slice.rb
|
45
46
|
- lib/xqsr3/extensions/io.rb
|
46
47
|
- lib/xqsr3/extensions/io/writelines.rb
|
47
48
|
- lib/xqsr3/extensions/kernel.rb
|
@@ -102,6 +103,8 @@ files:
|
|
102
103
|
- test/unit/extensions/enumerable/tc_unique.rb
|
103
104
|
- test/unit/extensions/enumerable/ts_all.rb
|
104
105
|
- test/unit/extensions/hash/tc_deep_transform.rb
|
106
|
+
- test/unit/extensions/hash/tc_hash.rb
|
107
|
+
- test/unit/extensions/hash/tc_slice.rb
|
105
108
|
- test/unit/extensions/hash/ts_all.rb
|
106
109
|
- test/unit/extensions/io/tc_writelines.rb
|
107
110
|
- test/unit/extensions/io/ts_all.rb
|