cuprum 0.7.0.rc.0 → 0.7.0.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/DEVELOPMENT.md +1 -0
- data/lib/cuprum/processing.rb +9 -3
- data/lib/cuprum/utils/result_not_empty_warning.rb +13 -6
- data/lib/cuprum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e0ca5271959fafe43676c1ba02d71d3f5e32aaa
|
4
|
+
data.tar.gz: 63d16aac59bdb484d16c2c828eaabf5c962e70f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae506bda9686706cfb1732187b02bfa5c665570b4eaf5c5a00f59fee25cd2879ca266d4a789767ad41875a9a06f422cf9c780b5275efe1742a6c3f382a01997d
|
7
|
+
data.tar.gz: 2c2f9c39c30efebb7d31fa8f24b668b424ea0b279e8312f59c2be04ca84d7b940369db2a3fc49f284e0a97f19bd175e531167fa6fb6d3d0d263438146338948a
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,8 @@ Implemented the `#arity` method, which returns an indication of the number of ar
|
|
18
18
|
|
19
19
|
Refactored internal logic for returning result objects.
|
20
20
|
|
21
|
+
Fixed a bug causing an erroneous warning to be displayed when `#process` discards an old result with a value.
|
22
|
+
|
21
23
|
## 0.6.0
|
22
24
|
|
23
25
|
The "By Your Command" Update.
|
data/DEVELOPMENT.md
CHANGED
data/lib/cuprum/processing.rb
CHANGED
@@ -128,9 +128,7 @@ module Cuprum
|
|
128
128
|
if value_is_result?(other)
|
129
129
|
return result if result == other
|
130
130
|
|
131
|
-
|
132
|
-
Cuprum.warn(Cuprum::Utils::ResultNotEmptyWarning.new(result).message)
|
133
|
-
end # if
|
131
|
+
warn_unless_empty!(result)
|
134
132
|
|
135
133
|
other.to_result
|
136
134
|
else
|
@@ -176,5 +174,13 @@ module Cuprum
|
|
176
174
|
def value_is_result? value
|
177
175
|
VALUE_METHODS.all? { |method_name| value.respond_to?(method_name) }
|
178
176
|
end # method value
|
177
|
+
|
178
|
+
def warn_unless_empty! result
|
179
|
+
return unless result.respond_to?(:empty?) && !result.empty?
|
180
|
+
|
181
|
+
not_empty = Cuprum::Utils::ResultNotEmptyWarning.new(result)
|
182
|
+
|
183
|
+
Cuprum.warn(not_empty.message) if not_empty.warning?
|
184
|
+
end # method warn_unless_empty!
|
179
185
|
end # module
|
180
186
|
end # module
|
@@ -16,10 +16,16 @@ module Cuprum::Utils
|
|
16
16
|
|
17
17
|
# @return [String] The warning message for the given result.
|
18
18
|
def message
|
19
|
-
|
19
|
+
return ''.freeze if warnings.empty?
|
20
|
+
|
20
21
|
MESSAGE + humanize_list(warnings).freeze
|
21
22
|
end # method message
|
22
23
|
|
24
|
+
# @return [Boolean] True if a warning is generated, otherwise false.
|
25
|
+
def warning?
|
26
|
+
!warnings.empty?
|
27
|
+
end # method warning?
|
28
|
+
|
23
29
|
private
|
24
30
|
|
25
31
|
attr_reader :result
|
@@ -55,11 +61,12 @@ module Cuprum::Utils
|
|
55
61
|
end # method status_set_warning
|
56
62
|
|
57
63
|
def warnings
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
64
|
+
@warnings ||=
|
65
|
+
[
|
66
|
+
errors_not_empty_warning,
|
67
|
+
status_set_warning,
|
68
|
+
halted_warning
|
69
|
+
].compact
|
63
70
|
end # method warnings
|
64
71
|
end # class
|
65
72
|
end # module
|
data/lib/cuprum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuprum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.0.rc.
|
4
|
+
version: 0.7.0.rc.1
|
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: 2018-03-
|
11
|
+
date: 2018-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|