istox 0.2.14.3 → 0.2.17.pre.50

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 191d8ea6fdad58b0fe99961ac461eaaab8d80e684172b11632d056e27f9b6c92
4
- data.tar.gz: c69b2ef4fbd2ee80619690ba61cd434f6f527f95ea2cb3c9dd44e35cc997200e
3
+ metadata.gz: dcb82d8972b1737ba6a5474bc2ad48d569caeb14a82479434e8aade03c4241e9
4
+ data.tar.gz: a57d68d034660f773739f6db1f447c3323eb7476711d0db107ba3c2034165fe3
5
5
  SHA512:
6
- metadata.gz: f3c49ba90cb39a0773de6bc7781d08c66e1db7356d214c2c971fd0dae7b4d0daa92c5e9fda2426df67cd2a8ffa13816d263946aab46ca564833ff6cc6e220b36
7
- data.tar.gz: 78f888d34684fc979354b8bc13b781f0f9aee530c2ffa0f46285298f460dda6a96c235a47856b25e711cf853df5208a0e98e02b3e3d4c3080d14219697d84038
6
+ metadata.gz: adab4a8f94665fda362e07c4f6138d5cca2773ec3ca3776be30b17159f2c38aae198899e3ba08a02901a65823a82da4025b92fecef14f401134c3539e5a7e76f
7
+ data.tar.gz: 5c1b7f90c1e20281cd59dde6157a1acc9352029a89a6487655444caaa103e91748c800d563005f8b5ec43158f78eac9c182aabae178bce90704db2edb185db54
data/.gitignore CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/.solargraph.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.2.14.2)
4
+ istox (0.2.15)
5
5
  amazing_print
6
6
  awesome_print
7
7
  aws-sdk-sns (~> 1)
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- # rubocop:disable Naming/UncommunicativeMethodParamName
1
+ # rubocop:disable Naming/MethodParameterName
2
2
  module Istox
3
3
  class FMath
4
4
  class << self
@@ -74,6 +74,21 @@ module Istox
74
74
  ::BigDecimal.new(x.to_s).round(digits).to_s
75
75
  end
76
76
 
77
+ def round_half_up(x, digits)
78
+ BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up)
79
+ x = 0 if x.blank?
80
+ ::BigDecimal.new(x.to_s).round(digits).to_s
81
+ end
82
+
83
+ # rounding mechanism can be 'down', 'up', or 'natural'
84
+ # by default will be :down
85
+ def round(x, digits, rounding_mechanism: 'down')
86
+ return round_up(x, digits) if rounding_mechanism == 'up'
87
+ return round_half_up(x, digits) if rounding_mechanism == 'natural'
88
+
89
+ round_down(x, digits)
90
+ end
91
+
77
92
  private
78
93
 
79
94
  def to_fixed(x)
@@ -86,4 +101,4 @@ module Istox
86
101
  end
87
102
  end
88
103
  end
89
- # rubocop:enable Naming/UncommunicativeMethodParamName
104
+ # rubocop:enable Naming/MethodParameterName
File without changes
File without changes
@@ -13,7 +13,7 @@ module Istox
13
13
  log.info("Acquiring lock for key: #{key}, expired in #{expired_seconds} seconds, result: #{result}")
14
14
 
15
15
  # if result false means the key already exist
16
- result
16
+ [true, 1].include?(result)
17
17
  end
18
18
 
19
19
  def release(key)
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.14.3'.freeze
2
+ VERSION = '0.2.17-50'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14.3
4
+ version: 0.2.17.pre.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -530,11 +530,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
530
530
  version: '0'
531
531
  required_rubygems_version: !ruby/object:Gem::Requirement
532
532
  requirements:
533
- - - ">="
533
+ - - ">"
534
534
  - !ruby/object:Gem::Version
535
- version: '0'
535
+ version: 1.3.1
536
536
  requirements: []
537
- rubygems_version: 3.0.6
537
+ rubygems_version: 3.2.11
538
538
  signing_key:
539
539
  specification_version: 4
540
540
  summary: istox backend shared gem