comparison 0.1.99 → 0.1.100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/comparison/presenter.rb +16 -5
- data/lib/comparison/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0e8d2bec70b83572712b131b41afae523f0f5bf2a68057ebf0f3ceca471df7
|
4
|
+
data.tar.gz: 60d11ba61eedaca4bce96d1cceddeb7caf5f9ea11cf53cb6519a3380904ea8a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec743eb02eafcf845f4676d30f8606b7d3045fe5d98fc00a8dad0795996e483dd6a0c4ad94b25646ef7a9987dbe4dbd7e3561d66415b9fc1e1cfb205fcde2ae6
|
7
|
+
data.tar.gz: c499e868d7dac4693627c7ffad1d7a199cd9921ed6df3c262919ab558442ce7ae6172f13da5f5668a676a87c07d0b659f460827c6de6da32f5f8b46918701ece
|
data/README.md
CHANGED
@@ -81,9 +81,9 @@ en:
|
|
81
81
|
negative: 'comparison negative'
|
82
82
|
nochange: 'comparison nochange'
|
83
83
|
style:
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
positive: 'color: #3c763d; background-color: #dff0d8;'
|
85
|
+
negative: 'color: #a94442; background-color: #f2dede;'
|
86
|
+
nochange: 'color: #777777;'
|
87
87
|
icons:
|
88
88
|
positive_html: '<span class="glyphicon glyphicon-arrow-up"></span>'
|
89
89
|
negative_html: '<span class="glyphicon glyphicon-arrow-down"></span>'
|
data/lib/comparison/presenter.rb
CHANGED
@@ -197,6 +197,19 @@ module Comparison
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
200
|
+
##
|
201
|
+
# Returns a string description of the direction of change. Possible
|
202
|
+
# descriptions are "positive", "negative", and "nochange".
|
203
|
+
def description
|
204
|
+
if positive?
|
205
|
+
'positive'
|
206
|
+
elsif negative?
|
207
|
+
'negative'
|
208
|
+
else
|
209
|
+
'nochange'
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
200
213
|
def css
|
201
214
|
Kernel.warn '[DEPRECATION WARNING] #css is deprecated: ' \
|
202
215
|
"use #style instead: #{caller(3..3).first}"
|
@@ -205,11 +218,9 @@ module Comparison
|
|
205
218
|
|
206
219
|
private
|
207
220
|
|
208
|
-
def number_to_percentage(value,
|
209
|
-
|
210
|
-
|
211
|
-
precision: precision,
|
212
|
-
**options
|
221
|
+
def number_to_percentage(value, **options)
|
222
|
+
options = { delimiter: ',', precision: 0, **options }
|
223
|
+
ActiveSupport::NumberHelper.number_to_percentage value, options
|
213
224
|
end
|
214
225
|
|
215
226
|
def number_to_currency(*args)
|
data/lib/comparison/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comparison
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.100
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Parker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
|
112
|
-
rubygems_version: 2.7.7
|
111
|
+
rubygems_version: 3.0.2
|
113
112
|
signing_key:
|
114
113
|
specification_version: 4
|
115
114
|
summary: Helpers for displaying details of comparing two numbers.
|