friendly_numbers 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +44 -0
- data/CHANGELOG.md +5 -0
- data/lib/friendly_numbers/number_to_currency.rb +5 -3
- data/lib/friendly_numbers/number_to_percentage.rb +1 -1
- data/lib/friendly_numbers/version.rb +1 -1
- metadata +4 -5
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 433e9b8147e6f42996925ee4ac1d1f85700b262ec5ea9905c046bd68d7bfa59d
|
4
|
+
data.tar.gz: 8761157d53a90ac189e9af187cbea8a7e45feb4a947926c28bb09026e27845ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1daf85daea83121b95608527169abac068464a65300e1ddcc33e958ea32d8d2cc1b06333acb652219ab409a2a3fc9d8339d04c5ab41fd9d2f026d66105f893c3
|
7
|
+
data.tar.gz: bfb873a0e78426deccd60b3e9c05ddf8199987558a36b439a4da93182530f9b444f108180f7a39cf9874769b33962e2431d3b41f5f3cd34cb18a3df78bf35879
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# vim:ts=2:sts=2:sw=2:et:
|
2
|
+
---
|
3
|
+
version: 2.0
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
"ruby-2.4":
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.4
|
9
|
+
steps:
|
10
|
+
- checkout
|
11
|
+
- run: gem install bundler -v 1.13 --no-document
|
12
|
+
- run: bundle install --path vendor/bundle
|
13
|
+
- run:
|
14
|
+
name: Run tests
|
15
|
+
command: rake test
|
16
|
+
|
17
|
+
"ruby-2.5":
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:2.5
|
20
|
+
steps:
|
21
|
+
- checkout
|
22
|
+
- run: gem install bundler -v 1.13 --no-document
|
23
|
+
- run: bundle install --path vendor/bundle
|
24
|
+
- run:
|
25
|
+
name: Run tests
|
26
|
+
command: rake test
|
27
|
+
|
28
|
+
"ruby-2.6":
|
29
|
+
docker:
|
30
|
+
- image: circleci/ruby:2.6
|
31
|
+
steps:
|
32
|
+
- checkout
|
33
|
+
- run: bundle install --path vendor/bundle
|
34
|
+
- run:
|
35
|
+
name: Run tests
|
36
|
+
command: rake test
|
37
|
+
|
38
|
+
workflows:
|
39
|
+
version: 2
|
40
|
+
build:
|
41
|
+
jobs:
|
42
|
+
- "ruby-2.4"
|
43
|
+
- "ruby-2.5"
|
44
|
+
- "ruby-2.6"
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# master
|
2
2
|
|
3
|
+
# 0.5.0 (2019-03-28)
|
4
|
+
- Properly escape percent sign in percentage helper
|
5
|
+
- Fix handling of whole numbers in currency helper
|
6
|
+
- Fix decimal precision in currency helper
|
7
|
+
|
3
8
|
# 0.4.0 (2017-11-16)
|
4
9
|
- Ignore rational when passed to seconds_to_time
|
5
10
|
|
@@ -15,9 +15,11 @@ module FriendlyNumbers
|
|
15
15
|
|
16
16
|
parted = partition(whole, options[:separator])
|
17
17
|
|
18
|
-
options[:
|
19
|
-
|
20
|
-
|
18
|
+
if options[:precision].nonzero?
|
19
|
+
decimal = sprintf("%.0#{options[:precision]}f", part.abs)[1..-1] # Strip leading 0
|
20
|
+
end
|
21
|
+
|
22
|
+
options[:unit] + parted + decimal.to_s
|
21
23
|
end
|
22
24
|
|
23
25
|
def partition(whole, separator)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_numbers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Daniels
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,8 +63,8 @@ executables: []
|
|
63
63
|
extensions: []
|
64
64
|
extra_rdoc_files: []
|
65
65
|
files:
|
66
|
+
- ".circleci/config.yml"
|
66
67
|
- ".gitignore"
|
67
|
-
- ".travis.yml"
|
68
68
|
- CHANGELOG.md
|
69
69
|
- Gemfile
|
70
70
|
- LICENSE.txt
|
@@ -98,8 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
|
102
|
-
rubygems_version: 2.5.2
|
101
|
+
rubygems_version: 3.0.1
|
103
102
|
signing_key:
|
104
103
|
specification_version: 4
|
105
104
|
summary: Friendly number helpers for your non-Rails/Padrino apps.
|