lucarecord 0.2.20 → 0.2.21
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 +4 -0
- data/lib/luca_record/version.rb +1 -1
- data/lib/luca_support.rb +1 -0
- data/lib/luca_support/code.rb +21 -2
- data/lib/luca_support/config.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f10c954f77059dc814f1aac38335ca0e1597d0db8e7e754a93f6a67714cce1
|
4
|
+
data.tar.gz: fd0e684124f7683e49192b231fd8f245e09c1fdd281f88fac7dcc309f92713bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfd7fdcc8f63dc889fcd51ae8e6e9d8a842a2b87ac5e7c7235e6c1ca9aa5f3886d86f8af71de0bf5e379a428b4c9fa15a2f300118427849da46124fcf4ee7532
|
7
|
+
data.tar.gz: 7e39c7ada92fbc48aad6492362d9f22f8cfa2c3fa109183410d5de9f64641b8d566c206d165026a92f48dd2aa6b2aa310f69a1ff1d7fefc43f48226b5d2065e5
|
data/CHANGELOG.md
CHANGED
data/lib/luca_record/version.rb
CHANGED
data/lib/luca_support.rb
CHANGED
data/lib/luca_support/code.rb
CHANGED
@@ -48,8 +48,27 @@ module LucaSupport
|
|
48
48
|
'0123456789ABCDEFGHIJKLMNOPQRSTUV'.index(char)
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
# Format number in 3-digit-group.
|
52
|
+
# Long decimal is just ommitted with floor().
|
53
|
+
#
|
54
|
+
def delimit_num(num, decimal: nil, delimiter: nil)
|
55
|
+
return nil if num.nil?
|
56
|
+
|
57
|
+
decimal ||= LucaSupport::Config::DECIMAL_NUM
|
58
|
+
str = case num
|
59
|
+
when BigDecimal
|
60
|
+
if decimal == 0
|
61
|
+
num.floor.to_s.reverse.gsub!(/(\d{3})(?=\d)/, '\1 ').reverse!
|
62
|
+
else
|
63
|
+
fragments = num.floor(decimal).to_s('F').split('.')
|
64
|
+
fragments[0].reverse!.gsub!(/(\d{3})(?=\d)/, '\1 ').reverse!
|
65
|
+
fragments[1].gsub!(/(\d{3})(?=\d)/, '\1 ')
|
66
|
+
fragments.join('.')
|
67
|
+
end
|
68
|
+
else
|
69
|
+
num.to_s.reverse.gsub!(/(\d{3})(?=\d)/, '\1 ').reverse!
|
70
|
+
end
|
71
|
+
delimiter.nil? ? str : str.gsub!(/\s/, delimiter)
|
53
72
|
end
|
54
73
|
|
55
74
|
# encode directory name from year and month.
|
data/lib/luca_support/config.rb
CHANGED
@@ -3,10 +3,16 @@
|
|
3
3
|
require 'pathname'
|
4
4
|
require 'yaml'
|
5
5
|
|
6
|
-
#
|
7
6
|
# startup config
|
8
7
|
#
|
9
8
|
module LucaSupport
|
9
|
+
PJDIR = ENV['LUCA_TEST_DIR'] || Dir.pwd.freeze
|
10
|
+
CONFIG = begin
|
11
|
+
YAML.load_file(Pathname(PJDIR) / 'config.yml', **{})
|
12
|
+
rescue Errno::ENOENT
|
13
|
+
{}
|
14
|
+
end
|
15
|
+
|
10
16
|
module Config
|
11
17
|
# Project top directory.
|
12
18
|
Pjdir = ENV['LUCA_TEST_DIR'] || Dir.pwd.freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucarecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|